about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-04-09 17:47:32 +0200
committerJakub Beránek <berykubik@gmail.com>2025-04-10 08:56:57 +0200
commit9a26863acc2a8fdd6a21834fa418673ee33861e2 (patch)
treee0169c201ee80d9d58a96e1b573699fbf28a724d /src
parentf06e5c1e35bc5bc6131c6f8a0eb782097e3f28c3 (diff)
Apply LTO when building rustc tools
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/src/core/build_steps/tool.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
index b58d279359e..fc8d9d6d57b 100644
--- a/src/bootstrap/src/core/build_steps/tool.rs
+++ b/src/bootstrap/src/core/build_steps/tool.rs
@@ -148,7 +148,9 @@ impl Step for ToolBuild {
             &self.extra_features,
         );
 
-        if path.ends_with("/rustdoc") &&
+        // Rustc tools (miri, clippy, cargo, rustfmt, rust-analyzer)
+        // could use the additional optimizations.
+        if self.mode == Mode::ToolRustc &&
             // rustdoc is performance sensitive, so apply LTO to it.
             is_lto_stage(&self.compiler)
         {