Skip to content

Commit e4500bd

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 1079c5e commit e4500bd

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
@@ -363,8 +363,11 @@ fn execute_pipeline(
363363

364364
let mut dist = Bootstrap::dist(env, &dist_args)
365365
.llvm_pgo_optimize(llvm_pgo_profile.as_ref())
366-
.rustc_pgo_optimize(&rustc_pgo_profile)
367-
.avoid_rustc_rebuild();
366+
.rustc_pgo_optimize(&rustc_pgo_profile);
367+
368+
if env.supports_shared_llvm() {
369+
dist = dist.avoid_rustc_rebuild()
370+
}
368371

369372
for bolt_profile in bolt_profiles {
370373
dist = dist.with_bolt_profile(bolt_profile);

0 commit comments

Comments
 (0)