@@ -579,24 +579,6 @@ impl Step for RustcLink {
579579 }
580580}
581581
582- fn copy_lld_to_sysroot ( builder : & Builder < ' _ > ,
583- target_compiler : Compiler ,
584- lld_install_root : & Path ) {
585- let target = target_compiler. host ;
586-
587- let dst = builder. sysroot_libdir ( target_compiler, target)
588- . parent ( )
589- . unwrap ( )
590- . join ( "bin" ) ;
591- t ! ( fs:: create_dir_all( & dst) ) ;
592-
593- let src_exe = exe ( "lld" , & target) ;
594- let dst_exe = exe ( "rust-lld" , & target) ;
595- // we prepend this bin directory to the user PATH when linking Rust binaries. To
596- // avoid shadowing the system LLD we rename the LLD we provide to `rust-lld`.
597- builder. copy ( & lld_install_root. join ( "bin" ) . join ( & src_exe) , & dst. join ( & dst_exe) ) ;
598- }
599-
600582/// Cargo's output path for the standard library in a given stage, compiled
601583/// by a particular compiler for the specified target.
602584pub fn libstd_stamp (
@@ -745,10 +727,16 @@ impl Step for Assemble {
745727 }
746728 }
747729
730+ let libdir = builder. sysroot_libdir ( target_compiler, target_compiler. host ) ;
748731 if let Some ( lld_install) = lld_install {
749- copy_lld_to_sysroot ( builder, target_compiler, & lld_install) ;
732+ let src_exe = exe ( "lld" , & target_compiler. host ) ;
733+ let dst_exe = exe ( "rust-lld" , & target_compiler. host ) ;
734+ // we prepend this bin directory to the user PATH when linking Rust binaries. To
735+ // avoid shadowing the system LLD we rename the LLD we provide to `rust-lld`.
736+ let dst = libdir. parent ( ) . unwrap ( ) . join ( "bin" ) ;
737+ t ! ( fs:: create_dir_all( & dst) ) ;
738+ builder. copy ( & lld_install. join ( "bin" ) . join ( & src_exe) , & dst. join ( & dst_exe) ) ;
750739 }
751-
752740 dist:: maybe_install_llvm_dylib ( builder, target_compiler. host , & sysroot) ;
753741
754742 // Link the compiler binary itself into place
0 commit comments