Upgrading GCC
- Obtain the GCC 9.3.0 source package.
1 2 3 4
cd /opt wget https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-9.3.0/gcc-9.3.0.tar.gz --no-check-certificate tar -xvf gcc-9.3.0.tar.gz cd gcc-9.3.0/
- Download the GMP, MPFR, MPC, and isl source packages.
1 2 3 4
wget https://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2 --no-check-certificate wget https://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2 --no-check-certificate wget https://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz --no-check-certificate wget https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2 --no-check-certificate
- Install the GMP, MPFR, MPC, and isl source packages.
1 2 3 4
tar -xvf gmp-6.1.0.tar.bz2 cd gmp-6.1.0 ./configure make -j `nproc` && make install

1 2 3 4 5
cd .. tar -xvf mpfr-3.1.4.tar.bz2 cd mpfr-3.1.4 ./configure make -j `nproc` && make install

cd .. tar -xvf mpc-1.0.3.tar.gz cd mpc-1.0.3 ./configure make -j `nproc` && make install

1 2 3 4 5 6
cd .. tar -xvf isl-0.18.tar.bz2 cd isl-0.18 ./configure make -j `nproc` && make install export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

- Perform the compilation and installation.
1 2 3 4
cd .. ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-bootstrap make -j `nproc` make install

- Check the GCC version.
1gcc -v
Parent topic: Configuring the Compilation Environment