1.准备工作
1.1升级gcc到gcc8
复制代码
# 安装devtoolset-8-gcc`
`yum install centos-release-scl`
`yum install devtoolset-8`
`scl enable devtoolset-8 -- bash`
`# 启用工具`
`source /opt/rh/devtoolset-8/enable `
`# 安装GCC-8`
`yum install -y devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils`
`# 设置环境变量`
`echo` `"source /opt/rh/devtoolset-8/enable"` `>> /etc/profile`
`source /etc/profile
1.2升级make到4.0以上版本
复制代码
wget http://mirrors.ustc.edu.cn/gnu/make/make-4.0.tar.gz`
`tar xf make-4.0.tar.gz `
`cd make-4.0/`
`./configure `
`make` `&` `make` `install`
`mv /usr/bin/make /usr/bin/make.bak`
`ln -s /usr/local/bin/make /usr/bin/make`
`make -v
1.3 安装bison
复制代码
yum install` `bison
2.编译
2.1下载并解压
复制代码
# 下载并解压安装包`
`$ wget https://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz`
`$ tar -xzvf glibc-2.28.tar.gz`
`$ cd glibc-2.28`
`# 创建临时文件`
`$ mkdir build && cd build
2.2配置
复制代码
# 配置环境 `
`../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
2.3 编译和安装
复制代码
make` `&` `make` `install`
`strings /lib64/libc.so.6 |` `grep GLIBC