Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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--

This comment has been minimized.

Copy link

synchro-- commented Oct 9, 2016

Thank you!

@McKenlly

This comment has been minimized.

Copy link

McKenlly commented Oct 18, 2017

Great article

@ShuyangCao

This comment has been minimized.

Copy link

ShuyangCao commented Jan 12, 2018

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

@erm3nda

This comment has been minimized.

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
You can’t perform that action at this time.