ARM交叉编译工具链的下载与安装

ARM的GNU交叉编译工具链下载链接:

https://launchpad.net/gcc-arm-embedded/+download

        因为海思Hi3559AV100平台SDK编译用到了ARM cortex M7核的gcc,根据文档说明,需要安装gcc-arm-none-eabi-4_9-2015q3.tgz,但我的SDK是别人共享的不是从海思官方获得的(以前的Hi3536等等交叉编译工具链、文档都是包含在SDK压缩包里面的,现在新的3559居然分开来放,容易搞错),所以没能获得海思改过的gcc-arm-none-eabi-4_9-2015q3.tgz,我打算使用标准的arm gnu gcc,我猜差异不大,毕竟gcc编译器一般比较稳定,海思修改过的gcc版本我猜最多是打一下gnu官方提供的bug修复补丁、改一下交叉编译工具链的名字,如aarch64-himix100-linux-这种,gcc的大多数bug都是不影响正常使用的。

        从上述网址下载gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2安装包后,
执行sudo tar jxf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 -C /opt/ ,即可把gcc安装到/opt目录下。

最后编辑 vim ~/.bashrc ,在文件末尾追加PATH环境变量:

export PATH=$PATH:/opt/gcc-arm-none-eabi-4_9-2015q3/bin/

使用 source ~/.bashrc 使得新的PATH环境变量在当前shell生效。

最后,验证一下gcc是否安装成功:

arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/opt/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/lto-wrapper
Target: arm-none-eabi
Configured with: /home/build/work/GCC-4-9-build/src/gcc/configure --target=arm-none-eabi --prefix=/home/build/work/GCC-4-9-build/install-native --libexecdir=/home/build/work/GCC-4-9-build/install-native/lib --infodir=/home/build/work/GCC-4-9-build/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/home/build/work/GCC-4-9-build/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/home/build/work/GCC-4-9-build/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/home/build/work/GCC-4-9-build/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/home/build/work/GCC-4-9-build/install-native/arm-none-eabi --build=i686-linux-gnu --host=i686-linux-gnu --with-gmp=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-mpfr=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-mpc=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-isl=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-cloog=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-libelf=/home/build/work/GCC-4-9-build/build-native/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors' --with-multilib-list=armv6-m,armv7-m,armv7e-m,cortex-m7,armv7-r
Thread model: single
gcc version 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 227977] (GNU Tools for ARM Embedded Processors)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章