about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-01-20 20:58:38 +0100
committerGitHub <noreply@github.com>2025-01-20 20:58:38 +0100
commit23a32e3c0e73227a4b2d0bbd88ad50a622da3328 (patch)
treef519b15491d7bd5901fed60038d337ec3cdb3ae3
parente3aa2b795fd3750ab06ba4cc53a6fa73199d33d1 (diff)
parentf14111806d6ff2a76a828f9b0303603c8e3cc966 (diff)
downloadrust-23a32e3c0e73227a4b2d0bbd88ad50a622da3328.tar.gz
rust-23a32e3c0e73227a4b2d0bbd88ad50a622da3328.zip
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: https://github.com/rust-lang/rustc_codegen_cranelift/pull/1554

r? ``@ghost``

``@rustbot`` label +A-codegen +A-cranelift +T-compiler
-rw-r--r--rust-toolchain2
-rwxr-xr-xscripts/test_rustc_tests.sh5
-rw-r--r--src/driver/aot.rs10
3 files changed, 12 insertions, 5 deletions
diff --git a/rust-toolchain b/rust-toolchain
index e4c3dd708fd..9c6aad3490d 100644
--- a/rust-toolchain
+++ b/rust-toolchain
@@ -1,4 +1,4 @@
 [toolchain]
-channel = "nightly-2025-01-10"
+channel = "nightly-2025-01-20"
 components = ["rust-src", "rustc-dev", "llvm-tools"]
 profile = "minimal"
diff --git a/scripts/test_rustc_tests.sh b/scripts/test_rustc_tests.sh
index e569da90cf7..41aa011e805 100755
--- a/scripts/test_rustc_tests.sh
+++ b/scripts/test_rustc_tests.sh
@@ -176,12 +176,11 @@ diff --git a/src/tools/run-make-support/src/rustdoc.rs b/src/tools/run-make-supp
 index 9607ff02f96..b7d97caf9a2 100644
 --- a/src/tools/run-make-support/src/external_deps/rustdoc.rs
 +++ b/src/tools/run-make-support/src/external_deps/rustdoc.rs
-@@ -34,8 +34,6 @@ pub fn bare() -> Self {
+@@ -34,7 +34,6 @@ pub fn bare() -> Self {
      #[track_caller]
      pub fn new() -> Self {
          let mut cmd = setup_common();
--        let target_rpath_dir = env_var_os("TARGET_RPATH_DIR");
--        cmd.arg(format!("-L{}", target_rpath_dir.to_string_lossy()));
+-        cmd.arg("-L").arg(env_var_os("TARGET_RPATH_DIR"));
          Self { cmd }
      }
 
diff --git a/src/driver/aot.rs b/src/driver/aot.rs
index fe578e44770..7d5592daac1 100644
--- a/src/driver/aot.rs
+++ b/src/driver/aot.rs
@@ -333,9 +333,17 @@ fn make_module(sess: &Session, name: String) -> UnwindModule<ObjectModule> {
 
     let mut builder =
         ObjectBuilder::new(isa, name + ".o", cranelift_module::default_libcall_names()).unwrap();
+
+    // Disable function sections by default on MSVC as it causes significant slowdowns with link.exe.
+    // Maybe link.exe has exponential behavior when there are many sections with the same name? Also
+    // explicitly disable it on MinGW as rustc already disables it by default on MinGW and as such
+    // isn't tested. If rustc enables it in the future on MinGW, we can re-enable it too once it has
+    // been on MinGW.
+    let default_function_sections = sess.target.function_sections && !sess.target.is_like_windows;
     builder.per_function_section(
-        sess.opts.unstable_opts.function_sections.unwrap_or(sess.target.function_sections),
+        sess.opts.unstable_opts.function_sections.unwrap_or(default_function_sections),
     );
+
     UnwindModule::new(ObjectModule::new(builder), true)
 }