一、下载安装包
下载地址:https://launchpad.net/gcc-arm-embedded/+download
选择linux版本下载:
gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2
其它版本下载地址:https://developer.arm.com/downloads/-/gnu-rm
二、安装步骤
2.1、在ubuntu下解压安装包
tar -jxvf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2
2.2、在/usr/local目录下新建文件夹arm,将解压后的文件夹拷贝过来
cp -r /home/ubuntu/Desktop/gcc-arm-none-eabi-5_4-2016q3 /usr/local/arm/
2.3、修改系统环境变量
vim /etc/profile
在最后一行添加下面内容:
export PATH=$PATH:/usr/local/arm/gcc-arm-none-eabi-5_4-2016q3/bin
2.4、安装依赖库
sudo apt-get install lsb-core
sudo apt-get install lib32ncurses5
sudo apt-get install lib32tinfo5
sudo apt-get install libc6-i386
注意,如果不安装依赖库libc6-i386,直接使用arm-none-eabi-gcc会提示如下错误:文章来源:https://www.toymoban.com/news/detail-688360.html
/usr/local/arm/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-gcc: No such file or directory
2.5、查看版本号
arm-none-eabi-gcc -v
安装成功后打印如下内容:文章来源地址https://www.toymoban.com/news/detail-688360.html
oot@ubuntu:/usr/local/arm/gcc-arm-none-eabi-5_4-2016q3/bin# arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/usr/local/arm/gcc-arm-none-eabi-5_4-2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/lto-wrapper
Target: arm-none-eabi
Configured with: /home/build/work/GCC-5-build/src/gcc/configure --target=arm-none-eabi --prefix=/home/build/work/GCC-5-build/install-native --libexecdir=/home/build/work/GCC-5-build/install-native/lib --infodir=/home/build/work/GCC-5-build/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/home/build/work/GCC-5-build/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/home/build/work/GCC-5-build/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/home/build/work/GCC-5-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-5-build/install-native/arm-none-eabi --build=i686-linux-gnu --host=i686-linux-gnu --with-gmp=/home/build/work/GCC-5-build/build-native/host-libs/usr --with-mpfr=/home/build/work/GCC-5-build/build-native/host-libs/usr --with-mpc=/home/build/work/GCC-5-build/build-native/host-libs/usr --with-isl=/home/build/work/GCC-5-build/build-native/host-libs/usr --with-cloog=/home/build/work/GCC-5-build/build-native/host-libs/usr --with-libelf=/home/build/work/GCC-5-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,armv7-r,armv8-m.base,armv8-m.main
Thread model: single
gcc version 5.4.1 20160919 (release) [ARM/embedded-5-branch revision 240496] (GNU Tools for ARM Embedded Processors)
到了这里,关于ubuntu下arm-none-eabi-gcc安装的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!