Page MenuHomeFreeBSD

apply WITH_LLD_AS_LD also to build tools
ClosedPublic

Authored by emaste on Jan 18 2017, 12:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 9 2024, 10:37 AM
Unknown Object (File)
Jul 31 2024, 9:53 AM
Unknown Object (File)
Jul 15 2024, 12:49 AM
Unknown Object (File)
Jul 8 2024, 3:52 AM
Unknown Object (File)
Jul 1 2024, 4:54 AM
Unknown Object (File)
Jun 30 2024, 9:56 AM
Unknown Object (File)
Jun 23 2024, 5:00 AM
Unknown Object (File)
Jun 16 2024, 6:38 AM
Subscribers
None

Details

Summary

Previously WITH_LLD_AS_LD installed LLD as /usr/bin/ld in the target system, but still used BFD ld as the linker for the binaries in that target. LLD 4.0.0 can link the FreeBSD world and kernel so use LLD as the build-time linker as well when the knob is set.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste retitled this revision from to apply WITH_LLD_AS_LD also to build tools.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added reviewers: dim, andrew.

Note that this has no effect by default on any arch, since MK_LLD_AS_LD defaults to no everywhere but arm64, and on arm64 we currently override the in-tree toolchain using the aarch64-binutils package automatically.

Makefile.inc1
519 ↗(On Diff #24140)

Previously this forced the use of ld.bfd to build the world and kernel, but installed ld.lld as /usr/bin/ld in the result. Without overriding it, WITH_LLD_AS_LD will apply to both the ld used to build world, as well as the ld installed in the world.

lib/clang/libllvm/Makefile
1149 ↗(On Diff #24140)

!defined(TOOLS_PREFIX) is used as a proxy for "building the tool chain that will be installed in the resulting world". We need ${SRCS_MIW} included if we're building LLD as part of the build tool chain.

lib/clang/libllvm/Makefile
1149 ↗(On Diff #24140)

Not sure if this will be enough. At the moment there is no separate category SRCS_xxx for just MK_LLD, so whether those sources are enough to build lld is unclear.

It is likely that we have to add more objects to SRCS_MIW, instead.

lib/clang/libllvm/Makefile
1149 ↗(On Diff #24140)

When LLD is built to be installed in the target (${WITH_LLD}) it's already building against ${SRCS_MIW} via TOOLS_PREFIX. Unless you mean for example that WITH_LLD but WITHOUT_LLDB doesn't work today?

It's when we're building LLD early (${WITH_LLD_AS_LD}) that ${SRCS_MIW} isn't available and LLD fails to build (with the other change above).

This revision was automatically updated to reflect the committed changes.