Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[contrib] Disable GCC warnings and broken features #37131

Merged
merged 1 commit into from
Nov 16, 2024

[contrib] Disable GCC warnings and broken features

212af3a
Select commit
Loading
Failed to load commit list.
Merged

[contrib] Disable GCC warnings and broken features #37131

[contrib] Disable GCC warnings and broken features
212af3a
Select commit
Loading
Failed to load commit list.
CI (Envoy) / Envoy/macOS succeeded Nov 14, 2024 in 6m 54s

Envoy/macOS (success)

Check has finished

Details

Check run finished (success ✔️)

The check run can be viewed here:

Envoy/macOS (pr/37131/main@212af3a)

Check started by

Request (pr/37131/main@212af3a)

krinkinmu @krinkinmu 212af3a #37131 merge main@3bf801c

[contrib] Disable GCC warnings and broken features

Commit Message:

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.

Additional Description:

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

Environment

Request variables

Key Value
ref 45d84c3
sha 212af3a
pr 37131
base-sha 3bf801c
actor krinkinmu @krinkinmu
message [contrib] Disable GCC warnings and broken features...
started 1731544520.156326
target-branch main
trusted false
Build image

Container image/s (as used in this CI run)

Key Value
default envoyproxy/envoy-build-ubuntu:f94a38f62220a2b017878b790b6ea98a0f6c5f9c
mobile envoyproxy/envoy-build-ubuntu:mobile-f94a38f62220a2b017878b790b6ea98a0f6c5f9c
Version

Envoy version (as used in this CI run)

Key Value
major 1
minor 33
patch 0
dev true