Skip to content

Commit 7bce3ef

Browse files
committed
Build Cargo with Thin LTO and 1 CGU
1 parent a2016aa commit 7bce3ef

File tree

1 file changed

+3
-0
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+3
-0
lines changed

src/bootstrap/src/core/build_steps/tool.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ pub fn prepare_tool_cargo(
229229
// `RUSTFLAGS` causes unnecessary tool rebuilds due to cache invalidation from building e.g.
230230
// cargo *without* `-Zon-broken-pipe=kill` but then rustdoc *with* `-Zon-broken-pipe=kill`.
231231
cargo.env("FORCE_ON_BROKEN_PIPE_KILL", "-Zon-broken-pipe=kill");
232+
} else {
233+
cargo.env("CARGO_PROFILE_RELEASE_LTO", "thin");
234+
cargo.env("CARGO_PROFILE_RELEASE_CODEGEN_UNITS", "1");
232235
}
233236

234237
cargo

0 commit comments

Comments
 (0)