1.查看当前动态库版本
strings /usr/lib64/libstdc++.so.6 | grep CXXABI
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_TM_1
发现最高版本只有1.3.7,没有1.3.9的。
2.下载最新动态库并编译
wget http: //ftp.gnu.org/gnu/glibc/glibc-2.34.tar.xz
tar -xvf glibc-2.34.tar.xz
mkdir glibc-build #不能在glibc当前目录下运行configure,否则会报错 "configure: error: you must configure in a separate build directory" ,需要新建编译目录
mkdir glibc-install
cd glibc-build
../glibc-2.34/configure --prefix=/root/glibc-install
make &&make install
cp /root/glibc-install/lib/libc-2.34.so
cd /usr/lib64/
ll libstdc++.so.6 #查看当前系统版本,用于恢复
lrwxrwxrwx. 1 root root 19 Jan 28 2021 libstdc++.so.6 -> libstdc++.so.6.0.19
rm -f libstdc++.so.6 && ln -sv libc-2.34.so libstdc++.so.6
源码包下载地址:
http: //mirrors.ustc.edu.cn/gnu/libc/
http: //ftp.gnu.org/gnu/glibc/
https: //centos.pkgs.org/7/centos-x86_64/libstdc++-4.8.5-44.el7.x86_64.rpm.html
参考地址:https: //blog.csdn.net/u012927281/article/details/51704855
|