linux 下安装arm-linux-gnueabi交叉编译器
Posted ._初一
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 查询
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
成功会出现:
[email protected]:/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) 检查成功
[email protected]:/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交叉编译器的主要内容,如果未能解决你的问题,请参考以下文章