Skip to content

Commit fdaeb0f

Browse files
authored
Rollup merge of #73138 - eggyal:macos-linker-strip, r=petrochenkov
Use shorthand linker strip arguments in order to support MacOS Per discussion from #72110 (comment) onward, the current `-Z strip` options aren't supported by the MacOS linker, but I think only because it doesn't support the longhand arguments `--strip-debug` and `--strip-all`. This PR switches to using the shorthand arguments `-s` and `-S` instead, which (I believe) are supported by all GCC linkers.
2 parents 31a1858 + 8cf85bc commit fdaeb0f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/librustc_codegen_ssa/back/linker.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,12 @@ impl<'a> Linker for GccLinker<'a> {
481481
match strip {
482482
Strip::None => {}
483483
Strip::Debuginfo => {
484-
self.linker_arg("--strip-debug");
484+
// MacOS linker does not support longhand argument --strip-debug
485+
self.linker_arg("-S");
485486
}
486487
Strip::Symbols => {
487-
self.linker_arg("--strip-all");
488+
// MacOS linker does not support longhand argument --strip-all
489+
self.linker_arg("-s");
488490
}
489491
}
490492
}

0 commit comments

Comments
 (0)