Skip to content

Instantly share code, notes, and snippets.

@zz-jason
Last active November 17, 2023 08:53
Show Gist options
  • Save zz-jason/a856ae1ecafbdbe91ac1360832a53c10 to your computer and use it in GitHub Desktop.
Save zz-jason/a856ae1ecafbdbe91ac1360832a53c10 to your computer and use it in GitHub Desktop.
Build GCC from source

Build GCC from source

Download:

wget https://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-12.3.0/gcc-12.3.0.tar.gz
tar zxf gcc-12.3.0.tar.gz
cd gcc-12.3
./contrib/download_prerequisites

Config && build:

mkdir build install
cd build

../configure --prefix=/home/jian.z/code/gcc-12.3.0/install --disable-multilib
make -j `nproc`
make install

Environment variables:

CC=/home/jian.z/code/gcc-12.3.0/install/bin/gcc
CXX=/home/jian.z/code/gcc-12.3.0/install/bin/g++
LD_LIBARARY_PATH=/home/jian.z/code/gcc-12.3.0/install/lib64:$LD_LIBARARY_PATH

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment