File tree 1 file changed +9
-1
lines changed
compiler/rustc_codegen_ssa/src/back
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1087,7 +1087,8 @@ fn link_natively(
1087
1087
let strip = sess. opts . cg . strip ;
1088
1088
1089
1089
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" ;
1091
1092
match ( strip, crate_type) {
1092
1093
( Strip :: Debuginfo , _) => {
1093
1094
strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( "-S" ) )
@@ -1147,6 +1148,13 @@ fn strip_symbols_with_external_utility(
1147
1148
if let Some ( option) = option {
1148
1149
cmd. arg ( option) ;
1149
1150
}
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
+
1150
1158
let prog = cmd. arg ( out_filename) . output ( ) ;
1151
1159
match prog {
1152
1160
Ok ( prog) => {
You can’t perform that action at this time.
0 commit comments