wget https://ftp.gnu.org/gnu/make/make-4.1.tar.gz
tar xf make-4.1.tar.gz
cd make-4.1
./configure --prefix=/usr/local/make
make && make install
# 一定要把旧版本make移走,要不可能会报错
mv $(which make){,_old}
ln -s /usr/local/make/bin/make /usr/local/sbin/
make -v
升级gcc
wget https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.gz
tar xvf gcc-8.3.0.tar.gz
./contrib/download_prerequisites
tar xf gmp-6.1.0.tar.bz2
tar xf mpfr-3.1.4.tar.bz2
tar xf mpc-1.0.3.tar.gz
tar xf isl-0.18.tar.bz2
cd gmp-6.1.0
./configure --prefix=/usr/local/gmp && make && make install
cd mpfr-3.1.4
./configure --prefix=/usr/local/mpfr --with-gmp=/usr/local/gmp/ && make && make install
cd mpc-1.0.3
./configure --prefix=/usr/local/mpc --with-gmp=/usr/local/gmp --with-mpfr=/usr/local/mpfr && make && make install
cd isl-0.18
./configure --prefix=/usr/local/isl --with-gmp-prefix=/usr/local/gmp && make && make install
cd gcc-8.3.0
mkdir build
cd build
../configure --prefix=/usr/local/gcc-8.3.0 --enable-checking=release --enable-languages=c,c++ --disable-multilib --with-gmp=/usr/local/gmp/ --with-mpfr=/usr/local/mpfr/ --with-mpc=/usr/local/mpc/
make -j 4 && make install
# 先 which gcc g++ c++ 看一下旧版本的位置
mv /bin/gcc{,_old}
mv /bin/g++{,_old}
mv /bin/c++{,_old}
mv /usr/lib64/libstdc++.so.6{,_old}
ln -s /usr/local/gcc-8.3.0/bin/gcc /bin/gcc
ln -s /usr/local/gcc-8.3.0/bin/g++ /bin/g++
ln -s /usr/local/gcc-8.3.0/bin/c++ /bin/c++
ln -s /usr/local/gcc-8.3.0/lib64/libstdc++.so.6.0.28 /usr/lib64/libstdc++.so.6
# 查看版本是否升级成功
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc-8.3.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/usr/local/gcc-9.3.0 --enable-checking=release --enable-languages=c,c++ --disable-multilib --with-gmp=/usr/local/gmp/ --with-mpfr=/usr/local/mpfr/ --with-mpc=/usr/local/mpc/
Thread model: posix
gcc version 8.3.0 (GCC)
升级glibc
tar xf glibc-2.28.tar.gz
cd glibc-2.28
mkdir build
cd build
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin --disable-sanity-checks --disable-werror && make && make install
# 验证
strings /lib64/libc.so.6 | grep ^GLIBC