ARM交叉编译环境
1. 建立一个linux编译环境,我选的是Fedora 14。
本文所有操作都在root用户执行。
2. 交叉编译环境建立:
拷贝arm-2010.09-51-arm-none-eabi-i686-pc-linux-gnu.tar.bz2到Fedora14的/root/目录:
# cd /root/
# mkdir maxshu
# tar -jxvf arm-2010.09-51-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 -C maxshu/
# vi .bash_profile
PATH=/root/maxshu/arm-2010.09/bin/:$PATH:$HOME/bin
# . .bash_profile
# arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/root/maxshu/arm-2010.09/bin/../libexec/gcc/arm-none-eabi/4.5.1/lto-wrapper
Target: arm-none-eabi
Configured with: /scratch/julian/2010q3-release-eabi-lite/src/gcc-4.5-2010.09/configure –build=i686-pc-linux-gnu –host=i686-pc-linux-gnu –target=arm-none-eabi –enable-threads –disable-libmudflap –disable-libssp –disable-libstdcxx-pch –enable-extra-sgxxlite-multilibs –with-gnu-as –with-gnu-ld –with-specs=’%{save-temps: -fverbose-asm} -D__CS_SOURCERYGXX_MAJ__=2010 -D__CS_SOURCERYGXX_MIN__=9 -D__CS_SOURCERYGXX_REV__=51 %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}’ –enable-languages=c,c++ –disable-shared –enable-lto –with-newlib –with-pkgversion=’Sourcery G++ Lite 2010.09-51′ –with-bugurl=https://support.codesourcery.com/GNUToolchain/ –disable-nls –prefix=/opt/codesourcery –with-headers=yes –with-sysroot=/opt/codesourcery/arm-none-eabi –with-build-sysroot=/scratch/julian/2010q3-release-eabi-lite/install/arm-none-eabi –with-gmp=/scratch/julian/2010q3-release-eabi-lite/obj/host-libs-2010.09-51-arm-none-eabi-i686-pc-linux-gnu/usr –with-mpfr=/scratch/julian/2010q3-release-eabi-lite/obj/host-libs-2010.09-51-arm-none-eabi-i686-pc-linux-gnu/usr –with-mpc=/scratch/julian/2010q3-release-eabi-lite/obj/host-libs-2010.09-51-arm-none-eabi-i686-pc-linux-gnu/usr –with-ppl=/scratch/julian/2010q3-release-eabi-lite/obj/host-libs-2010.09-51-arm-none-eabi-i686-pc-linux-gnu/usr –with-host-libstdcxx=’-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm’ –with-cloog=/scratch/julian/2010q3-release-eabi-lite/obj/host-libs-2010.09-51-arm-none-eabi-i686-pc-linux-gnu/usr –with-libelf=/scratch/julian/2010q3-release-eabi-lite/obj/host-libs-2010.09-51-arm-none-eabi-i686-pc-linux-gnu/usr –disable-libgomp –enable-poison-system-directories –with-build-time-tools=/scratch/julian/2010q3-release-eabi-lite/install/arm-none-eabi/bin –with-build-time-tools=/scratch/julian/2010q3-release-eabi-lite/install/arm-none-eabi/bin
Thread model: single
gcc version 4.5.1 (Sourcery G++ Lite 2010.09-51)
测试