Page MenuHomeFreeBSD

crunchgen: don't pass -dc to the linker
AbandonedPublic

Authored by emaste on Nov 17 2016, 6:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 6, 8:22 AM
Unknown Object (File)
Sep 17 2024, 8:57 AM
Unknown Object (File)
Aug 20 2024, 1:44 AM
Unknown Object (File)
Jul 4 2024, 4:57 AM
Unknown Object (File)
May 6 2024, 4:22 PM
Unknown Object (File)
Jan 14 2024, 6:27 PM
Unknown Object (File)
Nov 29 2023, 8:39 PM
Unknown Object (File)
Sep 21 2023, 10:35 PM
Subscribers

Details

Summary

The linker's -dc option converts common symbols into regular, allocated .bss symbols. However, this is not required by the crunch build process or rescue, and LLVM's lld linker does not support the -dc option. These symbols will be converted into allocated .bss symbols by the final binary link. If desired we can restore the previous (no common syms) configuration by adding -fno-common to the crunchgen-provided CFLAGS.

Note: we would see a difference in behaviour if the same common symbol exists in two object files: previously it would result in a multiple definition link error, now the common symbols will be combined.

Test Plan
  • apply this change
  • modify Makefile.inc1 to make crunchide an unconditional build tool (to be replaced with __FreeBSD_version test before commit)
  • build rescue
  • ad-hoc sanity test result

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste retitled this revision from to crunchgen: don't pass -dc to the linker.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added reviewers: bdrewery, pfg, marcel.
emaste added subscribers: adrian, imp, peter.
pfg edited edge metadata.

Looks OK.

This revision is now accepted and ready to land.Nov 20 2016, 8:16 PM

As it turns out this was based on an old experiment with lld. lld currently accepts (and ignores) -dc, as it always converts common symbols into allocated .bss symbols, so this change is unnecessary.

All else being equal I'll just drop the change and avoid possible unintended consequences.