Skip to content

Instantly share code, notes, and snippets.

@Roninkoi
Created April 3, 2024 08:33
Show Gist options
  • Select an option

  • Save Roninkoi/e3915593ec4c7fe9e2df67915d3c1ffb to your computer and use it in GitHub Desktop.

Select an option

Save Roninkoi/e3915593ec4c7fe9e2df67915d3c1ffb to your computer and use it in GitHub Desktop.
Build GCC from Git
#!/bin/sh
# clone and build gcc for linux, link bin
gccpath="/home/ronialek/gcc-test"
mkdir $gccpath
cd $gccpath
git clone git://gcc.gnu.org/git/gcc.git .
git checkout releases/gcc-13
./contrib/download_prerequisites
mkdir build
cd build
../configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=$gccpath --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib --program-suffix=-git
make -j8
make install-strip
ln -s $gccpath/bin/gcc-git ~/.local/bin/gcc-git
ln -s $gccpath/bin/g++-git ~/.local/bin/g++-git
ln -s $gccpath/bin/gfortran-git ~/.local/bin/gfortran-git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment