升级 Glibc-2.28
下载并解压 glibc-2.28
wget https://mirror.bjtu.edu.cn/gnu/libc/glibc-2.28.tar.xz
tar -xf glibc-2.28.tar.xz -C /usr/local/
cd /usr/local/glibc-2.28/
#创建临时文件build
mkdir build
cd build/
../configure --prefix=/usr/local/glibc-2.28
这一步时, 发生了错误, 提示大致为
These critical programs are missing or too old: make compiler
升级gcc
yum install gcc -y # 直接安装 GCC-8
yum -y install centos-release-scl
yum -y install devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils
scl enable devtoolset-8 bash
echo "source /opt/rh/devtoolset-8/enable" >>/etc/profile # 设置环境变量
升级make
wget http://ftp.gnu.org/gnu/make/make-4.3.tar.gz
tar -xzvf make-4.3.tar.gz
cd make-4.3 # 安装到指定目录
sudo ./configure
sudo make
sudo make install
sudo rm -rf /usr/bin/make
sudo cp ./make /usr/bin/
make -v
升级glibc-2.28
wget https://mirror.bjtu.edu.cn/gnu/libc/glibc-2.28.tar.xz
tar -xf glibc-2.28.tar.xz -C /usr/local
mkdir build
cd build/
yum install -y bison
sudo ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make #make 运行时间较长,可能会有半小时
sudo make install
通过strings /lib64/libc.so.6 |grep GLIBC查询是否存在glibc-2.28版本
strings /lib64/libc.so.6 | grep GLIBC
GLIBC_2.22GLIBC_2.23
GLIBC_2.24
GLIBC_2.25
GLIBC_2.26
GLIBC_2.27
GLIBC_2.28
GLIBC_PRIVATE
...
评论区