Skip to content

Commit 67b609a

Browse files
authored
Rollup merge of #135776 - bjorn3:sync_cg_clif-2025-01-20, r=bjorn3
Subtree sync for rustc_codegen_cranelift Nothing too exciting this time, but this includes a fix for a linker hang on Windows: rust-lang/rustc_codegen_cranelift#1554 r? ``@ghost`` ``@rustbot`` label +A-codegen +A-cranelift +T-compiler
2 parents b0eadb1 + d740a3f commit 67b609a

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "nightly-2025-01-10"
2+
channel = "nightly-2025-01-20"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]
44
profile = "minimal"

compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,11 @@ diff --git a/src/tools/run-make-support/src/rustdoc.rs b/src/tools/run-make-supp
176176
index 9607ff02f96..b7d97caf9a2 100644
177177
--- a/src/tools/run-make-support/src/external_deps/rustdoc.rs
178178
+++ b/src/tools/run-make-support/src/external_deps/rustdoc.rs
179-
@@ -34,8 +34,6 @@ pub fn bare() -> Self {
179+
@@ -34,7 +34,6 @@ pub fn bare() -> Self {
180180
#[track_caller]
181181
pub fn new() -> Self {
182182
let mut cmd = setup_common();
183-
- let target_rpath_dir = env_var_os("TARGET_RPATH_DIR");
184-
- cmd.arg(format!("-L{}", target_rpath_dir.to_string_lossy()));
183+
- cmd.arg("-L").arg(env_var_os("TARGET_RPATH_DIR"));
185184
Self { cmd }
186185
}
187186

compiler/rustc_codegen_cranelift/src/driver/aot.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,17 @@ fn make_module(sess: &Session, name: String) -> UnwindModule<ObjectModule> {
333333

334334
let mut builder =
335335
ObjectBuilder::new(isa, name + ".o", cranelift_module::default_libcall_names()).unwrap();
336+
337+
// Disable function sections by default on MSVC as it causes significant slowdowns with link.exe.
338+
// Maybe link.exe has exponential behavior when there are many sections with the same name? Also
339+
// explicitly disable it on MinGW as rustc already disables it by default on MinGW and as such
340+
// isn't tested. If rustc enables it in the future on MinGW, we can re-enable it too once it has
341+
// been on MinGW.
342+
let default_function_sections = sess.target.function_sections && !sess.target.is_like_windows;
336343
builder.per_function_section(
337-
sess.opts.unstable_opts.function_sections.unwrap_or(sess.target.function_sections),
344+
sess.opts.unstable_opts.function_sections.unwrap_or(default_function_sections),
338345
);
346+
339347
UnwindModule::new(ObjectModule::new(builder), true)
340348
}
341349

0 commit comments

Comments
 (0)