@@ -35,7 +35,7 @@ use crate::utils::build_stamp::{self, BuildStamp};
3535use crate :: utils:: channel:: { self , Info } ;
3636use crate :: utils:: exec:: { BootstrapCommand , command} ;
3737use crate :: utils:: helpers:: {
38- exe, is_dylib, move_file, t, target_supports_cranelift_backend, timeit,
38+ exe, is_dylib, libdir , move_file, t, target_supports_cranelift_backend, timeit,
3939} ;
4040use crate :: utils:: tarball:: { GeneratedTarball , OverlayKind , Tarball } ;
4141use crate :: { CodegenBackendKind , Compiler , DependencyType , FileType , LLVM_TOOLS , Mode , trace} ;
@@ -2533,7 +2533,7 @@ fn maybe_install_llvm(
25332533 ) ,
25342534) ]
25352535pub fn maybe_install_llvm_target ( builder : & Builder < ' _ > , target : TargetSelection , sysroot : & Path ) {
2536- let dst_libdir = sysroot. join ( "lib/rustlib" ) . join ( target) . join ( "lib" ) ;
2536+ let dst_libdir = sysroot. join ( "lib/rustlib" ) . join ( target) . join ( libdir ( target ) ) ;
25372537 // We do not need to copy LLVM files into the sysroot if it is not
25382538 // dynamically linked; it is already included into librustc_llvm
25392539 // statically.
@@ -2558,11 +2558,12 @@ pub fn maybe_install_llvm_target(builder: &Builder<'_>, target: TargetSelection,
25582558) ]
25592559pub fn maybe_install_llvm_runtime ( builder : & Builder < ' _ > , target : TargetSelection , sysroot : & Path ) {
25602560 let dst_libdir = sysroot. join ( builder. sysroot_libdir_relative ( Compiler :: new ( 1 , target) ) ) ;
2561+ let dst_runtime_libdir = dst_libdir. parent ( ) . unwrap ( ) . join ( libdir ( target) ) ;
25612562 // We do not need to copy LLVM files into the sysroot if it is not
25622563 // dynamically linked; it is already included into librustc_llvm
25632564 // statically.
25642565 if builder. llvm_link_shared ( ) {
2565- maybe_install_llvm ( builder, target, & dst_libdir , false ) ;
2566+ maybe_install_llvm ( builder, target, & dst_runtime_libdir , false ) ;
25662567 }
25672568}
25682569
0 commit comments