Specifications
The trailing '-' character in the CROSS_COMPILE variable value is optional and has no effect on
the cross tools behavior. However, it is required when building Linux kernel and U-Boot images.
•
Add the directories /opt/eldk/usr/bin and /opt/eldk/bin to PATH:
bash$ PATH=$PATH:/opt/eldk/usr/bin:/opt/eldk/bin
•
Compile a file:
bash$ ${CROSS_COMPILE}gcc -o hello_world hello_world.c
You can also call the cross tools using the generic prefix arm-linux- for example:
bash$ arm-linux-gcc -o hello_world hello_world.c
•
or, equivalently:
bash /opt/eldk/usr/arm-linux/bin/gcc -o hello_world hello_world.c
•
The value of the CROSS_COMPILE variable must correspond to the target CPU family you want the cross
tools to work for. Refer to the table below for the supported CROSS_COMPILE variable values:
3.6.A Table of possible values for $CROSS_COMPILE
CROSS_COMPILE Value Predefined Compiler Flag FPU present or not
arm-linux- -mcpu=arm9 -msoft-float No
armVFP-linux- -mfpu=vfp -mfloat-abi=softfp Yes (VFP)
3.6.1. Switching Between Multiple Installations
No special actions are required from the user to switch between multiple ELDK installations on the same host
system. Which ELDK installation is used is determined entirely by the filesystem location of the binary that is
being invoked. This approach can be illustrated using the following example.
Assume the directory /work/denx_tools/usr/bin, where the arm-linux-gcc compiler binary has been
installed, is a part of the PATH environment variable. The user types the command as follows:
$ arm-linux-gcc -c myfile.c
To load the correct include files, find the correct libraries, spec files, etc., the compiler needs to know the
ELDK root directory. The compiler determines this information by analyzing the shell command it was
invoked with ( arm-linux-gcc - without specifying the explicit path in this example) and, if needed, the
value of the PATH environment variable. Thus, the compiler knows that it has been executed from the
/work/denx_tools/usr/bin directory.
Then, it knows that the compiler is installed in the usr/bin subdirectory of the root installation directory, so the
ELDK, the compiler is a part of, has been installed in the subdirectories of the /work/denx_tools directory.
This means that the target include files are in /work/denx_tools/<target_cpu_variant>/usr/include, and so on.
3.7. Mounting Target Components via NFS
The target components of the ELDK can be mounted via NFS as the root file system for your target machine.
For instance, for an AT91-based target, and assuming the ELDK has been installed into the /opt/eldk
directory, you can use the following directory as the NFS-based root file system:
3.7. Mounting Target Components via NFS 15