Page MenuHomeFreeBSD

Fix EFI loader reproducibility with lld
ClosedPublic

Authored by dim on Sun, Aug 11, 7:54 PM.
Tags
None
Referenced Files
F93562590: D46271.diff
Tue, Sep 10, 1:25 PM
Unknown Object (File)
Sun, Sep 8, 4:10 PM
Unknown Object (File)
Wed, Aug 21, 1:35 PM
Unknown Object (File)
Tue, Aug 13, 4:27 PM
Unknown Object (File)
Tue, Aug 13, 1:19 PM
Unknown Object (File)
Tue, Aug 13, 8:57 AM
Unknown Object (File)
Tue, Aug 13, 8:27 AM
Unknown Object (File)
Mon, Aug 12, 1:39 PM
Subscribers

Details

Summary

When the various loaders under stand/efi are built, the resulting
binaries differ over multiple runs, even if WITH_REPRODUCIBLE_BUILD is
used. This is caused by lld multithreading and the custom linker scripts
for the loaders, and affects the following binaries:

  • loader_4th.efi
  • loader_4th.sym
  • loader_4th.sym.full
  • loader_lua.efi
  • loader_lua.sym
  • loader_lua.sym.full
  • loader_simp.efi
  • loader_simp.sym
  • loader_simp.sym.full

Work around this by disabling lld threading for these binaries.

MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dim requested review of this revision.Sun, Aug 11, 7:54 PM

OK as a workaround but we ought to report this upstream

This revision is now accepted and ready to land.Sun, Aug 11, 8:49 PM

Looks good, assuming we don't already hsve a LDFLAGS.lld that we add to LDFLAGS like we do for CFLAGS.

In D46271#1055178, @imp wrote:

Looks good, assuming we don't already hsve a LDFLAGS.lld that we add to LDFLAGS like we do for CFLAGS.

We do have LDFLAGS.lld, and using that works (without needing the .if/.endif).

This revision now requires review to proceed.Mon, Aug 12, 11:54 AM
This revision is now accepted and ready to land.Mon, Aug 12, 11:59 AM
This revision was automatically updated to reflect the committed changes.