Fwd: enabling link time optimizations in package builds

Bernhard M. Wiedemann bernhardout at lsmod.de
Tue Jun 28 20:00:15 UTC 2022



On 17/06/2022 11.12, Chris Lamb wrote:
> Hi Roland,
> 
>> would enabling LTO cause reproducible issues?
>> If I remember correctly, Bernhard mentioned some issues, which got 
>> 'solved' by using less parallel builds (-j1 or -j4?).
> 
> Good question. There was definitely at least one LTO-related issue in the
> past. Take, for instance, this bug report from 2015 about "FAT" LTO objects:
> 
>   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66305
> 
> I don't know whether this is still valid and/or we would encounter it
> with Doko's proposal, however.

I think it can still be an issue.

We strip the unreproducible sections at the end of builds:
https://github.com/openSUSE/brp-check-suse/pull/29/files

The downside is that you don't get extra optimization when linking
external .a files, but such static linking is discouraged anyway for
maintainability.


The other thing we had to do was that we started to use -flto=auto
instead of -flto=$cpus
to avoid embedding this detail into debuginfo and such.

Ciao
Bernhard M.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <http://lists.reproducible-builds.org/pipermail/rb-general/attachments/20220628/89618c5a/attachment.sig>


More information about the rb-general mailing list