User`s manual

UC-7112-LX Plus Software User’s Manual Linux Tool Chain
5-2
Steps for Installing the Linux Tool Chain
The tool chain needs about 485 MB of hard disk space. To install it, follow these steps:
1. Insert the package CD into your PC and then issue the following commands:
#mount /dev/cdrom /mnt/cdrom
#sh /mnt/cdrom/tool-chain/linux/install.sh
2. Wait for the installation process to complete. This should take a few minutes.
3. Add the directory /usr/local/arm-linux/bin to your path. You can do this for the current
login by issuing the following command:
#export PATH=“/usr/local/arm-linux/bin:$PATH”
Alternatively, you can add the same commands to $HOME/.bash_profile to make so that
the command will be executed for all login sessions.
Compilation for Applications
To compile a simple C application, use the cross compiler instead of the regular compiler:
#arm-linux-gcc –o example –Wall –g –O2 example.c
#arm-linux-strip –s example
#arm-linux-gcc -ggdb –o example-debug example.c
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-7112-LX Plus ARM boards, it is
arm-linux-
.
For example, the native C compiler is
gcc
and the cross C compiler for ARM in the UC-7112-LX
Plus is
arm-linux-gcc.
The following cross compiler tools are provided:
ar Manages archives (static libraries)
as Assembler
c++, g++ C++ compiler
cpp C preprocessor
gcc C compiler
gdb Debugger
ld Linker
nm Lists symbols from object files
objcopy Copies and translates object files
objdump Displays information about object files
ranlib Generates indexes to archives (static libraries)
readelf Displays information about ELF files
size Lists object file section sizes
strings Prints strings of printable characters from files (usually object files)
strip Removes symbols and sections from object files (usually debugging information)