glibc更新安装需谨慎,稍不留神就会导致Linux一些命令不可用,ssh连接不上,此时切勿关闭ssh窗口,否则就连不上服务器了
wget http://ftp.gnu.org/gnu/glibc/glibc-2.23.tar.gz
tar xf glibc-2.23.tar.gz
cd glibc-2.23/
mkdir build
cd build/
export CFLAGS="-g -O2 -march=i486"
#加上优化开关,export CFLAGS="-g -O2 -march=i486",否则会出现错误
#error "glibc cannot be compiled without optimization"'
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make
#make出现错误 glibc cc1: all warnings being treated as errors
#将make变为 make CFLAGS="... -Wno-error"
make install
make之后 make install之前打开新窗口去创建一个软链接不然install的时候会报错
cd /lib64
unlink libm.so.6
ln -s libm-2.23.so libm.so.6
来源:
https://www.cnblogs.com/timssd/p/5646099.html
https://www.jianshu.com/p/e8879b04c833
https://wizardforcel.gitbooks.io/100-gcc-tips/content/warnings-treated-as-errors.html