File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -344,13 +344,19 @@ impl Build {
344344 // we always try to use git for LLVM builds
345345 let in_tree_llvm_info = channel:: GitInfo :: new ( false , & src. join ( "src/llvm-project" ) ) ;
346346
347- let initial_sysroot = config. initial_rustc . parent ( ) . unwrap ( ) . parent ( ) . unwrap ( ) ;
348- let initial_lld = initial_sysroot
349- . join ( "lib" )
350- . join ( "rustlib" )
351- . join ( config. build )
352- . join ( "bin" )
353- . join ( "rust-lld" ) ;
347+ let initial_target_libdir = if config. dry_run {
348+ "/dummy/path/to/lib/" . to_string ( )
349+ } else {
350+ output (
351+ Command :: new ( & config. initial_rustc )
352+ . arg ( "--target" )
353+ . arg ( config. build )
354+ . arg ( "--print" )
355+ . arg ( "target-libdir" ) ,
356+ )
357+ } ;
358+ let initial_lld =
359+ Path :: new ( & initial_target_libdir) . parent ( ) . unwrap ( ) . join ( "bin" ) . join ( "rust-lld" ) ;
354360
355361 let mut build = Build {
356362 initial_rustc : config. initial_rustc . clone ( ) ,
You can’t perform that action at this time.
0 commit comments