Project

General

Profile

Bug #4123

gcc & LTO related issues

Added by Hoernchen 3 months ago. Updated 3 months ago.

Status:
Stalled
Priority:
Normal
Assignee:
Target version:
-
Start date:
07/19/2019
Due date:
% Done:

0%

Spec Reference:

Description

The new and shiny gcc 9.x will happily do cross-TU analysis, and LTO allows discovering hidden "issues", i.e. FSMs that could in theory access unitialized data. This is not really helpful, but our own compilation flags kill the builds completely:

grep -riIl "error=null" | grep \.ac$ | xargs grep null-deref
osmo-bsc/configure.ac:AX_CHECK_COMPILE_FLAG([-Werror=null-dereference], [CFLAGS="$CFLAGS -Werror=null-dereference"])
osmo-sgsn/configure.ac:AX_CHECK_COMPILE_FLAG([-Werror=null-dereference], [CFLAGS="$CFLAGS -Werror=null-dereference"])
osmo-msc/configure.ac:AX_CHECK_COMPILE_FLAG([-Werror=null-dereference], [CFLAGS="$CFLAGS -Werror=null-dereference"])
osmo-mgw/configure.ac:AX_CHECK_COMPILE_FLAG([-Werror=null-dereference], [CFLAGS="$CFLAGS -Werror=null-dereference"])

As evident by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80922 there is no way to influence warnings and errors by using pragmas, which is not entirely unexpected due to the way LTO works.
There is also no other way to tell the compiler not to warn, we can only prove the non-nullness by throwing obvious wrenches into the code, like if(!x) exit(); which would at most please the compilerbeast while providing no additional benefits.
And there is the minor issue that Werror will even turn messages like "error: potential null pointer dereference [-Werror=null-dereference]" into errors, where gcc doesn't even know if there is an issue. Breaking the build due warnings that involve the word "potential" is bad idea.

Additionally LTO breaks -Wl,-wrap, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88643 - this might get fixed, but it breaks all tests that are using this feature.


Related issues

Related to OsmoSGSN - Bug #4116: osmo-sgsn fails to compile on openSUSE Tumbleweed (gcc 9.1 with LTO enabled)New07/17/2019

Related to OsmoMSC - Bug #4115: osmo-msc fails to compile on openSUSE Tumbleweed (gcc 9.1 with LTO enabled)New07/17/2019

Related to OsmoGGSN (former OpenGGSN) - Bug #4114: osmo-ggsn fails to compile on openSUSE Tumbleweed (gcc 9.1 with LTO enabled)New07/17/2019

Related to OsmoBSC - Bug #4113: osmo-bsc fails to compile on openSUSE Tumbleweed (gcc 9.1 with LTO enabled)New07/17/2019

Related to OpenBSC - Bug #4112: OpenBSC fails to compile on openSUSE Tumbleweed (gcc 9.1 with LTO enabled)New07/17/2019

History

#1 Updated by Hoernchen 3 months ago

  • Assignee set to Hoernchen

#2 Updated by Hoernchen 3 months ago

  • Related to Bug #4116: osmo-sgsn fails to compile on openSUSE Tumbleweed (gcc 9.1 with LTO enabled) added

#3 Updated by Hoernchen 3 months ago

  • Related to Bug #4115: osmo-msc fails to compile on openSUSE Tumbleweed (gcc 9.1 with LTO enabled) added

#4 Updated by Hoernchen 3 months ago

  • Related to Bug #4114: osmo-ggsn fails to compile on openSUSE Tumbleweed (gcc 9.1 with LTO enabled) added

#5 Updated by Hoernchen 3 months ago

  • Related to Bug #4113: osmo-bsc fails to compile on openSUSE Tumbleweed (gcc 9.1 with LTO enabled) added

#6 Updated by Hoernchen 3 months ago

  • Related to Bug #4112: OpenBSC fails to compile on openSUSE Tumbleweed (gcc 9.1 with LTO enabled) added

#7 Updated by Hoernchen 3 months ago

  • Status changed from New to Stalled

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)