升级glibc
#查询glibc版本:
strings /lib64/libc.so.6 | grep -E "^GLIBC" | sort -V -r | uniq
升级glibc2.28
wget https://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz
tar -xzvf 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
make
make install
查询是否升级成功
strings /lib64/libc.so.6 | grep GLIBC
问题一
执行
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
报错
*** These critical programs are missing or too old: make compiler
原因是make和compiler版本太低,需要进行升级
升级make
查看当前的make版本
make --version
去make官网查看最新版本
make官网:http://ftp.gnu.org/pub/gnu/make/
升级make
wget http://ftp.gnu.org/pub/gnu/make/make-4.4.tar.gz
tar -xzvf make-4.4.tar.gz
cd make-4.4/
mkdir build&&cd build
../configure --prefix=/usr/
bash build.sh
make install
查看是否升级成功
make --version
升级compiler
查看c编译器版本
gcc --version
升级c编译器
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
查看是否升级成功
gcc --version
问题二
make和compiler都升级成功之后继续执行glibc升级代码,make之后开始漫长的编译,N久之后发现没动了
卡在了这一行
make[2]: Entering directory '/root/glibc-2.28/stdio-common
等待半天无果,强制中断重新make,问题依然复现,重新下载glibc2.28依然不行。
后发现问题出在make版本过高的原因,glibc2.28版本需要make版本在4.0版本以上且低于4.4版本,遂降级make,一次成功编译。
来源:https://www.cnblogs.com/zwfpro/p/18215800 |