Linuxbrew gcc Formula lagging

Apologies if this isn’t the proper place to request information. I thought the lagging formulae would be a bug, but it didn’t match any of the templates and I didn’t want to get banned from the project.

The linuxbrew-core and homebrew-core GCC formulae have diverged substantially. gcc in homebrew-core installs 10.1.0 whereas in linuxbrew-core it installs 5.5.0 (or 9.3.0 on macOS). Likewise, gcc@9 installs 9.3.0 on homebrew-core and 9.2.0 on linuxbrew-core (a bit of a conflict with the gcc formula, too). gcc@10 doesn’t exist in linuxbrew-core at all.

Having such an old version of gcc appear on the PATH can create conflicts. I initially thought this was an issue with Homebrew, but it appears to be specific to the Linux variant. It looks like holding back the various gcc formulae is deliberate. Is there anything I can do to help advance it?

There is a plan to switch the gcc formulae around: https://github.com/Homebrew/linuxbrew-core/pull/20241

It’s not an easy task, and it needs a lot of testing. I will work on this during the next weeks but do not expect a quick progress.

To ensure that our precompiled binary packages (called bottles) are usable on as many systems as possible, they’re compiled on Ubuntu 16.04 LTS, which ships with GCC 5 by default. We use GCC 5 to build our bottles. Life is simpler and more reliable if the the default Homebrew compiler is the same one used to build the bottles, namely GCC 5. We realize that GCC 5 being the default compiler is surprising behaviour and also causes its own issues, and we’re thinking of ways to better resolve this issue. Ubuntu 16.04 LTS will be end of life next year, at which point we plan to replace it.

In the mean time, you can modify your PATH and/or modify the symlinks in $HOMEBREW_PREFIX/bin to change cc , c++ , gcc , and g++ to your preferred compiler.