Project

General

Profile

Actions

Bug #4113

closed

osmo-bsc fails to compile on openSUSE Tumbleweed (gcc 9.1 with LTO enabled)

Added by roox over 4 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
-
Target version:
-
Start date:
07/17/2019
Due date:
% Done:

0%

Spec Reference:

Description

openSUSE just enabled LTO by default for its packages in Tumbleweed/Factory.
https://lists.opensuse.org/opensuse-factory/2019-07/msg00240.html
https://gcc.gnu.org/wiki/LinkTimeOptimization

This means the distro provided CFLAGS now changed from

without LTO

CFLAGS='-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection  -g'

to

with LTO enabled

CFLAGS="-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -flto=4 -g -Werror=implicit -Werror=maybe-uninitialized -Werror=memset-transposed-args -Werror=null-dereference -Werror=sizeof-array-argument -Werror=sizeof-pointer-memaccess" 

compiling osmo-bsc master then triggers the following warnings/errors:

[   22s] bsc_init.c:242:16: error: potential null pointer dereference [-Werror=null-dereference]
[   22s] system_information.c:490:9: error: 'f0' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[   22s] lto-wrapper: fatal error: make returned 2 exit status
[   22s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: error: lto-wrapper failed
[   22s] collect2: error: ld returned 1 exit status
[   22s] error: Bad exit status from /var/tmp/rpm-tmp.gBd6u2 (%build)

I have attatched the full buildlog.


Files


Related issues

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

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

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

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

Actions
Related to Cellular Network Infrastructure - Bug #4123: gcc & LTO related issuesRejectedHoernchen07/19/2019

Actions
Actions #1

Updated by laforge over 4 years ago

  • Project changed from Cellular Network Infrastructure to OsmoBSC
  • Assignee set to Hoernchen
  • Priority changed from Normal to High
Actions #2

Updated by laforge over 4 years ago

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

Updated by laforge over 4 years ago

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

Updated by laforge over 4 years ago

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

Updated by laforge over 4 years ago

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

Updated by Hoernchen over 4 years ago

The breakage is actually our own fault, we've had the werror in our configure for a long time, it's just that gcc will only do interprocedural analysis with lto:

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"])

Actions #7

Updated by Hoernchen over 4 years ago

I guess it's a bit early for LTO anyway, since it breaks function wrapping, which is used in our tests, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88643

Actions #8

Updated by Hoernchen over 4 years ago

And LTO will kill any chance at ever using pragmas to influence warnings and errors, as confirmed by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80922

Actions #9

Updated by Hoernchen over 4 years ago

  • Related to Bug #4123: gcc & LTO related issues added
Actions #10

Updated by Hoernchen over 4 years ago

  • Status changed from New to Resolved

LTO was disabled by the package maintainer.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)