centos上的glibc的远古版本:
root@:~/clickhouse/ClickHouse/build# ldd --version
ldd (GNU libc) 2.17
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
7年前的,真古老。
先安装 gcc 8, g++ 8, cmake 3, ninja ,参考这篇博客:在CentOS/Debian/Ubuntu上编译安装最新版 GCC 8 , cmake 3 和ninja
再更新gnu make 和GNU ‘binutils’ (as and ld),参考这篇博客:在CentOS/Debian/Ubuntu上编译安装最新版gnu make 和GNU ‘binutils’ (as and ld)
下载,编译,安装:
wget https://ftp.gnu.org/gnu/libc/glibc-2.29.tar.gz
tar -xvzf glibc-2.29.tar.gz
mkdir glibc-build
cd glibc-build
../glibc-2.29/configure --prefix=/opt/glibc-2.29
make -j4
make install
注意:我不推荐你手动更新glibc,不安全
之所以安装在 opt目录下,是因为其他的旧的程序可能会需要旧的glibc。
使用方法:
export LD_LIBRARY_PATH="/opt/glibc-2.29/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
ldd --version
参考:upgrade - How to update glibc to 2.14 in CentOS 6.5 - Unix & Linux Stack Exchange
不更新的话会报错:
configure: error:
*** These critical programs are missing or too old: as GNU ld make
*** Check the INSTALL file for required versions.
这里说了因为as GNU ld make这4个工具太古老了,需要进行更新。
参考这篇博客:在CentOS/Debian/Ubuntu上编译安装最新版gnu make 和GNU ‘binutils’ (as and ld)