Page MenuHomeFreeBSD

Fix EFI loader reproducibility with lld
ClosedPublic

Authored by dim on Aug 11 2024, 7:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 2:20 AM
Unknown Object (File)
Fri, Nov 1, 7:26 PM
Unknown Object (File)
Fri, Nov 1, 6:57 PM
Unknown Object (File)
Mon, Oct 21, 1:02 PM
Unknown Object (File)
Thu, Oct 17, 9:23 PM
Unknown Object (File)
Sun, Oct 6, 9:09 AM
Unknown Object (File)
Oct 3 2024, 3:19 PM
Unknown Object (File)
Oct 1 2024, 1:55 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.Aug 11 2024, 7:54 PM

OK as a workaround but we ought to report this upstream

This revision is now accepted and ready to land.Aug 11 2024, 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.Aug 12 2024, 11:54 AM
This revision is now accepted and ready to land.Aug 12 2024, 11:59 AM
This revision was automatically updated to reflect the committed changes.