Bugzilla – Bug 1143905
fwupd does not build reproducibly with LTO
Last modified: 2019-08-27 03:57:08 UTC
This is because meson.build calls fu-hash.py src/libfwupdprivate.a and .a files contain unreproducible LTO data now. this produces a fu-hash.h file with a nondeterministic FU_BUILD_HASH string that gets embedded in various binaries. unrelated to this there are still deviations from https://github.com/openSUSE/pesign-obs-integration/pull/8
oops, link at the end was meant to be https://github.com/openSUSE/pesign-obs-integration/issues/9
fwupd uses FU_BUILD_HASH to determine if the plugin is built with the daemon or not. I'll check if there is any better target to generate the hash.
It's hard to replace libfwupdprivate.a. A workaround would be to add a never used libfwupdprivate.so and hash the so file, but it's unlikely to be upstreamed...
Maybe you could strip LTO stuff from the .a before hashing with a call like https://github.com/openSUSE/brp-check-suse/blob/master/brp-15-strip-debug#L40
Stripping .o files sounds a feasible solution. Will work on that.
https://github.com/fwupd/fwupd/commit/5611fd0581b1c28de97321daefae798a78f475b8 Upstream tweaks the hash script to calculate the source files instead of the static library.
(In reply to Gary Ching-Pang Lin from comment #6) > https://github.com/fwupd/fwupd/commit/ > 5611fd0581b1c28de97321daefae798a78f475b8 > Upstream tweaks the hash script to calculate the source files instead of the > static library. Great.
Submitted the patch sr#726084 Closing this bug.