1、升级make
下载 make-4.2.1 网址是 https://ftp.gnu.org/gnu/make/
tar -zxvf make-4.2.1.tar.gz
cd make-4.2.1
./configure --prefix=/usr/local/make-4.2.1
make && make install
export PATH=$PATH:/usr/local/make-4.2.1/bin
sudo ln -sf /usr/local/make-4.2.1/bin/make /usr/local/bin/gmake
export PATH=/usr/local/bin:$PATH
2、安装devtoolset-7
默认的centos7 源已经失效了,需要更换为阿里云的,可以参考:https://blog.csdn.net/qq_68174497/article/details/150497276
sudo yum install -y devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils
yum install -y centos-release-scl
scl enable devtoolset-7 bash
gcc --version
这个时候应该输出的是7.x 版本
3、安装glibc-2.29
glibc-2.29 下载包 https://ftp.gnu.org/gnu/glibc/
tar zxvf glibc-2.29.tar.gz
cd glibc-2.29
mkdir build
cd build
../configure --prefix=/usr/local/glibc-2.29
执行完这个步骤,一定要看有没有error,有的话借助大模型搞定error
make -j8
make install