Rollup merge of #73138 - eggyal:macos-linker-strip, r=petrochenkov

Use shorthand linker strip arguments in order to support MacOS

Per discussion from https://github.com/rust-lang/rust/issues/72110#issuecomment-636609419 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.
This commit is contained in:
Dylan DPC 2020-06-08 22:15:19 +02:00 committed by GitHub
commit fdaeb0ff12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -481,10 +481,12 @@ impl<'a> Linker for GccLinker<'a> {
match strip {
Strip::None => {}
Strip::Debuginfo => {
self.linker_arg("--strip-debug");
// MacOS linker does not support longhand argument --strip-debug
self.linker_arg("-S");
}
Strip::Symbols => {
self.linker_arg("--strip-all");
// MacOS linker does not support longhand argument --strip-all
self.linker_arg("-s");
}
}
}