Centos 6.6 升级 glibc
http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
http://ftp.gnu.org/gnu/glibc/glibc-2.16.0.tar.gz
示例
tar xf glibc-2.16.0.tar.gz
cd glibc-2.16.0
mkdir build; cd build
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make
可以有 -j 加快编译 -j 8
例如:make -j$(nproc)
make install
问题1:
glibc 升级 GLIBC_2.14 后指令不能用
示例1:
ls: error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument
示例2:
ls: /lib64/libc-2.12.so: version `GLIBC_2.14' not found (required by /lib64/librt.so.1)
重新指向 libc.so.6
LD_PRELOAD=/lib64/libc-2.14.so ln -sf /lib64/libc-2.14.so /lib64/libc.so.6
LD_PRELOAD=/lib64/libc-2.16.so ln -sf /lib64/libc-2.16.so /lib64/libc.so.6
问题2:有些工具不能用;
示例1:glibc 升级 GLIBC_2.16 后 salt 不能用
/usr/bin/python2.7: error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument
/lib64/libc.so.6: version `GLIBC_2.16' not found (required by /usr/lib64/libstdc++.so.6)
需要重新软链接 libstdc++.so.6
强制软连接
LD_PRELOAD=/lib64/libc-2.16.so ln -sf /lib64/libc-2.16.so /lib64/libc.so.6
ln -fs /usr/lib64/libstdc++.so.6.0.13 /usr/lib64/libstdc++.so.6
问题:Segmentation fault
GLIBC 还原:(centos 6.6 )
用 LD_PRELOAD 重新加载动态库;
加载的优先级:LD_PRELOAD>LD_LIBRARY_PATH>/etc/ld.so.cache>/lib>/usr/lib
export LD_PRELOAD=/lib64/libc-2.12.so
LD_PRELOAD=/lib64/libc-2.12.so ln -sf /lib64/libc-2.12.so /lib64/libc.so.6
标签:Centos,libc,glibc,6.6,so,so.6,2.16,lib64 From: https://www.cnblogs.com/sharesdk/p/16794912.html