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)

 

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