This is NOT an answer to my question since I only show how to build and use GCC 4.9 in a way which works on Fedora 23 (and on any other platform probably, too). It's only the compilation of steps I had to do to compile with another version of GCC than the shipped one.
The shown steps are taken from here.
lookup and download and exctract the appropriate archive from http://www.gnu.org/software/gcc/mirrors.html:
wget ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.9.3/gcc-4.9.3.tar.bz2
mkdir src; cd src
tar xf ../gcc-4.9.3.tar.bz2
download prerequisites:
cd gcc-4.9.3
./contrib/download_prerequisites
configure the build (add --disable-multilib
when you don't need a 32 bit build, set the install-prefix
, add/remove languages):
mkdir ../objdir; cd ../objdir
../gcc-4.9.3/configure \
--prefix=`pwd`/../../gcc-4.9.3-x86_64 \
--enable-languages=c,c++ \
--disable-multilib
actually build and install GCC:
make -j4
make install
You can now use this new compiler by just setting CC
(maybe also CXX
) before you run make
or cmake
:
export CC=</installation/path/to/gcc>/bin/gcc
make .
or
CC=</installation/path/to/gcc>/bin/gcc cmake <path>
2
GCC 4.9 is not packaged explicitly in official repository. So you will probably have to build it on your own. You can use the
– Jakuje – 2016-02-10T17:34:11.600compat-gcc
packages as an example