File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
src/bootstrap/src/core/build_steps Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1965,6 +1965,16 @@ impl Step for Assemble {
19651965 }
19661966 }
19671967
1968+ {
1969+ // `llvm-strip` is used by rustc, which is actually just a symlink to `llvm-objcopy`,
1970+ // so copy and rename `llvm-objcopy` and create link for `rust-strip`
1971+ let src_exe = exe ( "llvm-objcopy" , target_compiler. host ) ;
1972+ let dst_exe = exe ( "rust-objcopy" , target_compiler. host ) ;
1973+ builder. copy_link ( & libdir_bin. join ( src_exe) , & libdir_bin. join ( dst_exe) ) ;
1974+ let dst_exe = exe ( "rust-strip" , target_compiler. host ) ;
1975+ t ! ( builder. symlink_file( "rust-objcopy" , & libdir_bin. join( dst_exe) ) ) ;
1976+ }
1977+
19681978 // In addition to `rust-lld` also install `wasm-component-ld` when
19691979 // LLD is enabled. This is a relatively small binary that primarily
19701980 // delegates to the `rust-lld` binary for linking and then runs
Original file line number Diff line number Diff line change @@ -473,6 +473,14 @@ impl Step for Rustc {
473473 ) ;
474474 }
475475 }
476+
477+ {
478+ let src_dir = builder. sysroot_libdir ( compiler, host) . parent ( ) . unwrap ( ) . join ( "bin" ) ;
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+
476484 if builder. tool_enabled ( "wasm-component-ld" ) {
477485 let src_dir = builder. sysroot_libdir ( compiler, host) . parent ( ) . unwrap ( ) . join ( "bin" ) ;
478486 let ld = exe ( "wasm-component-ld" , compiler. host ) ;
You can’t perform that action at this time.
0 commit comments