install gcc-9.3.0、make4.3、glibc-2.31 on centos7.


docker run -it centos:7 bash
cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
/bin/cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup \
&& sed -i "s@#baseurl@baseurl@g" /etc/yum.repos.d/CentOS-Base.repo \
&& sed -i "s@mirrorlist=http@#mirrorlist=http@g" /etc/yum.repos.d/CentOS-Base.repo \
&& sed -i "s@baseurl=.*/centos@baseurl=" /etc/yum.repos.d/CentOS-Base.repo \
&& yum clean all \
&& yum makecache \
&& yum update -y \
&& yum groupinstall "Development Tools" -y \
&& yum install glibc-static libstdc++-static -y \
&& yum install python3 python3-devel wget -y \
&& gcc -v; \
ls -ltr /usr/lib64 |grep -E 'libc-|libstdc++'

## wget config proxy
cat > ~/.wgetrc <<EOF
https_proxy =
http_proxy =
ftp_proxy =
use_proxy = on


curl -fksSL | tar -xvz
cd gcc-9.3.0/

mkdir build
cd build

../configure \
--prefix=/usr \
--enable-checking=release \
--enable-language=c,c++ \

cat /proc/cpuinfo| grep "processor"| wc -l

make -j4
make install


curl -fksSL | tar -xvz
cd make-4.3/
mkdir build
cd build
../configure --prefix=/usr
make install


curl -fksSL |tar -xvz
yum install texinfo libncurses5-dev -y
cd gdb-8.3.1
mkdir build
cd build
../configure --prefix=/usr

make install


curl -fksSL | tar -xvz
cd glibc-2.31/
cat INSTALL | grep -E "newer|later"
mkdir build
cd build

../configure \
--prefix=/usr \
--disable-profile \
--enable-add-ons \
--with-headers=/usr/include \
--with-binutils=/usr/bin \
--enable-obsolete-nsl \
--disable-sanity-checks \

#yum install python3

make -j4
make install
make localedata/install-locales CC="gcc -B/usr/bin/" /usr/bin/perl scripts/ /glibc-2.31/build/
/usr/bin/ld: cannot find -lnss_test2
collect2: error: ld returned 1 exit status
Execution of gcc -B/usr/bin/ failed!
The script has found some problems with your installation!
Please read the FAQ and the README file and check the following:
- Did you change the gcc specs file (necessary after upgrading from
  Linux libc5)?
- Are there any symbolic links of the form to old libraries?
  Links like -> (where is an old library) are wrong, should point to the newly installed glibc file - and there should be
  only one such link (check e.g. /lib and /usr/lib)
You should restart this script from your build directory after you've
fixed all problems!
Btw. the script doesn't work if you're installing GNU libc not as your
primary library!
make[1]: *** [Makefile:120: install] Error 1
make[1]: Leaving directory '/glibc-2.31'
make: *** [Makefile:12: install] Error 2



yum update;
yum install centos-release-scl-rh -y;
yum update;
yum install devtoolset-9-toolchain -y
yum install devtoolset-8-toolchain -y
scl enable devtoolset-9 bash
#    or 
scl enable devtoolset-8 bash


docker run -it --rm debian:10

sed -i "s|||g" /etc/apt/sources.list && \
sed -i "s|||g" /etc/apt/sources.list && \
apt-get clean && \
apt-get update && \
apt-get -y upgrade && \
apt-get install build-essential wget curl python3 python3-dev python3-distutils -yq

gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 8.3.0 (Debian 8.3.0-6)

ls -ltr /usr/lib/x86_64-linux-gnu/ |grep -E 'libstdc++'
-rw-r--r-- 1 root root 1570256 Apr  6  2019
lrwxrwxrwx 1 root root      19 Apr  6  2019 ->

ls -ltr /lib/x86_64-linux-gnu/ |grep -E 'libc-|libstdc++'
lrwxrwxrwx 1 root root      12 May  1  2019 ->
-rwxr-xr-x 1 root root 1824496 May  1  2019