Author of the post here.
Bazel recognizes it's compiling on macOS, so it's using clang-compatible flags, which are incompatible with gcc. You should use the default host compiler, as stated in the [configure output][1] in the post. /usr/bin/gcc is for all intents and purposes clang on macOS.
gcc-7 is only installed to provide libgomp which is otherwise missing from a standard macOS installation.
I'll update the post to make it clearer. Thanks for pointing that out!
[1]: https://gist.github.com/crmne/a22858264d68dd9fe935fc4ee48e04...