-
Notifications
You must be signed in to change notification settings - Fork 426
-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checksum in fu-hash.h changing between builds #1298
Comments
Isn't a stable .a a prerequisite for a reproducible build? From memory the LTO build didn't actually work correctly, i.e. the plugin initialisation was failing. |
Yeah, it's funny that .a became irreproducible after enabling LTO, and I'm not sure how to deal with those LTO sections correctly. |
Hmm, LTO does seem to work on Fedora now too. Does the fwupd binary change hash between builds, or just the .a static lib? If not, the |
The unstripped static library changes between builds with profiling metadata when compiling with LTO. Fixes #1298
Sorry for my late reply. The fwupd binary is stable. The static library was the only one changed between builds. I was thinking about stripping the LTO section from object files in libfwupdprivate.a, but hashing the source files also works anyway. Thanks for the fix. |
The checksum in fu-hash.h is used to detect the 3rd party plugins. However, after enabling LTO, the checksum changed between builds even without any source code change. It's because the extra LTO sections like .gnu.lto_.profile.e56fb3a1c2ab9039 were added to the object files in libfwupdprivate.a, and the static library becomes irreproducible.
I currently work around the issue by creating a never used libfwupdprivate_dyn.so from libfwupdprivate.a and hash it. It's not perfect but at least guarantee a stable hash.
The text was updated successfully, but these errors were encountered: