交叉编译工具arm-linux-gcc的安装

1. 重启能解决很多事情

为什么要将重启写在最前面呢? 因为今天安装了一早上的arm-linux-gcc, 但环境变量一直存在问题. 后来搜索了很多博客, 意外看到重启这个字眼. 试了一下, 发下成功了…

2. 文件下载

arm-linux-gcc-4.4.3.tar.gz

3. 解压

tar zxvf arm-linux-gcc-4.4.3.tar.gz

4. 进入opt文件夹

cd opt/FriendlyARM/

5. 将toolschain拷贝到系统盘

sudo cp -rv toolschain/ /usr/local/

6. 添加环境变量

cd ~

# 进入profile文件
vim .profile

# 在最后一行添加
export PATH=$PATH:/usr/local/toolschain/4.4.3/bin

# 保存退出后, 更新(可能需要重启)
source .profile

7. 查看效果

echo $PATH

如果出现/usr/local/toolschain/4.4.3/bin, 即代表安装正确

arm-linux-gcc -v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /opt/FriendlyARM/mini2440/build-toolschain/working/src/gcc-4.4.3/configure --build=i386-build_redhat-linux-gnu --host=i386-build_redhat-linux-gnu --target=arm-none-linux-gnueabi --prefix=/opt/FriendlyARM/toolschain/4.4.3 --with-sysroot=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root --enable-languages=c,c++ --disable-multilib --with-arch=armv4t --with-cpu=arm920t --with-tune=arm920t --with-float=soft --with-pkgversion=ctng-1.6.1 --disable-sjlj-exceptions --enable-__cxa_atexit --with-gmp=/opt/FriendlyARM/toolschain/4.4.3 --with-mpfr=/opt/FriendlyARM/toolschain/4.4.3 --with-ppl=/opt/FriendlyARM/toolschain/4.4.3 --with-cloog=/opt/FriendlyARM/toolschain/4.4.3 --with-mpc=/opt/FriendlyARM/toolschain/4.4.3 --with-local-prefix=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-c99 --enable-long-long --enable-target-optspace
Thread model: posix
gcc version 4.4.3 (ctng-1.6.1) 

猜你喜欢

转载自blog.csdn.net/Bat_Reality/article/details/118518175