Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[contrib] Disable GCC warnings and broken features (#37131)
Currently contrib does not build with GCC because of various false positive compiler warnings turned to errors and a GCC compiler bug. Let's first start with the bug, in GCC apparently using -gsplit-dwarf (debug fission) and -fdebug-types-section (used to optimize the size of debug inforamtion), when used together, can result in a linker failure. Refer to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110885 for the GCC bug report of this issue. When it comes to Envoy, optimized builds with GCC are affected on at least GCC 11 (used by --config=docker-gcc) and GCC 12 (and I'm pretty sure the bug isn't fixed in any newer versions either, though I didn't check each version). Given that we cannot have both debug fission and a debug types section, we decided to abandon the debug types sections and keep the fission. That being said, apparently both of those options are unmaintained in GCC which poses a question of long term viability of using those or GCC. Other changes in this commit disable GCC compiler errors for various warnings that happen when building contrib. I checked those warnings and didn't find any true positive. And additionally, for warnings that exists in both Clang and GCC, Clang warnings don't trigger, so Clang also disagrees with GCC here. Additionally missing-requires warning is new and does not exist in GCC 11, but exists in later versions of GCC, so to avoid breaking on this warning for future versions of GCC I disabled it, but also tell GCC to not complain if it sees a flag related to an unknwon diagnostic. This is the last change required to make GCC contrib builds work (you can find more context and discussions in #31807) Risk Level: Low Testing: building with --config=gcc and --config=docker-gcc Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Fixes #31807 Signed-off-by: Mikhail Krinkin <[email protected]>
- Loading branch information