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:
bash$ export CROSS_COMPILE=ppc_4xxFP-
-
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 ppc-linux-
for example:
bash$ ppc-linux-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 |
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 |
ppc64-linux- | -mcpu=powerpc64 | Yes |

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
.
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
ppc-linux-gcc
compiler binary has been installed,
is a part of the
PATH
environment variable. The
user types the command as follows:
$ ppc_8xx-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 (
ppc_8xx-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.