UC-7400-LX Plus User’s Manual
Programmer’s Guide
5-3
Linux Tool Chain Introduction
To ensure that an application will be able to run correctly when installed on the UC-7400-LX Plus,
you must ensure that it is compiled and linked to the same libraries that will be present on the
UC-7400-LX Plus. This is particularly true when the RISC Xscale processor architecture of the
UC-7400-LX Plus differs from the CISC x86 processor architecture of the host system, but it is
also true if the processor architecture is the same.
The host tool chain that comes with the UC-7400-LX Plus contains a suite of cross compilers and
other tools, as well as the libraries and headers that are necessary to compile applications for the
UC-7400-LX Plus. The host environment must be running Linux to install the UC-7400-LX Plus
GNU Tool Chain. We have confirmed that the following Linux distribution can be used to install
the tool chain:
Fedora core 1/2/3/4/5.
The Tool Chain will need about 900 MB of hard disk space on your PC. The UC-7400-LX Plus
Tool Chain is located on the UC-7400-LX Plus CD. To install the Tool Chain, insert the CD into
your PC and then issue the following commands:
#mount –t iso9660 /dev/cdrom /mnt/cdrom
#cp /mnt/cdrom/tool-chain/linux/xscale_be_1.1.sh /tmp/
#sh /tmp/xscale_be_1.1.sh
Wait for a few minutes while the Tool Chain is installed automatically on your Linux PC. Once the
host environment has been installed, add the directory
/usr/local/xscale_be/bin/
to your path and
the directory
/usr/local/xscale_be/man/
to your manual path. You can do this temporarily for the
current login session by issuing the following commands:
#export PATH=“/usr/local/xscale_be/bin”:$PATH
#export MANPATH=“/usr/local/xscale_be/man”:$MANPATH
Alternatively, you can add the same commands to
$HOME/.bash_profile
to cause it to take effect
for all login sessions initiated by this user.
Obtaining help
Use the Linux man utility to obtain help on many of the utilities provided by the tool chain. For
example to get help on the xscale_be-gcc compiler, issue the command:
#man xscale_be-gcc
Cross Compiling Applications and Libraries
To compile a simple C application, just use the cross compiler instead of the regular compiler:
#xscale_be-gcc –o example –Wall –g –O2 example.c
#xscale_be-strip –s example
#xscale_be-gcc -ggdb –o example-debug example.c
Tools Available in the Host Environment
Most of the cross compiler tools are the same as their native compiler counterparts, but with an
additional prefix that specifies the target system. In the case of x86 environments, the prefix is
i386-linux- and in the case of UC-7400-LX Plus Xscale boards, it is
xscale_be-
.
For example, the native C compiler is gcc and the cross C compiler for Xscale in UC-7400-LX
Plus is
xscale_be-gcc
.