File tree 3 files changed +24
-4
lines changed
3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -235,8 +235,7 @@ impl Step for Std {
235
235
. join ( compiler. host )
236
236
. join ( "bin" ) ;
237
237
if src_sysroot_bin. exists ( ) {
238
- let target_sysroot_bin =
239
- builder. sysroot_libdir ( compiler, target) . parent ( ) . unwrap ( ) . join ( "bin" ) ;
238
+ let target_sysroot_bin = builder. sysroot_bindir ( compiler, target) ;
240
239
t ! ( fs:: create_dir_all( & target_sysroot_bin) ) ;
241
240
builder. cp_link_r ( & src_sysroot_bin, & target_sysroot_bin) ;
242
241
}
@@ -1976,6 +1975,14 @@ impl Step for Assemble {
1976
1975
}
1977
1976
}
1978
1977
1978
+ {
1979
+ // `llvm-strip` is used by rustc, which is actually just a symlink to `llvm-objcopy`,
1980
+ // so copy and rename `llvm-objcopy`.
1981
+ let src_exe = exe ( "llvm-objcopy" , target_compiler. host ) ;
1982
+ let dst_exe = exe ( "rust-objcopy" , target_compiler. host ) ;
1983
+ builder. copy_link ( & libdir_bin. join ( src_exe) , & libdir_bin. join ( dst_exe) ) ;
1984
+ }
1985
+
1979
1986
// In addition to `rust-lld` also install `wasm-component-ld` when
1980
1987
// LLD is enabled. This is a relatively small binary that primarily
1981
1988
// delegates to the `rust-lld` binary for linking and then runs
Original file line number Diff line number Diff line change @@ -459,7 +459,7 @@ impl Step for Rustc {
459
459
460
460
// Copy over lld if it's there
461
461
if builder. config . lld_enabled {
462
- let src_dir = builder. sysroot_libdir ( compiler, host) . parent ( ) . unwrap ( ) . join ( "bin" ) ;
462
+ let src_dir = builder. sysroot_bindir ( compiler, host) ;
463
463
let rust_lld = exe ( "rust-lld" , compiler. host ) ;
464
464
builder. copy_link ( & src_dir. join ( & rust_lld) , & dst_dir. join ( & rust_lld) ) ;
465
465
let self_contained_lld_src_dir = src_dir. join ( "gcc-ld" ) ;
@@ -473,8 +473,16 @@ impl Step for Rustc {
473
473
) ;
474
474
}
475
475
}
476
+
477
+ {
478
+ let src_dir = builder. sysroot_bindir ( compiler, host) ;
479
+ let llvm_objcopy = exe ( "llvm-objcopy" , compiler. host ) ;
480
+ let rust_objcopy = exe ( "rust-objcopy" , compiler. host ) ;
481
+ builder. copy_link ( & src_dir. join ( & llvm_objcopy) , & dst_dir. join ( & rust_objcopy) ) ;
482
+ }
483
+
476
484
if builder. tool_enabled ( "wasm-component-ld" ) {
477
- let src_dir = builder. sysroot_libdir ( compiler, host) . parent ( ) . unwrap ( ) . join ( "bin" ) ;
485
+ let src_dir = builder. sysroot_bindir ( compiler, host) ;
478
486
let ld = exe ( "wasm-component-ld" , compiler. host ) ;
479
487
builder. copy_link ( & src_dir. join ( & ld) , & dst_dir. join ( & ld) ) ;
480
488
}
Original file line number Diff line number Diff line change @@ -1161,6 +1161,11 @@ impl<'a> Builder<'a> {
1161
1161
self . ensure ( compile:: Sysroot :: new ( compiler) )
1162
1162
}
1163
1163
1164
+ /// Returns the bindir for a compiler's sysroot.
1165
+ pub fn sysroot_bindir ( & self , compiler : Compiler , target : TargetSelection ) -> PathBuf {
1166
+ self . sysroot_libdir ( compiler, target) . parent ( ) . unwrap ( ) . join ( "bin" )
1167
+ }
1168
+
1164
1169
/// Returns the libdir where the standard library and other artifacts are
1165
1170
/// found for a compiler's sysroot.
1166
1171
pub fn sysroot_libdir ( & self , compiler : Compiler , target : TargetSelection ) -> PathBuf {
You can’t perform that action at this time.
0 commit comments