Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Steps to build GCC 10 on Debian Buster.
# Steps to build GCC 10 on Debian Buster.
set -e -x
# Install all dependencies.
export DEBIAN_FRONTEND=noninteractive
apt update
apt install -y wget xz-utils bzip2 make autoconf gcc-multilib g++-multilib
# Download GCC sources.
tar xf gcc-10.2.0.tar.xz
cd gcc-10.2.0
tar xf gmp-6.2.0.tar.xz
mv gmp-6.2.0 gmp
tar xf mpfr-4.1.0.tar.gz
mv mpfr-4.1.0 mpfr
tar xf mpc-1.2.1.tar.gz
mv mpc-1.2.1 mpc
tar xf isl-0.18.tar.bz2
mv isl-0.18 isl
# Build and install it.
./configure --prefix=/opt/gcc-10 --enable-languages=c,c++
make -j$(nproc)
make install
# Create an archive of the installed version.
cd /opt
tar cvJf gcc-10.2.0-debian-buster.tar.xz gcc-10
# Usage example:
# CC=/opt/gcc-10/bin/gcc CXX=/opt/gcc-10/bin/g++ LDFLAGS="-Wl,-rpath,/opt/gcc-10/lib64" cmake [..]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment