Page MenuHomeFreeBSD

Fix EFI loader reproducibility with lld
ClosedPublic

Authored by dim on Aug 11 2024, 7:54 PM.
Tags
None
Referenced Files
F113095536: D46271.id141996.diff
Wed, Mar 26, 9:11 AM
Unknown Object (File)
Thu, Mar 13, 9:12 AM
Unknown Object (File)
Feb 18 2025, 2:00 AM
Unknown Object (File)
Feb 15 2025, 4:47 PM
Unknown Object (File)
Feb 5 2025, 2:24 AM
Unknown Object (File)
Feb 5 2025, 2:23 AM
Unknown Object (File)
Feb 5 2025, 2:17 AM
Unknown Object (File)
Feb 4 2025, 8:09 AM
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.