Moxa W406-T-LX [58/74] Linux tool chain

Moxa W315A-LX [58/74] Linux tool chain
W315A/325A Linux User's Manual Development Tool Chains
5-2
Linux Tool Chain
The Linux tool chain contains a suite of cross compilers and other tools, as well as the libraries and header files
that are necessary to compile your applications. These tool chain components must be installed in a host PC
that is running Linux. We have confirmed that the following Linux distributions can be used to install the tool
chain.
Fefora core 1 & 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/W321.341.315.325.345_IA240.241_UC-7112PLUS_W315A.W
325A/Linux/install-1.2.sh
2. Wait a few minutes for the installation process to finish.
3. Add the directory /usr/local/arm-linux/bin to your path. You can do this for the current login by issuing
the following commands:
#export PATH=“/usr/local/arm-linux/bin:$PATH”
Alternatively, adding the same commands to $HOME/.bash_profile will make the path effective for all login
sessions.
Compiling an Application
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. For x86 environments, the prefix is
i386-linux-, and for ARM boards,
the prefix is
arm-linux
-
. For example, the native C compiler is gcc and the cross C compiler for ARM in the
W315A/325A 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)

Содержание

Скачать