@@ -739,7 +739,7 @@ impl Build {
739739 /// Note that if LLVM is configured externally then the directory returned
740740 /// will likely be empty.
741741 fn llvm_out ( & self , target : TargetSelection ) -> PathBuf {
742- if self . config . llvm_from_ci && self . config . build == target {
742+ if self . config . llvm_from_ci && self . is_host_target ( & target) {
743743 self . config . ci_llvm_root ( )
744744 } else {
745745 self . out . join ( target) . join ( "llvm" )
@@ -789,7 +789,7 @@ impl Build {
789789 fn is_system_llvm ( & self , target : TargetSelection ) -> bool {
790790 match self . config . target_config . get ( & target) {
791791 Some ( Target { llvm_config : Some ( _) , .. } ) => {
792- let ci_llvm = self . config . llvm_from_ci && target == self . config . build ;
792+ let ci_llvm = self . config . llvm_from_ci && self . is_host_target ( & target ) ;
793793 !ci_llvm
794794 }
795795 // We're building from the in-tree src/llvm-project sources.
@@ -1274,7 +1274,7 @@ Executed at: {executed_at}"#,
12741274 // need to use CXX compiler as linker to resolve the exception functions
12751275 // that are only existed in CXX libraries
12761276 Some ( self . cxx . borrow ( ) [ & target] . path ( ) . into ( ) )
1277- } else if target != self . config . build
1277+ } else if ! self . is_host_target ( & target )
12781278 && helpers:: use_host_linker ( target)
12791279 && !target. is_msvc ( )
12801280 {
@@ -1925,6 +1925,11 @@ to download LLVM rather than building it.
19251925 stream. reset ( ) . unwrap ( ) ;
19261926 result
19271927 }
1928+
1929+ /// Checks if the given target is the same as the host target.
1930+ fn is_host_target ( & self , target : & TargetSelection ) -> bool {
1931+ & self . config . build == target
1932+ }
19281933}
19291934
19301935#[ cfg( unix) ]
0 commit comments