Hide Forgot
Created attachment 1650815 [details] Changes to redhat-rpm-config to inject LTO flags Description of problem: We have an in-progress Fedora change request to enable LTO by default for Fedora 32. We want the change to apply to packages built with rpmbuild and which honor the flags injection mechanism used by redhat-rpm-config. https://fedoraproject.org/wiki/LTOByDefault https://pagure.io/fesco/issue/2311 We know there are some packages that are not going to work with LTO as they use features which are currently incompatible with LTO -- for example top level ASM statements to implement function versioning. So we also want to make it easy for packages to opt-out of LTO. Ideally a single line in their .spec file should be sufficient. openSUSE uses %{_lto_cflags} to pass in flags for LTO builds. I see absolutely no reason to use a different name. It's given a default value in their equivalent of redhat-rpm-config. Packages that want to opt-out use this in their .spec file: %define _lto_cflags %{nil} openUSE also uses the following for packages that need an additional option for handling of archive libraries: %global _lto_cflags %{?_lto_cflags} -ffat-lto-objects I'm not a big fan of their opt-out and archive library handling as they encourage package maintainers to directly manipulate the compiler flags. I would have instead had a macro which indicated the package didn't want LTO (or needed special archive library handling) and hid the flags manipulation in redhat-rpm-config. But given openSUSE was the first mover here, I'll put my objection to their approach aside and recommend doing the same for Fedora. Note that we're using -ffat-lto-objects and -flto-partition=one in the base LTO flags right now. That allows us to focus on more important issues in the immediate term. Those options will be pushed down into each package that needs them to improve build-times with LTO. I'd like pre-approval to drop those from _lto_cflags once I've identified and fixed the packages that need that special archive handling. From a deployment standpoint I think we should land the flags injection enablement for redhat-rpm-config at the same time as the sed hacks to fix broken configure scripts and that both should land immediately after Jakub drops in gcc-10 into rawhide. So the immediate goal is to get agreement on the flags injection patch, but not install it just yet. Assuming we can reach agreement on the flags injection and configure script fixes, I'm happy to own committing the bits just after Jakub drops in gcc-10 to rawhide. pull-request will be submitted shortly. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle. Changing version to 32.
Can this be closed?
Not yet. We need the opt-outs in place first. I've been dropping those in on/off the last couple weeks and expect to wrap that up this week (there's ~200 of them across F33 and I'm trying to make sure we document each reasonably well in the affected .spec file, so it takes time). Once the opt-outs in place we'll look to push the actual LTO enablement in redhat-rpm-config.
So, is LTO in place but no opt-out? A couple of build failures in rawhide seem to indicate that but I might be wrong. https://kojipkgs.fedoraproject.org//work/tasks/643/48280643
To opt out: %define _lto_cflags %{nil}
This message is a reminder that Fedora 32 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '32'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 32 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 32 changed to end-of-life (EOL) status on 2021-05-25. Fedora 32 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.