@@ -443,23 +443,20 @@ impl Step for Llvm {
443443 // See https://github.com/rust-lang/rust/pull/50104
444444 cfg. define ( "LLVM_ENABLE_LIBXML2" , "OFF" ) ;
445445
446- if !enabled_llvm_projects. is_empty ( ) {
447- enabled_llvm_projects. sort ( ) ;
448- enabled_llvm_projects. dedup ( ) ;
449- cfg. define ( "LLVM_ENABLE_PROJECTS" , enabled_llvm_projects. join ( ";" ) ) ;
450- }
451-
452446 let mut enabled_llvm_runtimes = Vec :: new ( ) ;
453447
454448 if helpers:: forcing_clang_based_tests ( ) {
455449 enabled_llvm_runtimes. push ( "compiler-rt" ) ;
456450 }
457451
452+ // This is an experimental flag, which likely builds more than necessary.
453+ // We will optimize it when we get closer to releasing it on nightly.
458454 if builder. config . llvm_offload {
459455 enabled_llvm_runtimes. push ( "offload" ) ;
460456 //FIXME(ZuseZ4): LLVM intends to drop the offload dependency on openmp.
461457 //Remove this line once they achieved it.
462458 enabled_llvm_runtimes. push ( "openmp" ) ;
459+ enabled_llvm_projects. push ( "compiler-rt" ) ;
463460 }
464461
465462 if !enabled_llvm_runtimes. is_empty ( ) {
@@ -468,6 +465,12 @@ impl Step for Llvm {
468465 cfg. define ( "LLVM_ENABLE_RUNTIMES" , enabled_llvm_runtimes. join ( ";" ) ) ;
469466 }
470467
468+ if !enabled_llvm_projects. is_empty ( ) {
469+ enabled_llvm_projects. sort ( ) ;
470+ enabled_llvm_projects. dedup ( ) ;
471+ cfg. define ( "LLVM_ENABLE_PROJECTS" , enabled_llvm_projects. join ( ";" ) ) ;
472+ }
473+
471474 if let Some ( num_linkers) = builder. config . llvm_link_jobs
472475 && num_linkers > 0
473476 {
0 commit comments