linux 下安装arm-linux-gnueabi交叉编译器

1,开发平台

  虚拟机:vm12

  系统:ubuntu14.04 LTS  32位

2、准备ARM交叉编译工具包

  编译uboot和linux kernel都需要ARM交叉工具链支持,这里使用Linaro提供的交叉编译工具。下载地址为:http://releases.linaro.org/

  注意区分32位与64位:::getconf   LONG_BIT   查询

  64位下载地址:http://releases.linaro.org/components/toolchain/binaries/6.1-2016.08/arm-linux-gnueabi/gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi.tar.xz

  32位下载地址:http://releases.linaro.org/components/toolchain/binaries/6.1-2016.08/arm-linux-gnueabi/gcc-linaro-6.1.1-2016.08-i686_arm-linux-gnueabi.tar.xz

3、安装步骤

   1)在/usr/local/文件夹下建立名为ARM-toolchain的文件夹

      sudo mkdir /usr/local/ARM-toolchain

   2)将下载的压缩包拷贝到ARM-toolchain

   3)解压

      xz -d  gcc* .tar.xz

      tar xvf  gcc*.tar

   4)配置环境变量

      vi  /etc/bash.bashrc

      在末尾加入:export PATH="$PATH:/usr/local/ARM-toolchian/gcc-linaro-6.1.1-2016.08-i686_arm-linux-gnueabi/bin"

   5)生效

      source  /etc/bash.bashrc

   6)检查环境变量

      echo  $PATH 

    成功会出现:

root@ubuntu:/usr/local/ARM-toolchian/gcc-linaro-6.1.1-2016.08-i686_arm-linux-gnueabi# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/ARM-toolchain/gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi/bin:/usr/local/ARM-toolchian/gcc-linaro-6.1.1-2016.08-i686_arm-linux-gnueabi/bin

     7)  检查成功

root@ubuntu:/usr/local/ARM-toolchian/gcc-linaro-6.1.1-2016.08-i686_arm-linux-gnueabi# arm-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/usr/local/ARM-toolchian/gcc-linaro-6.1.1-2016.08-i686_arm-linux-gnueabi/bin/../libexec/gcc/arm-linux-gnueabi/6.1.1/lto-wrapper
Target: arm-linux-gnueabi
Configured with: /home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-i386-tcwg/target/arm-linux-gnueabi/snapshots/gcc-linaro-6.1-2016.08/configure SHELL=/bin/bash --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-i386-tcwg/target/arm-linux-gnueabi/_build/builds/destdir/i686-pc-linux-gnu --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-i386-tcwg/target/arm-linux-gnueabi/_build/builds/destdir/i686-pc-linux-gnu --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-i386-tcwg/target/arm-linux-gnueabi/_build/builds/destdir/i686-pc-linux-gnu --with-gnu-as --with-gnu-ld --disable-libstdcxx-pch --disable-libmudflap --with-cloog=no --with-ppl=no --with-isl=no --disable-nls --enable-c99 --enable-gnu-indirect-function --with-tune=cortex-a9 --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=softfp --with-mode=thumb --disable-multilib --enable-multiarch --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-i386-tcwg/target/arm-linux-gnueabi/_build/sysroots/arm-linux-gnueabi --enable-lto --enable-linker-build-id --enable-long-long --enable-shared --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-i386-tcwg/target/arm-linux-gnueabi/_build/builds/destdir/i686-pc-linux-gnu/arm-linux-gnueabi/libc --enable-languages=c,c++,fortran,lto --enable-checking=release --disable-bootstrap --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-linux-gnueabi --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-i386-tcwg/target/arm-linux-gnueabi/_build/builds/destdir/i686-pc-linux-gnu
Thread model: posix
gcc version 6.1.1 20160711 (Linaro GCC 6.1-2016.08) 

 

转载于:https://www.cnblogs.com/chu-yi/p/10376635.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值