Skip to content

Commit 482a820

Browse files
committed
Pass BOLT settings at the correct step
1 parent 9a0e90f commit 482a820

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/bootstrap/compile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ impl Step for Rustc {
907907
}
908908

909909
if builder.build.config.enable_bolt_settings && compiler.stage == 1 {
910-
// Relocations are required for BOLT to work.k
910+
// Relocations are required for BOLT to work.
911911
cargo.env("RUSTC_BOLT_LINK_FLAGS", "1");
912912
}
913913

src/tools/opt-dist/src/main.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,12 @@ fn execute_pipeline(
215215
print_free_disk_space()?;
216216

217217
stage.section("Build PGO optimized rustc", |section| {
218-
Bootstrap::build(env).rustc_pgo_optimize(&profile).run(section)
218+
let mut cmd = Bootstrap::build(env).rustc_pgo_optimize(&profile);
219+
if env.use_bolt() {
220+
cmd = cmd.with_rustc_bolt_ldflags();
221+
}
222+
223+
cmd.run(section)
219224
})?;
220225

221226
Ok(profile)
@@ -259,7 +264,6 @@ fn execute_pipeline(
259264
stage.section("Build PGO optimized LLVM", |stage| {
260265
Bootstrap::build(env)
261266
.with_llvm_bolt_ldflags()
262-
.with_rustc_bolt_ldflags()
263267
.llvm_pgo_optimize(&llvm_pgo_profile)
264268
.avoid_rustc_rebuild()
265269
.run(stage)
@@ -270,7 +274,7 @@ fn execute_pipeline(
270274

271275
log::info!("Optimizing {llvm_lib} with BOLT");
272276

273-
// FIXME(kobzol: try gather profiles together, at once for LLVM and rustc
277+
// FIXME(kobzol): try gather profiles together, at once for LLVM and rustc
274278
// Instrument the libraries and gather profiles
275279
let llvm_profile = with_bolt_instrumented(&llvm_lib, |llvm_profile_dir| {
276280
stage.section("Gather profiles", |_| {

0 commit comments

Comments
 (0)