File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,12 @@ impl Bootstrap {
189189 self
190190 }
191191
192+ /// Rebuild rustc in case of statically linked LLVM
193+ pub fn rustc_rebuild ( mut self ) -> Self {
194+ self . cmd = self . cmd . arg ( "--keep-stage" ) . arg ( "0" ) ;
195+ self
196+ }
197+
192198 pub fn run ( self , timer : & mut TimerSection ) -> anyhow:: Result < ( ) > {
193199 self . cmd . run ( ) ?;
194200 let metrics = load_metrics ( & self . metrics_path ) ?;
Original file line number Diff line number Diff line change @@ -375,8 +375,14 @@ fn execute_pipeline(
375375
376376 let mut dist = Bootstrap :: dist ( env, & dist_args)
377377 . llvm_pgo_optimize ( llvm_pgo_profile. as_ref ( ) )
378- . rustc_pgo_optimize ( & rustc_pgo_profile)
379- . avoid_rustc_rebuild ( ) ;
378+ . rustc_pgo_optimize ( & rustc_pgo_profile) ;
379+
380+ // if LLVM is not built we'll have PGO optimized rustc
381+ dist = if env. supports_shared_llvm ( ) || !env. build_llvm ( ) {
382+ dist. avoid_rustc_rebuild ( )
383+ } else {
384+ dist. rustc_rebuild ( )
385+ } ;
380386
381387 for bolt_profile in bolt_profiles {
382388 dist = dist. with_bolt_profile ( bolt_profile) ;
You can’t perform that action at this time.
0 commit comments