Bug 1789115

Summary: Changes/LTO by default for package builds
Product: [Fedora] Fedora Reporter: Ben Cotton <bcotton>
Component: Changes TrackingAssignee: Jeff Law <law>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 33CC: bcotton, besser82, ego.cordatus, fabio.pedretti, kdudka, law, rjones
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 14:48:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1861276, 1872429, 1873188, 1877652    
Bug Blocks: 1860404    

Description Ben Cotton 2020-01-08 19:21:42 UTC
This is a tracking bug for Change: Changes/LTO by default for package builds
For more details, see: https://fedoraproject.org/wiki/LTOByDefault

This is a proposal to enable link time optimization (LTO) of packages built with rpmbuild by default.  It's an over-simplification, but think of LTO as deferring analysis, optimization and code generation until creation of an executable or dynamic shared object.

Comment 1 Kamil Dudka 2020-07-24 15:23:31 UTC
This change causes failure of gnulib's test-float test on ppc64le, which prevents packages that use gnulib's float module from being built:

    https://koji.fedoraproject.org/koji/taskinfo?taskID=47694984

Minimal example:

$ git clone --depth 1 https://git.savannah.gnu.org/git/gnulib.git
$ cd gnulib
$ git checkout 7ea899a94365ece6367515a7e61452d9d2e61730
$ ./gnulib-tool --create-testdir --dir=tst float
$ cd tst
$ ./configure CFLAGS='-flto -O2 -m64 -mcpu=power8 -mtune=power8'
$ make check
$ cat gltests/test-suite.log
===============================
   dummy 0: ./test-suite.log
===============================

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: test-float
================

test-float.c:318: assertion 'm + m > m' failed
FAIL test-float (exit status: 134)


After removing -flto from CFLAGS, the test passes just fine.

Comment 2 Jeff Law 2020-07-27 05:15:06 UTC
This is almost certainly a broken configure test which in turn causes the mis-behavior of the gnulib float test.   I'll have to verify tomorrow, but the autoconf tests which determine how gnulib packs/unpacks floating point numbers is one that's known to be broken WRT ISO C aliasing rules.

Comment 3 Kamil Dudka 2020-07-27 09:22:48 UTC
Jeff, thank you for looking into this!  We had a similar problem with gnulib's test-isinf test on ppc64le four years ago but gnulib upstream is not much receptive to such reports without patches:

    https://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00011.html

For now I have disabled LTO on ppc64le in coreutils and findutils to make the packages build again:

    https://src.fedoraproject.org/rpms/coreutils/c/6d3ccf4f
    https://src.fedoraproject.org/rpms/findutils/c/8de28b81

Comment 4 Jeff Law 2020-08-10 21:16:17 UTC
Moving to MODIFIED as this feature is in the testable state.

Comment 5 Ben Cotton 2020-08-11 13:10:49 UTC
Branching F33 Change Tracker bugs.

Today is the code complete (testable) deadline. All bugs should be at least in MODIFIED state by now to indicate they are testable.

Comment 6 Ben Cotton 2020-08-27 01:12:01 UTC
Yesterday we reached the Code complete (100% code complete) deadline for Fedora 33 Changes. If your Change is complete, please set this tracking bug to ON_QA. If you need to defer this Change to Fedora 34, please let NEEDINFO me.

As a reminder, we are now in the Beta Freeze. If you need to land package updates, please propose it as a Freeze Exception at https://qa.fedoraproject.org/blockerbugs/propose_bug

Comment 7 Ben Cotton 2020-10-27 14:48:00 UTC
Closing tracking bugs for F33. If your change didn't make it into F33 for some reason, please reopen this and NEEDINFO me.