黄素兰 發表於 2024-5-27 16:11:00

记录一次Centos升级glibc2.28遇到的坑

<h3 id="升级glibc">升级glibc</h3>
<pre><code>#查询glibc版本:
strings /lib64/libc.so.6 | grep -E "^GLIBC" | sort -V -r | uniq
升级glibc2.28
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 &amp;&amp; cd build
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make
make install
查询是否升级成功
strings /lib64/libc.so.6 | grep GLIBC
</code></pre>
<h3 id="问题一">问题一</h3>
<pre><code>执行
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
报错
*** These critical programs are missing or too old: make compiler
</code></pre>
<p>原因是make和compiler版本太低,需要进行升级<br>
升级make</p>
<pre><code>查看当前的make版本
make --version
去make官网查看最新版本
make官网:http://ftp.gnu.org/pub/gnu/make/
升级make
wget http://ftp.gnu.org/pub/gnu/make/make-4.4.tar.gz
tar -xzvf make-4.4.tar.gz
cd make-4.4/
mkdir build&amp;&amp;cd build
../configure --prefix=/usr/
bash build.sh
make install
查看是否升级成功
make --version
</code></pre>
<p>升级compiler</p>
<pre><code>查看c编译器版本
gcc--version
升级c编译器
yum -y install centos-release-scl
yum -y install devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils
scl enable devtoolset-8 bash
echo "source /opt/rh/devtoolset-8/enable" &gt;&gt;/etc/profile
查看是否升级成功
gcc--version
</code></pre>
<h3 id="问题二">问题二</h3>
<p>make和compiler都升级成功之后继续执行glibc升级代码,make之后开始漫长的编译,N久之后发现没动了</p>
<pre><code>卡在了这一行
make: Entering directory '/root/glibc-2.28/stdio-common
</code></pre>
<p>等待半天无果,强制中断重新make,问题依然复现,重新下载glibc2.28依然不行。<br>
后发现问题出在make版本过高的原因,glibc2.28版本需要make版本在4.0版本以上且低于4.4版本,遂降级make,一次成功编译。</p><br><br>
来源:https://www.cnblogs.com/zwfpro/p/18215800
頁: [1]
查看完整版本: 记录一次Centos升级glibc2.28遇到的坑