Skip to main content.
Navigation:
DENX
>
DULG
>
ELDKUsage
Translations:
Edit
|
Attach
|
Raw
|
Ref-By
|
Printable
|
More
DULG
Sections of this site:
DENX Home
|
DULG
|
ELDK-5
|
Know
|
Training
|
U-Boot
|
U-Bootdoc
Topics
DULG Home
BoardSelect
Manual
FAQ
Application Notes
Changes
Index
List of pages in DULG
Search
%SECTION0{name=ELDKUsage}% Working with ELDK After the initial installation is complete, all you have to do to start working with the ELDK is to set and export the =CROSS_COMPILE= environment variable. Optionally, you may wish to add the =bin= and =usr/bin= directories of your ELDK installation to the value of your =PATH= environment variable. For instance, a sample ELDK installation and usage scenario looks as follows: * Create a new directory where the ELDK is to be installed, say: <verbatim> bash$ mkdir /opt/eldk </verbatim> * Mount a CD or an ISO image with the distribution: <verbatim> bash$ mount /dev/cdrom /mnt/cdrom </verbatim> * Run the installation utility included on the distribution to install into that specified directory: <verbatim> bash$ /mnt/cdrom/install -d /opt/eldk </verbatim> * After the installation utility completes, export the =CROSS_COMPILE= variable: <pre> bash$ export CROSS_COMPILE=%CROSS_COMPILE% </pre> * %T% 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=: <verbatim> bash$ PATH=$PATH:/opt/eldk/usr/bin:/opt/eldk/bin </verbatim> * Compile a file: <verbatim> bash$ ${CROSS_COMPILE}gcc -o hello_world hello_world.c </verbatim> %T% You can also call the cross tools using the generic prefix %IF{ "%ARCHITECTURE%" eq "powerpc" }% _ppc-linux-_ %ENDIF% %IF{ "%ARCHITECTURE%" eq "arm" }% _arm-linux-_ %ENDIF% %IF{ "%ARCHITECTURE%" eq "mips" }% _mips-linux-_ %ENDIF% for example: %IF{ "%ARCHITECTURE%" eq "powerpc" }% <verbatim> bash$ ppc-linux-gcc -o hello_world hello_world.c </verbatim> %ENDIF% %IF{ "%ARCHITECTURE%" eq "arm" }% <verbatim> bash$ arm-linux-gcc -o hello_world hello_world.c </verbatim> %ENDIF% %IF{ "%ARCHITECTURE%" eq "mips" }% <verbatim> bash$ mips-linux-gcc -o hello_world hello_world.c </verbatim> %ENDIF% * or, equivalently: %IF{ "%ARCHITECTURE%" eq "powerpc" }% <verbatim> bash$ /opt/eldk/usr/ppc-linux/bin/gcc -o hello_world hello_world.c </verbatim> %ENDIF% %IF{ "%ARCHITECTURE%" eq "arm" }% <verbatim> bash /opt/eldk/usr/arm-linux/bin/gcc -o hello_world hello_world.c </verbatim> %ENDIF% %IF{ "%ARCHITECTURE%" eq "mips" }% <verbatim> bash$ /opt/eldk/usr/mips-linux/bin/gcc -o hello_world hello_world.c </verbatim> %ENDIF% 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: #CrossCompileValues %ANCHOR{type=Table,name=CrossCompile}% Table of possible values for =$CROSS_COMPILE= %IF{ "%ARCHITECTURE%" eq "powerpc" }% | =CROSS_COMPILE= Value | Predefined Compiler Flag | FPU present or not | | ppc_4xx- | -mcpu=403 | No | | ppc_4xxFP- | -mcpu=405fp | Yes | | ppc_6xx- | -mcpu=603 | Yes | | ppc_74xx- | -mcpu=7400 | Yes | | ppc_8xx- | -mcpu=860 | No | | ppc_85xx- | -mcpu=8540 | Yes | | ppc_85xxDP- | -mcpu=8540 | Yes | | ppc64-linux- | -mcpu=powerpc64 | Yes | %T% For compatibility with older versions of the ELDK and with other toolkits the following values for =$CROSS_COMPILE= can be used, too: =ppc_7xx-= and =ppc_82xx-=. These are synonyms for =ppc_6xx=. %ENDIF% %IF{ "%ARCHITECTURE%" eq "arm" }% | =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) | %ENDIF% %IF{ "%ARCHITECTURE%" eq "mips" }% | =CROSS_COMPILE= Value | Predefined Compiler Flag | FPU present or not | | mips_4KC- | -march=r4kc | No | | mips_4KCle- | -march=r4kc | No | %ENDIF% %SECTION1{name=ELDKMultipleInstallations}% 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 %IF{ "%ARCHITECTURE%" eq "powerpc" }% =ppc-linux-gcc= %ENDIF% %IF{ "%ARCHITECTURE%" eq "arm" }% =arm-linux-gcc= %ENDIF% %IF{ "%ARCHITECTURE%" eq "mips" }% =mips-linux-gcc= %ENDIF% compiler binary has been installed, is a part of the =PATH= environment variable. The user types the command as follows: %IF{ "%ARCHITECTURE%" eq "powerpc"}% <verbatim> $ ppc_8xx-gcc -c myfile.c </verbatim> %ENDIF% %IF{ "%ARCHITECTURE%" eq "arm"}% <verbatim> $ arm-linux-gcc -c myfile.c </verbatim> %ENDIF% %IF{ "%ARCHITECTURE%" eq "mips"}% <verbatim> $ mips_4KC-gcc -c myfile.c </verbatim> %ENDIF% 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 ( %IF{ "%ARCHITECTURE%" eq "powerpc"}% =ppc_8xx-gcc= %ENDIF% %IF{ "%ARCHITECTURE%" eq "arm"}% =arm-linux-gcc= %ENDIF% %IF{ "%ARCHITECTURE%" eq "mips"}% =mips_4KC-gcc= %ENDIF% - 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.5.5. Removal of the Entire Installation
1. Abstract
3.7. Mounting Target Components via NFS
Prev
Home
Next