编译安装
安装依赖包
代码语言:javascript复制yum install wget make gmp-devel mpfr-devel libmpc-devel bzip2 zlib-devel
下载、安装GCC
代码语言:javascript复制wget https://ftp.gnu.org/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.gz
tar xf gcc-8.3.0.tar.gz
cd gcc-8.3.0
./contrib/download_prerequisites
mkdir build
cd build
../configure --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c ,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --enable-gnu-indirect-function --with-tune=generic --disable-multilib
make -j 8
make install
查看gcc版本
代码语言:javascript复制gcc -v
参考:https://www.cnblogs.com/music-liang/p/12900457.html