Use lld by default on loongarch64-unknown-linux-gnu nightly - #162546
Conversation
Configure the LoongArch64 Linux targets to place read-only code in the first LOAD segment when linking with LLD, mold, and other GNU-compatible linkers. This keeps the segment layout consistent with GNU ld and allows Linux to make better use of file-backed PMD mappings, reducing iTLB misses.
|
These commits modify compiler targets. This PR modifies If appropriate, please update |
|
r? @chenyukang rustbot has assigned @chenyukang. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
576e2a7 to
a21fa13
Compare
|
This PR also shows a nice improvement in rustc-perf compile benchmarks: dynamic instructions are reduced by Using the self-contained LLD linker also avoids unusable binaries on some older systems where the old GNU ld cannot correctly handle the medium code model. |
| "x86_64-unknown-linux-gnu".to_string(), | ||
| DefaultLinuxLinkerOverride::SelfContainedLldCc, | ||
| )]); | ||
| if channel == "nightly" { |
There was a problem hiding this comment.
| if channel == "nightly" { | |
| if channel == "nightly" || channel == "dev" { |
This mirrors the existing default for x86_64-unknown-linux-gnu, but is gated to the nightly channel only, since it needs some soak time to catch any regressions before rolling it out to beta and stable.
a21fa13 to
5fc43e8
Compare
|
@bors r+ rollup |
Rollup of 10 pull requests Successful merges: - #162270 (Update `windows-bindgen` to 0.100.0) - #162492 (Revert "Rollup merge of #157518 - CAD97:xdg_basedir, r=aapoalas") - #162607 (Basic cleanup in `rustc_transmute`) - #162619 (Add test for the missing Clone requirement for Cow slices) - #162172 (mention the opaque when its hidden type cannot be inferred) - #162514 (Simplify diagnostic levels) - #162546 (Use lld by default on `loongarch64-unknown-linux-gnu` nightly) - #162564 (yeet StabilityLevel) - #162613 (iter::repeat_with, iter::successors, iter::from_fn added as diagnostic items) - #162616 (regression test for async main diagnostic)
Rollup merge of #162546 - heiher:loong64-gnu-lld-nightly, r=chenyukang Use lld by default on `loongarch64-unknown-linux-gnu` nightly This PR makes LLD the default linker for `loongarch64-unknown-linux-gnu` on nightly. As a prerequisite, it aligns the LoongArch64 Linux `LOAD` segment layout of LLD and other GNU-compatible linkers with GNU ld. This keeps the layout consistent and allows Linux to make better use of file-backed PMD mappings. The LLD default is initially limited to nightly to allow some soak time before rolling it out to beta and stable. To opt out of using LLD, `RUSTFLAGS="-Clinker-features=-lld"` would be used. To opt out of using rust-lld, falling back to the LLD installed on the system, `RUSTFLAGS="-Clink-self-contained=-linker"` would be used.
This PR makes LLD the default linker for
loongarch64-unknown-linux-gnuon nightly.As a prerequisite, it aligns the LoongArch64 Linux
LOADsegment layout of LLD and other GNU-compatible linkers with GNU ld. This keeps the layout consistent and allows Linux to make better use of file-backed PMD mappings.The LLD default is initially limited to nightly to allow some soak time before rolling it out to beta and stable.
To opt out of using LLD,
RUSTFLAGS="-Clinker-features=-lld"would be used. To opt out of using rust-lld, falling back to the LLD installed on the system,RUSTFLAGS="-Clink-self-contained=-linker"would be used.