File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
compiler/rustc_codegen_ssa/src/back Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1087,7 +1087,8 @@ fn link_natively(
10871087 let strip = sess. opts . cg . strip ;
10881088
10891089 if sess. target . is_like_osx {
1090- let stripcmd = "/usr/bin/strip" ;
1090+ // `llvm-strip` is a symlink to `llvm-objcopy`, so use that (shipped with toolchain)
1091+ let stripcmd = "rust-objcopy" ;
10911092 match ( strip, crate_type) {
10921093 ( Strip :: Debuginfo , _) => {
10931094 strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( "-S" ) )
@@ -1147,6 +1148,13 @@ fn strip_symbols_with_external_utility(
11471148 if let Some ( option) = option {
11481149 cmd. arg ( option) ;
11491150 }
1151+
1152+ let mut new_path = sess. get_tools_search_paths ( false ) ;
1153+ if let Some ( path) = env:: var_os ( "PATH" ) {
1154+ new_path. extend ( env:: split_paths ( & path) ) ;
1155+ }
1156+ cmd. env ( "PATH" , env:: join_paths ( new_path) . unwrap ( ) ) ;
1157+
11501158 let prog = cmd. arg ( out_filename) . output ( ) ;
11511159 match prog {
11521160 Ok ( prog) => {
You can’t perform that action at this time.
0 commit comments