linux下安装交叉编译器

本文介绍了在Ubuntu系统中通过两种方式安装和配置GCC ARM 10.3工具链的方法,包括添加到.bashrc或/etc/profile,并验证其可用性的步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

方式1:在~/.brshrc中添加

1.解压交叉编译工具
ubuntu@ubuntu-ubuntu:/opt/arm/toolchain$ tar -zxvf gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.gz
2.在~/.bashrc最后面中添加路径
ubuntu@ubuntu-ubuntu: sudo vim ~/.bashrc

export PATH=$PATH:/opt/arm/toolchain/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin
3.重启终端
4.检查编译器能否正常使用
ubuntu@ubuntu-ubuntu:aarch64-rockchip1031-linux-gnu-gcc -v
.....
Supported LTO compression algorithms: zlib
gcc version 10.3.1 20210621 (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 

方式2:修改/etc/profile文件

1.解压交叉编译器后在/etc/profile文末添加编译器路径
ubuntu@ubuntu-ubuntu:sudo vi /etc/profile
export PATH=$PATH:/opt/arm/toolchain/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin
2.更新配置环境
ubuntu@ubuntu-ubuntu:source /etc/profile
3.检查编译器能否正常使用
ubuntu@ubuntu-ubuntu:aarch64-rockchip1031-linux-gnu-gcc -v
.....
Supported LTO compression algorithms: zlib
gcc version 10.3.1 20210621 (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值