gcc: make keg-only.

Resolves issues with CMake noted in #28855.