Skip to content

Instantly share code, notes, and snippets.

@slizzered
Last active August 1, 2020 20:31
Show Gist options
  • Save slizzered/a9dc4e13cb1c7fffec53 to your computer and use it in GitHub Desktop.
Save slizzered/a9dc4e13cb1c7fffec53 to your computer and use it in GitHub Desktop.
Compile older compiler (gcc 4.9) on Arch Linux

In Arch Linux, you can use the AUR to compile your custom version of GCC (example with gcc 4.9)

[Alternative 1]: using the AUR manually

mkdir -p $HOME/build/
cd $HOME/build/
git clone https://aur.archlinux.org/gcc49.git
cd gcc49
makepkg --syncdeps
sudo pacman --upgrade gcc-4.9.3-1-x86_64.pkg.tar.xz

[Alternative 2]: use one of the available AUR helpers:

example using pacaur (needs to be installed previously)

pacaur -S gcc49

To use the newly installed compiler, you have to set the correct version in the shell you are using:

export CXX=/usr/bin/g++-4.9

Note: this has to be done in each new shell you use. To make it permanent, add the line above to your ~/.bashrc file.

@synchro--
Copy link

Thank you!

@McKenlly
Copy link

Great article

@ShuyangCao
Copy link

I wonder how long the building will take. I have been building it for over 2 hours.

@erm3nda
Copy link

erm3nda commented May 19, 2018

Cool, pacaur saving my day (well, night). Thanks.

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