1.下载地址
https://launchpad.net/gcc-arm-embedded/+download
2.安装方法
a.安装路径
cd usr/bin
b. 解压
tar jxvf xxxxxxxxxxxxxxx.tar.bz2 -C /usr/bin
c.修改环境变量
vim /etc/profile
添加export PATH=/usr/bin/gcc-arm-none-eabi-4_9-2015q1/bin:$PATH
d.使新的环境变量生效
source /etc/profile
reboot(选择)
e.检查路径添加是否成功
echo $PATH
3.多个gcc之间的切换
1.查看当前的gcc
$ ls /usr/bin/gcc* -l #查看当前所有的gcc
- lrwxrwxrwx 1 root root 7 Aug 23 2015 /usr/bin/gcc -> gcc-4.6
- -rwxr-xr-x 1 root root 306200 Apr 16 2012 /usr/bin/gcc-4.6
- -rwxr--r-- 1 root root 74404999 Aug 23 2015 /usr/bin/gcc-arm-none-eabi-4_9-2015q1-20150306-linux.tar.bz2
-
- /usr/bin/gcc-arm-none-eabi-4_9-2015q1:
- total 16
- drwxr-xr-x 6 root root 4096 Mar 6 2015 arm-none-eabi
- drwxr-xr-x 2 root root 4096 Mar 6 2015 bin
- drwxr-xr-x 3 root root 4096 Mar 6 2015 lib
- drwxr-xr-x 4 root root 4096 Mar 6 2015 share
-
- /usr/bin/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux:
- total 20
- drwxr-xr-x 7 1001 1001 4096 Mar 14 2013 arm-linux-gnueabihf
- drwxr-xr-x 2 1001 1001 4096 Mar 14 2013 bin
- drwxr-xr-x 3 1001 1001 4096 Mar 14 2013 lib
- drwxr-xr-x 3 1001 1001 4096 Mar 14 2013 libexec
- drwxr-xr-x 7 1001 1001 4096 Mar 14 2013 share
2.切换gcc
$cd /usr/bin
$gcc --version # 1.查看当前的gcc
$rm gcc
$ln -s /usr/bin/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-gcc gcc #arm-none-eabi-gcc为当前要使用的GCC
$gcc --version # 2.查看当前的gcc 与1不同