基础
GLIBC是Linux系统中最底层的API,最主要的功能是对系统调用进行了封装,几乎其他任何的运行库都要依赖glibc。因此,切勿擅自通过编译的方式升级,容易将系统搞坏。
升级glibc主要是对/lib库中的libc.so.6,libm.so.6, libpthread.so.0和librt.so.1这四个文件的修改
[root@taishan-atlas ~]# rpm -qa | grep glibc
glibc-common-2.17-317.el7.aarch64
glibc-2.17-317.el7.aarch64
glibc-headers-2.17-317.el7.aarch64
glibc-devel-2.17-317.el7.aarch64
注:gcc低版本和glibc 2.28不兼容
当前采用gcc version 8.3.1 20190311编译glibc2.28和glibc2.29
编译安装
编译安装进入glibc-2.27目录中
wget https://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz --no-check-certificate
tar -xvf glibc-2.28.tar.gz
cd glibc-2.28
mkdir build
cd build
执行./configure
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
安装
make && make install
测试
查看自带默认的glibc
strings /home/glibc/glibcout/lib/libm.so.6 | grep GLIBC
问题
LD_LIBRARY_PATH shouldn't contain the current directory when building glibc
解决方案
export LD_LIBRARY_PATH=
configure: error: GNU libc requires kernel header files from Linux 3.2.0 or later to be installed before configuring.
The kernel header files are found usually in /usr/include/asm and
/usr/include/linux; make sure these directories use files from
Linux 3.2.0 or later. This check uses <linux/version.h>, so
make sure that file was built correctly when installing the kernel header
files. To use kernel headers not from /usr/include/linux, use the
configure option --with-headers.
解决方案
配置glibc编译选项,添加--with-headers=/usr/include --with-binutils=/usr/bin
Illegal instruction (core dumped)
进入到编译输出路径,无法执行任何执行
cd /home/dong/glibc/release/lib
解决方案
export LD_LIBRARY_PATH=
标签:libm,编译,--,GLIBC,headers,2.29,usr,include,glibc From: https://blog.51cto.com/fengyuzaitu/9380732