Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 08b4256

Browse files
committedMar 4, 2025
Auto merge of #138007 - jieyouxu:rollup-z897tqe, r=jieyouxu
Rollup of 10 pull requests Successful merges: - #136581 (Retire the legacy `Makefile`-based `run-make` test infra) - #136865 (Perform deeper compiletest path normalization for `$TEST_BUILD_DIR` to account for compare-mode/debugger cases, and normalize long type file filename hashes) - #136975 (Look for `python3` first on MacOS, not `py`) - #137240 (Slightly reformat `std::fs::remove_dir_all` error docs) - #137303 (Remove `MaybeForgetReturn` suggestion) - #137634 (Update `compiler-builtins` to 0.1.149) - #137679 (Various coretests improvements) - #137685 (self-contained linker: conservatively default to `-znostart-stop-gc`) - #137850 (Stabilize `box_uninit_write`) - #137947 (Do not install rustup on Rust for Linux job) r? `@ghost` `@rustbot` modify labels: rollup
2 parents f9e0239 + 89c12e0 commit 08b4256

File tree

107 files changed

+255
-1090
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+255
-1090
lines changed
 

‎compiler/rustc_codegen_cranelift/patches/0029-stdlib-Disable-f16-and-f128-in-compiler-builtins.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ index 7165c3e48af..968552ad435 100644
1616

1717
[dependencies]
1818
core = { path = "../core", public = true }
19-
-compiler_builtins = { version = "=0.1.148", features = ['rustc-dep-of-std'] }
20-
+compiler_builtins = { version = "=0.1.148", features = ['rustc-dep-of-std', 'no-f16-f128'] }
19+
-compiler_builtins = { version = "=0.1.150", features = ['rustc-dep-of-std'] }
20+
+compiler_builtins = { version = "=0.1.150", features = ['rustc-dep-of-std', 'no-f16-f128'] }
2121

2222
[dev-dependencies]
2323
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }

‎compiler/rustc_codegen_ssa/src/back/link.rs

+26
Original file line numberDiff line numberDiff line change
@@ -3382,6 +3382,32 @@ fn add_lld_args(
33823382
// this, `wasm-component-ld`, which is overridden if this option is passed.
33833383
if !sess.target.is_like_wasm {
33843384
cmd.cc_arg("-fuse-ld=lld");
3385+
3386+
// GNU ld and LLD have opposite defaults on some section garbage-collection features. For
3387+
// example, the somewhat popular `linkme` crate and its dependents rely in practice on this
3388+
// difference: when using lld, they need `-z nostart-stop-gc` to prevent encapsulation
3389+
// symbols and sections from being garbage-collected.
3390+
//
3391+
// More information about all this can be found in:
3392+
// - https://maskray.me/blog/2021-01-31-metadata-sections-comdat-and-shf-link-order
3393+
// - https://lld.llvm.org/ELF/start-stop-gc
3394+
//
3395+
// So when using lld, we restore, for now, the traditional behavior to help migration, but
3396+
// will remove it in the future.
3397+
// Since this only disables an optimization, it shouldn't create issues, but is in theory
3398+
// slightly suboptimal. However, it:
3399+
// - doesn't have any visible impact on our benchmarks
3400+
// - reduces the need to disable lld for the crates that depend on this
3401+
//
3402+
// Note that lld can detect some cases where this difference is relied on, and emits a
3403+
// dedicated error to add this link arg. We could make use of this error to emit an FCW. As
3404+
// of writing this, we don't do it, because lld is already enabled by default on nightly
3405+
// without this mitigation: no working project would see the FCW, so we do this to help
3406+
// stabilization.
3407+
//
3408+
// FIXME: emit an FCW if linking fails due its absence, and then remove this link-arg in the
3409+
// future.
3410+
cmd.link_arg("-znostart-stop-gc");
33853411
}
33863412

33873413
if !flavor.is_gnu() {

0 commit comments

Comments
 (0)
Please sign in to comment.