ARM交叉编译器安装

ARM 158浏览
安装arm交叉编译器

zshh-shaohua:~/ARM/arm资料$ cd exynos4412_lzy1/
zshh@zshh-shaohua:~/ARM/arm资料/exynos4412_lzy1$ ls
cross_compile  datasheet  Doc  images  rootfs  schematic  src  tools  usb_to_uart
zshh@zshh-shaohua:~/ARM/arm资料/exynos4412_lzy1$ cd cross_compile/
zshh@zshh-shaohua:~/ARM/arm资料/exynos4412_lzy1/cross_compile$ ls
arm-2013.05-24-arm-none-linux-gnueabi.bin  arm-linux-gcc-4.5.1.tar.bz2  arm-linux-gcc-4.7.3.tar.bz2
zshh@zshh-shaohua:~/ARM/arm资料/exynos4412_lzy1/cross_compile$ mkdir /usr/local/arm^C
zshh@zshh-shaohua:~/ARM/arm资料/exynos4412_lzy1/cross_compile$ tar -xvf /usr/local/arm/
4.5.1/                       arm-linux-gcc-4.5.1.tar.bz2
zshh@zshh-shaohua:~/ARM/arm资料/exynos4412_lzy1/cross_compile$ tar -xvf /usr/local/arm/arm-linux-gcc-4.5.1.tar.bz2
zshh@zshh-shaohua:~/ARM/arm资料/exynos4412_lzy1/cross_compile$ tar -xvf /usr/local/arm/arm-linux-gcc-4.5.1.tar.bz2 -C /usr/local/arm

vim ~/.bashrc

在最后一行加PATH=/usr/local/arm/4.5.1/bin:$PATH


测试一安装是成功:

使得配置文件立即生效:
zshh@zshh-shaohua:~/ARM/arm资料/exynos4412_lzy1/cross_compile$ source ~/.bashrc

查看linux文件得版本:
zshh@zshh-shaohua:~/ARM/arm资料/exynos4412_lzy1/cross_compile$ arm-linux-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gcc
COLLECT_LTO_WRAPPER=/usr/local/arm/4.5.1/bin/../libexec/gcc/arm-none-linux-gnueabi/4.5.1/lto-wrapper
Target: arm-none-linux-gnueabi
Configured with: /work/toolchain/build/src/gcc-4.5.1/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-none-linux-gnueabi --prefix=/opt/FriendlyARM/toolschain/4.5.1 --with-sysroot=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/sys-root --enable-languages=c,c++ --disable-multilib --with-cpu=arm1176jzf-s --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=softfp --with-pkgversion=ctng-1.8.1-FA --with-bugurl=http://www.arm9.net/ --disable-sjlj-exceptions --enable-__cxa_atexit --disable-libmudflap --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-gmp=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-mpfr=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-ppl=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-cloog=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-mpc=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-libelf=/work/toolchain/build/arm-none-linux-gnueabi/build/static --enable-threads=posix --with-local-prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/sys-root --disable-nls --enable-symvers=gnu --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.5.1 (ctng-1.8.1-FA)


测试二安装是否成功:
	mkdir test
	cd test
	touch hello.c
	arm-linux-gcc hello.c -o hello