【EmbeddedDev】升级gcc到4.8版本(旧版本为4.6)

升级gcc到4.8版本(旧版本为4.6)

deb http://ftp.cn.debian.org/debian/ jessie main non-free contrib
deb http://ftp.uk.debian.org/debian/ jessie main non-free contrib
  • 更新源设置
apt-get update
  • 查看gcc可用版本
root@beaglebone:/data/packages# apt-cache search gcc
colorgcc - Colorizer for GCC warning/error messages
cross-gcc-dev - Tools for building cross-compilers and cross-compiler packages
gcc-4.8 - GNU C compiler
gcc-4.8-base - GCC, the GNU Compiler Collection (base package)
gcc-4.8-locales - GCC, the GNU compiler collection (native language support files)
gcc-4.8-plugin-dev - Files for GNU GCC plugin development.
gcc-4.8-source - Source of the GNU Compiler Collection
gccgo-4.8 - GNU Go compiler
gdc-4.8 - GNU D compiler (version 2), based on the GCC backend
libgcc-4.8-dev - GCC support library (development files)
gcc-4.9 - GNU C compiler
gcc-4.9-base - GCC, the GNU Compiler Collection (base package)
gcc-4.9-locales - GCC, the GNU compiler collection (native language support files)
gcc-4.9-plugin-dev - Files for GNU GCC plugin development.
gcc-4.9-source - Source of the GNU Compiler Collection
gccgo-4.9 - GNU Go compiler
gdc-4.9 - GNU D compiler (version 2), based on the GCC backend
libgcc-4.9-dev - GCC support library (development files)
  • 安装gcc4.8
root@beaglebone:/data/packages# aptitude install gcc-4.8
The following NEW packages will be installed:
  cpp-4.8{ab} gcc-4.8{b} gcc-4.8-base{ab} libcloog-isl4{ab} libisl10{a} libmpc3{ab} 
The following packages will be REMOVED:
  cpp-4.7{u} 
0 packages upgraded, 6 newly installed, 1 to remove and 112 not upgraded.
Need to get 8436 kB of archives. After unpacking 12.7 MB will be used.
The following packages have unmet dependencies:
 gcc-4.8 : Depends: binutils (>= 2.24.90.20141219) but 2.22-8+deb7u2 is installed and it is kept back.
           Depends: libgcc-4.8-dev (>= 4.8.4-1) but it is not going to be installed.
           Depends: libmpfr4 (>= 3.1.2) but 3.1.0-5 is installed.
 gcc-4.8-base : Breaks: gcc-4.7-base (< 4.7.3) but 4.7.2-5 is installed.
 cpp-4.8 : Depends: libmpfr4 (>= 3.1.2) but 3.1.0-5 is installed.
 libcloog-isl4 : Depends: libisl10 (>= 0.11) but 0.10-3 is to be installed.
 libmpc3 : Depends: libmpfr4 (>= 3.1.2) but 3.1.0-5 is installed.
open: 39; closed: 102; defer: 20; conflict: 20                                                        
.The following actions will resolve these dependencies:
     Keep the following packages at their current version:
1)     cpp-4.8 [Not Installed]                            
2)     gcc-4.8 [Not Installed]                            
3)     gcc-4.8-base [Not Installed]                       
4)     libcloog-isl4 [Not Installed]                      
5)     libmpc3 [Not Installed]                            
Accept this solution? [Y/n/q/?] n
open: 70; closed: 249; defer: 39; conflict: 41                                                                                                                                                             .The following actions will resolve these dependencies:
      Remove the following packages:                                  
1)      gcc-4.7-base                                                  
      Install the following packages:                                 
2)      gcc-4.9-base [4.9.2-10 (stable)]                              
3)      libasan0 [4.8.4-1 (stable)]                                   
4)      libatomic1 [4.9.2-10 (stable)]                                
5)      libgcc-4.8-dev [4.8.4-1 (stable)]                             
6)      libisl10 [0.12.2-2 (stable)]                                  
      Upgrade the following packages:                                 
7)      binutils [2.22-8+deb7u2 (now, oldstable) -> 2.25-5 (stable)]  
8)      libc-bin [2.13-38+deb7u8 (now) -> 2.19-18+deb8u4 (stable)]    
9)      libc-dev-bin [2.13-38+deb7u8 (now) -> 2.19-18+deb8u4 (stable)]
10)     libc6 [2.13-38+deb7u8 (now) -> 2.19-18+deb8u4 (stable)]       
11)     libc6-dev [2.13-38+deb7u8 (now) -> 2.19-18+deb8u4 (stable)]   
12)     libgcc1 [1:4.7.2-5 (now, oldstable) -> 1:4.9.2-10 (stable)]   
13)     libgfortran3 [4.7.2-5 (now, oldstable) -> 4.9.2-10 (stable)]  
14)     libgomp1 [4.7.2-5 (now, oldstable) -> 4.9.2-10 (stable)]      
15)     libmpfr4 [3.1.0-5 (now, oldstable) -> 3.1.2-2 (stable)]       
16)     libstdc++6 [4.7.2-5 (now, oldstable) -> 4.9.2-10 (stable)]    
17)     locales [2.13-38+deb7u8 (now) -> 2.19-18+deb8u4 (stable)]     
Accept this solution? [Y/n/q/?] Y
The following NEW packages will be installed:
  cpp-4.8{a} gcc-4.8 gcc-4.8-base{a} gcc-4.9-base{a} libasan0{a} libatomic1{a} libcloog-isl4{a} libgcc-4.8-dev{a} libisl10{a} libmpc3{a} 
The following packages will be REMOVED:
  cpp-4.7{u} gcc-4.7-base{a} 
The following packages will be upgraded:
  binutils libc-bin libc-dev-bin libc6 libc6-dev libgcc1 libgfortran3 libgomp1 libmpfr4 libstdc++6 locales 
11 packages upgraded, 10 newly installed, 2 to remove and 106 not upgraded.
Need to get 24.4 MB of archives. After unpacking 23.1 MB will be used.
Do you want to continue? [Y/n/?] Y
  • 安装g++-4.8
root@beaglebone:/usr/bin# aptitude install g++-4.8
The following NEW packages will be installed:
  g++-4.8 libstdc++-4.8-dev{a} 
0 packages upgraded, 2 newly installed, 0 to remove and 106 not upgraded.
Need to get 11.5 MB of archives. After unpacking 27.4 MB will be used.
Do you want to continue? [Y/n/?] Y
Get: 1 http://ftp.cn.debian.org/debian/ jessie/main libstdc++-4.8-dev armhf 4.8.4-1 [1096 kB]
Get: 2 http://ftp.cn.debian.org/debian/ jessie/main g++-4.8 armhf 4.8.4-1 [10.4 MB]
Fetched 11.5 MB in 3s (3300 kB/s)  
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_TIME = "zh_CN.UTF-8",
    LC_MONETARY = "zh_CN.UTF-8",
    LC_ADDRESS = "zh_CN.UTF-8",
    LC_TELEPHONE = "zh_CN.UTF-8",
    LC_NAME = "zh_CN.UTF-8",
    LC_MEASUREMENT = "zh_CN.UTF-8",
    LC_IDENTIFICATION = "zh_CN.UTF-8",
    LC_NUMERIC = "zh_CN.UTF-8",
    LC_PAPER = "zh_CN.UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package libstdc++-4.8-dev:armhf.
(Reading database ... 60868 files and directories currently installed.)
Unpacking libstdc++-4.8-dev:armhf (from .../libstdc++-4.8-dev_4.8.4-1_armhf.deb) ...
Selecting previously unselected package g++-4.8.
Unpacking g++-4.8 (from .../g++-4.8_4.8.4-1_armhf.deb) ...
Setting up libstdc++-4.8-dev:armhf (4.8.4-1) ...
Setting up g++-4.8 (4.8.4-1) ...
root@beaglebone:/usr/bin# ls /usr/bin/g++
g++      g++-4.6  g++-4.8  
  • 设置默认为4.8版本
rm -f /usr/bin/gcc
ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
rm -f /usr/bin/g++
ln -s /usr/bin/g++-4.8 /usr/bin/g++
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值