当前位置:   article > 正文

centos7环境升级默认的gcc 4.8.5到gcc 8.2.0, 并且升级glibc到glibc 2.28_yum glibc 更新至2.27

yum glibc 更新至2.27

这里写目录标题

make

#下载
wget http://ftp.gnu.org/gnu/make/make-4.2.tar.gz
tar -xf make-4.2.tar.gz
cd make-4.2
./configure
make -j4
make install
mv /usr/bin/make /usr/bin/make_bak
cp ./make /usr/bin/

make -v
GNU Make 4.2
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

gcc

#下载
wget https://ftp.gnu.org/gnu/gcc/gcc-8.2.0/gcc-8.2.0.tar.gz
tar xf gcc-8.2.0.tar.gz
cd gcc-8.2.0
./contrib/download_prerequisites
mkdir build
cd build/
../configure --prefix=/usr/local/gcc-8.2.0 --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j 8
make  install

vim /etc/profile.d/gcc.sh
export PATH=/usr/local/gcc-8.2.0/bin:$PATH
export MANPATH=/usr/local/gcc-8.2.0/share/man:${MANPATH}
export INFOPATH=/usr/local/gcc-8.2.0/share/info${INFOPATH:+:${INFOPATH}}
export LD_LIBRARY_PATH=/usr/local/gcc-8.2.0/libexec/gcc/x86_64-pc-linux-gnu/8.2.0:/usr/local/gcc-8.2.0/lib64:/usr/local/gcc-8.2.0/lib/gcc/x86_64-pc-linux-gnu/8.2.0/plugin${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

source /etc/profile.d/gcc.sh

gcc -v
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc-8.2.0/libexec/gcc/x86_64-pc-linux-gnu/8.2.0/lto-wrapper
目标:x86_64-pc-linux-gnu
配置为:../configure --prefix=/usr/local/gcc-8.2.0 --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --disable-multilib
线程模型:posix
gcc 版本 8.2.0 (GCC) 

ln -sv /usr/local/gcc-8.2.0/include/ /usr/include/gcc
ldconfig -v

rm -f /lib64/libstdc++.so
ln -sv  /usr/local/gcc-8.2.0/lib64/libstdc++.so.6.0.25 /lib64/libstdc++.so
cp /usr/local/gcc-8.2.0/lib64/libstdc++.so.6.0.25   /lib64/
rm -f  /lib64/libstdc++.so.6
ln -sv  /lib64/libstdc++.so.6.0.25   /lib64/libstdc++.so.6
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36

glibc

#下载
wget https://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz
tar xf glibc-2.28.tar.gz
cd glibc-2.28
 ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make -j 8 && make  install

#验证
strings /usr/local/gcc-8.2.0/lib64/libstdc++.so.6 | grep ^GLIBCXX_
strings /lib64/libc.so.6 | grep ^GLIBC
ldd --version
ldd (GNU libc) 2.28
Copyright (C) 2018 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.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号