gcc-arm-none-eabi 用于编译 ARM 架构的裸机系统(包括 ARM Linux 的 boot、kernel,不适用编译 Linux 应用 Application)
gcc-arm-linux-gnueabi 主要用于基于ARM架构的Linux系统,可用于编译 ARM 架构的 u-boot、Linux内核、linux应用等。
sudo apt remove gcc-arm-none-eabi
GNU Arm 嵌入式工具链下载页面 https://developer.arm.com/downloads/-/gnu-rm
下载工具链,并保存在指定位置(自定义)。
cd /usr/local/bin/
sudo mkdir arm
cd arm
sudo wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
sudo tar -jxvf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
将所在的目录添加到 PATH 环境变量。
echo 'export PATH=$PATH:/usr/local/bin/arm/gcc-arm-none-eabi-10.3-2021.10/bin' | sudo tee -a /etc/profile.d/gcc-arm-none-eabi.sh
sudo vi /etc/profile
在文件最后添加
export PATH=$PATH:/usr/local/bin/arm/gcc-arm-none-eabi-10.3-2021.10/bin
sudo gedit /etc/environment
# PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
# 添加到末尾
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/bin/arm/gcc-arm-none-eabi-10.3-2021.10/bin"
使能环境变量
source /etc/profile
查看环境变量
echo $PATH
删除 GNU Arm Embedded 工具链的安装目录:
sudo rm -rf /opt/gcc-arm-none-eabi
删除用于设置环境变量的gcc-arm-none-eabi.sh文件:
sudo rm -rf /etc/profile.d/gcc-arm-none-eabi.sh