I’m not 100% sure what caused gcc-4.7 to be removed from my Retropie setup but I think it might have been the “apt-get dist-upgrade” I ran. Anyway, if you’re reading this you probably in the same situation.
gcc-4.7 is gone and retropie_setup.sh refuses to run without it. Any manual attempt to reinstall it have failed and you’re about to give up. DON’T!
The fix is easy. Edit the retropie_packages.sh script and replace all 4.7 references with 4.8 (I think there’s three places you need to change).
Re-run the retropie_setup.sh and it will install gcc-4.8 and g++-4.8 and you’re good to go.
I only tried registering a new RetroArch controller so I can’t promise nothing else got broken but for me that was all I needed to do right now.