具体需要升级成什么版本自行下载https://gcc.gnu.org/
本文升级为4.8.5
cd gcc-4.8.5
./contrib/download_prerequisites
cd ..
mkdir gcc-build-4.8.0
cd gcc-build-4.8.0
../gcc-4.8.0/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j4
[felix@MyTerminal ~]$ locate gcc-4.8.5|tail //查询gcc路径
/home/felix/Downloads/gcc-4.8.5/zlib/win32/zlib.def
/home/felix/Downloads/gcc-4.8.5/zlib/win32/zlib1.rc
/usr/local/bin/i686-pc-linux-gnu-gcc-4.8.5
/usr/local/share/gcc-4.8.5
/usr/local/share/gcc-4.8.5/python
/usr/local/share/gcc-4.8.5/python/libstdcxx
/usr/local/share/gcc-4.8.5/python/libstdcxx/__init__.py
/usr/local/share/gcc-4.8.5/python/libstdcxx/v6
/usr/local/share/gcc-4.8.5/python/libstdcxx/v6/__init__.py
/usr/local/share/gcc-4.8.5/python/libstdcxx/v6/printers.py
[felix@MyTerminal ~]$ ls /usr/local/bin | grep gcc //获得ggc名称
gcc
gcc-ar
gcc-nm
gcc-ranlib
i686-pc-linux-gnu-gcc
i686-pc-linux-gnu-gcc-4.8.5
i686-pc-linux-gnu-gcc-ar
i686-pc-linux-gnu-gcc-nm
i686-pc-linux-gnu-gcc-ranlib