-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Change how LLD is configured in bootstrap.toml #146640
Copy link
Copy link
Closed
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Metadata
Metadata
Assignees
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Type
Fields
Give feedbackNo fields configured for issues without a type.
Currently, the way LLD (and using it as a default linker for a given target) is configured in bootstrap is a big mess. We have:
rust.use-lld, which tells bootstrap to use LLD when building local Rust components, so it is only relevant for bootstrapping and faster local (re)builds.rust.lld, which both:rust-lldby default (ONLY onx86_64-unknown-linux-gnu)rust.default-linker, which changes the default linker to be used by rustc, but this does not work on Linux, which is why we used therust.lldhack aboveI would suggest the following, based on prior discussions in #146604 and other PRs:
rust.use-lldto e.g.rust.bootstrap-override-lld, to make it clear that it's a bootstrapping-only flag.rust.use-lldtorust.bootstrap-override-lld#147046MoveEdit: I don't think it's worth the churn.rust.lldtollvm.lld, because the LLVM section configures which LLVM-adjacent things we build, and make it only mean "build LLD and add it to sysroot", nothing elsetarget.<target>.default-linker-linux, which can be either unset or "self-contained-lld-cc". It will be mutually exclusive withrust.default_linker.We should keep the old options for some time, to keep backwards compatibility.