about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-31 11:50:40 +0200
committerGitHub <noreply@github.com>2024-03-31 11:50:40 +0200
commit0928a54a1b0f6b1117d40e551f13d6226070dcef (patch)
treee1162e867608aea1dd58d97db8914ce84cb35306
parentc93b17d6d20a234f21e04804adef7b58a08dd9e4 (diff)
parenta4087b7915b2b77ecb198f0f2b1afd68a24a3144 (diff)
downloadrust-0928a54a1b0f6b1117d40e551f13d6226070dcef.tar.gz
rust-0928a54a1b0f6b1117d40e551f13d6226070dcef.zip
Rollup merge of #123189 - Kobzol:rustc-shim-log, r=onur-ozkan
Log BOLT args in bootstrap `rustc` shim

Before, the BOLT argument would not be logged, because it was only added after the logging has happened.

Found by `@RalfJung` [here](https://github.com/rust-lang/rust/pull/116352#discussion_r1544235771).
-rw-r--r--src/bootstrap/src/bin/rustc.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/bootstrap/src/bin/rustc.rs b/src/bootstrap/src/bin/rustc.rs
index 74a924d86c7..49bda40e7f1 100644
--- a/src/bootstrap/src/bin/rustc.rs
+++ b/src/bootstrap/src/bin/rustc.rs
@@ -220,6 +220,12 @@ fn main() {
         }
     }
 
+    if env::var_os("RUSTC_BOLT_LINK_FLAGS").is_some() {
+        if let Some("rustc_driver") = crate_name {
+            cmd.arg("-Clink-args=-Wl,-q");
+        }
+    }
+
     let is_test = args.iter().any(|a| a == "--test");
     if verbose > 2 {
         let rust_env_vars =
@@ -244,12 +250,6 @@ fn main() {
         eprintln!("{prefix} libdir: {libdir:?}");
     }
 
-    if env::var_os("RUSTC_BOLT_LINK_FLAGS").is_some() {
-        if let Some("rustc_driver") = crate_name {
-            cmd.arg("-Clink-args=-Wl,-q");
-        }
-    }
-
     bin_helpers::maybe_dump(format!("stage{stage}-rustc"), &cmd);
 
     let start = Instant::now();