MacPorts comes with a packing software, but all software is compiled. libgcc: Updated to be a standalone port, that picks the correct gcc primary runtime. libgcc-devel consequently updated to now be based of the same gcc9 snapshsot.
UPDATE GCC MACPORTS INSTALL
To install gcc9, paste this in macOS terminal after installing MacPorts.
UPDATE GCC MACPORTS UPDATE
Unfortunately :-( gcc_select does not affect which compiler XCode uses so it's not the way to go if you need to work in XCode (which I do). MacPorts (package name, e.g., gcc48) - the fastest way to get a developer version of GCC. Updates to the various gccGcc_select is a systematic way of doing the same thing which will work predictably, or in the very worst case you can file a bug report and get an eventual fix or fix it yourself.
Moreover, this isn't guaranteed to work - in particular, it's not clear that you will get the correct system include files, which have certainly changed between iterations of gcc.
It's the sort of thing you'll forget in a month, then move to a different machine, and wonder why you are getting different results - or, you'll try to upgrade your system, and you'll get weird errors because it's not expecting a softlink there. In short, you can install GCC 4. You may check out what versions are available here. For example, at the time of writing this answer, version 4.5, 4.7 and 4.8 are available. Having a soft link is an invisible source of error. You can choose which version of GCC to install. Download and install the MacPorts pkg installer appropriate for your OS.
UPDATE GCC MACPORTS FOR MAC
These systems are so complex that you want to reduce all invisible sources of error. Installing GCC 5.1 for Mac Users Download and install Xcode from the Mac App Store. Some would see this as a con in comparison to Homebrew. To upgrade a copy of MacPorts that was installed from source to the newer release of the source code, simply repeat the source install with the newer version of the MacPorts source code. But in general, it usually is one of the most up to date and will be updated eventually. Upgrade MacPorts MacPorts base upgrades are performed automatically (when a newer release is available) during a selfupdate operation. Nor is it the fastest in getting updates. gcc-devel: revert moving libgccjit to libgcc-devel. One of the key things about writing software is reproduceability - you want to be able to get the same results every time. Macports isn't the first choice for developers producing new packages or binaries for macOS. Contribute to macports/macports-ports development by creating an account on GitHub. I'm just dropping in to say that using a soft link to accomplish this is a terrible, no-good, horrible idea.