@@ -48,9 +48,6 @@ pub struct TargetInfo {
4848 support_split_debuginfo : Vec < String > ,
4949 /// Path to the sysroot.
5050 pub sysroot : PathBuf ,
51- /// Path to the "lib" or "bin" directory that rustc uses for its dynamic
52- /// libraries.
53- pub sysroot_host_libdir : PathBuf ,
5451 /// Path to the "lib" directory in the sysroot which rustc uses for linking
5552 /// target libraries.
5653 pub sysroot_target_libdir : PathBuf ,
@@ -224,19 +221,17 @@ impl TargetInfo {
224221 return error_missing_print_output ( "sysroot" , & process, & output, & error) ;
225222 } ;
226223 let sysroot = PathBuf :: from ( line) ;
227- let sysroot_host_libdir = if cfg ! ( windows) {
228- sysroot. join ( "bin" )
229- } else {
230- sysroot. join ( "lib" )
224+ let sysroot_target_libdir = {
225+ let mut libdir = sysroot. clone ( ) ;
226+ libdir. push ( "lib" ) ;
227+ libdir. push ( "rustlib" ) ;
228+ libdir. push ( match & kind {
229+ CompileKind :: Host => rustc. host . as_str ( ) ,
230+ CompileKind :: Target ( target) => target. short_name ( ) ,
231+ } ) ;
232+ libdir. push ( "lib" ) ;
233+ libdir
231234 } ;
232- let mut sysroot_target_libdir = sysroot. clone ( ) ;
233- sysroot_target_libdir. push ( "lib" ) ;
234- sysroot_target_libdir. push ( "rustlib" ) ;
235- sysroot_target_libdir. push ( match & kind {
236- CompileKind :: Host => rustc. host . as_str ( ) ,
237- CompileKind :: Target ( target) => target. short_name ( ) ,
238- } ) ;
239- sysroot_target_libdir. push ( "lib" ) ;
240235
241236 let support_split_debuginfo = {
242237 // HACK: abuse `--print=crate-name` to use `___` as a delimiter.
@@ -303,7 +298,6 @@ impl TargetInfo {
303298 crate_type_process,
304299 crate_types : RefCell :: new ( map) ,
305300 sysroot,
306- sysroot_host_libdir,
307301 sysroot_target_libdir,
308302 rustflags,
309303 rustdocflags : extra_args (
0 commit comments