出于需求系统自带的是gcc4.4.7,版本太低无法编译,被逼无奈只能升级gcc了,碰到很多坑,下载这个玩意就用了不少时间。
1
2
3
4
5
6
|
[root@VM_222_92_centos ~]
# gcc -v
Using built-
in
specs.
Target: x86_64-redhat-linux
Configured with: ..
/configure
--prefix=
/usr
--mandir=
/usr/share/man
--infodir=
/usr/share/info
--with-bugurl=http:
//bugzilla
.redhat.com
/bugzilla
--
enable
-bootstrap --
-shared --
-threads=posix --
-checking=release --with-system-zlib --
-__cxa_atexit --disable-libunwind-exceptions --
-gnu-unique-object --
-languages=c,c++,objc,obj-c++,java,fortran,ada --
-java-awt=gtk --disable-dssi --with-java-home=
/usr/lib/jvm/java-1
.5.0-gcj-1.5.0.0
/jre
-libgcj-multifile --
-java-maintainer-mode --with-ecj-jar=
/usr/share/java/eclipse-ecj
.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
|
1.下载源码包
wget http:
//ftp
.gnu.org
/gnu/gcc/gcc-4
.8.0
/gcc-4
.8.0.
tar
.bz2
-jxvf gcc-4.8.0.
.bz2
|
2.下载编译所需依赖库
3
cd
gcc-4.8.0
.
/contrib/download_prerequisites
..