Skip to content

Commit 4805489

Browse files
committed
opt-dist: rebuild rustc when doing static LLVM builds
when building LLVM it's obvious that in case of shared build rustc doesn't need to be recompiled, but with static builds it would be better to compile rustc again to ensure we linked proper library. maybe I didn't understand the pipeline correctly, but it was strange for me to see that in Stage 5 LLVM is built while rustc is not
1 parent d2baa49 commit 4805489

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,11 @@ fn execute_pipeline(
343343

344344
let mut dist = Bootstrap::dist(env, &dist_args)
345345
.llvm_pgo_optimize(&llvm_pgo_profile)
346-
.rustc_pgo_optimize(&rustc_pgo_profile)
347-
.avoid_rustc_rebuild();
346+
.rustc_pgo_optimize(&rustc_pgo_profile);
347+
348+
if env.supports_shared_llvm() {
349+
dist = dist.avoid_rustc_rebuild()
350+
}
348351

349352
for bolt_profile in bolt_profiles {
350353
dist = dist.with_bolt_profile(bolt_profile);

0 commit comments

Comments
 (0)