码迷,mamicode.com
首页 > 系统相关 > 详细

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

时间:2019-02-14 20:18:25      阅读:613      评论:0      收藏:0      [点我收藏+]

标签:std   ecs   工具   tar   ++   work   bit   make   lap   

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) 

 

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

标签:std   ecs   工具   tar   ++   work   bit   make   lap   

原文地址:https://www.cnblogs.com/chu-yi/p/10376635.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!