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)
Sun, Jun 16, 6:38 AM
Unknown Object (File)
Thu, Jun 13, 7:46 PM
Unknown Object (File)
Sat, Jun 1, 10:33 AM
Unknown Object (File)
Sat, Jun 1, 9:45 AM
Unknown Object (File)
May 10 2024, 12:32 PM
Unknown Object (File)
Apr 29 2024, 3:00 PM
Unknown Object (File)
Apr 29 2024, 2:56 PM
Unknown Object (File)
Apr 29 2024, 2:56 PM
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.