I have gcc-4.9 in my Stretch OBS Palemoon repository:
https://build.opensuse.org/project/show ... evenpusser
You can add the repo and its key by becoming root in a terminal (sudo users can do this with "sudo -i") and running
Code: Select all
echo 'deb http://download.opensuse.org/repositories/home:/stevenpusser/Debian_9.0/ /' > /etc/apt/sources.list.d/gcc-4.9.list
Then as a regular user, delete any possible previously downloaded keys, then download the key for that repo:
Code: Select all
rm -f Release.key
wget -nv http://download.opensuse.org/repositories/home:stevenpusser/Debian_9.0/Release.key -O Release.key
Then, back as root, install the key, update the package database, and install the build tools:
Code: Select all
apt-key add - < Release.key
apt-get update
apt-get install gcc-4.9 g++-4.9 cpp-4.9
Then in the same terminal as you are building your program, you set the environment to use those tools to build the program before starting your build:
Code: Select all
export CC=gcc-4.9
export CXX=g++-4.9
export CPP=cpp-4.9
export LD=gcc-4.9
At least, that's what's working for Pale Moon. Though it's built using gcc-4.9, the resulting Pale Moon binary runs just fine on the gcc-6 runtime libraries, so you may not need any of those gcc-4.9 packages you installed after you build the program.