2005年4月29日

Build ARM ToolChain - I (Cont.)

4. GCC compiler
# cd ${PROJECT-PATH}/build-tools/build-gcc/
// Do not do the compilation under the original untar directory
// ../gcc-2.95.3/configure --target=arm-linux \
// --prefix=${PROJECT-PATH}/tools \
// --enable-languages=c,c++
// make all
// If there is no --with-headers and --with-libs flags, the compilation will be failed.
#../gcc-2.95.3/configure --target=arm-linux --prefix=${PROJECT-PATH}/tools --enable-languages=c,c++ --with-headers=${PROJECT-PATH}/tools/arm-linux/include --with-libs=${PROJECT-PATH}/tools/lib --with-float=soft --enable-threads
#make all
#make install
// Then, arm-linux-g++, arm-linux-c++, etc. will be created under tools/bin/ and overwrite previous bootstrap compiler binaries.

5. uClibc
// We need uClibc for our target, an embedded device.
#cd ${PROJECT-PATH}/build-tools/
#tar jxvf uClibc-0.9.16.tar.bz2
#cd ${PROJECT-PATH}/build-tools/uClibc-0.9.16
#make CROSS=arm-linux- menuconfig
// Configure the menu:
// Linux kernel header location = “${PROJECT-PATH}/kernel/linux-2.4.16-rmk2”
// Shared library loader path = /lib
// uClibc development environment directory = “${PROJECT-PATH}/tools/uClibc”
// Have to check FPU option, otherwise the compilation will complain symbolic errors.
#make CROSS=arm-linux-
#make CROSS=arm-linux- PREFIX=”” install
// Finally, uClibc components will be installed to ${PROJECT-PATH}/tools/uclibc.
// And arm-uclibc-gcc will be created as well.

Those new arm-uclibc-XXX, not arm-linux-XXX, binaries are what we needed for our embedded target. Those wrappers will help our applications to be built and linked with uClibc.

0 意見: