-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Open
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)
Description
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:- Tells bootstrap to build LLD and include it in the built rustc's sysroot
- Tells rustc to use
rust-lld
by 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.lld
hack above
I would suggest the following, based on prior discussions in #146604 and other PRs:
- Rename
rust.use-lld
to e.g.rust.bootstrap-override-lld
, to make it clear that it's a bootstrapping-only flag. - Move
rust.lld
tollvm.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 else - Add
target.<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.
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)