Skip to content

Instantly share code, notes, and snippets.

@fripSide
Last active December 12, 2015 04:34
Show Gist options
  • Save fripSide/f04d216f3843498a71e9 to your computer and use it in GitHub Desktop.
Save fripSide/f04d216f3843498a71e9 to your computer and use it in GitHub Desktop.
sudo apt-get install -y libgmp-dev libmpfr-dev libmpc-dev zlib1g-dev
wget ftp://ftp.gnu.org/gnu/gcc/gcc-5.3.0/gcc-5.3.0.tar.bz2
tar vf gcc-5.3.0.tar.bz2
mkdir outdir
cd outdir
../gcc-5.3.0/configure --disable-checking --program-suffix=-5.3 --enable-languages=c,c++,go,objc --disable-multilib --with-system-zlib prefix=/usr/local/gcc-5.3
make && make install
# choose gcc-5.3
update-alternatives --install /usr/bin/gcc gcc /usr/local/gcc-5.3/bin/gcc-5.3 30
update-alternatives --set gcc /usr/local/gcc-5.3/bin/gcc-5.3
@fripSide
Copy link
Author

If compiled failed, you can modify the "--enable-languages=c,c++,go,objc" to "--enable-languages=c,c++" and only support c and c++.

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