Use safer strip=symbols
-flag for dylibs on macOS
This commit is contained in:
parent
7092d42c04
commit
8558b35295
1 changed files with 8 additions and 4 deletions
|
@ -1003,10 +1003,14 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
|
|||
let strip = strip_value(sess);
|
||||
|
||||
if sess.target.is_like_osx {
|
||||
match strip {
|
||||
Strip::Debuginfo => strip_symbols_in_osx(sess, &out_filename, Some("-S")),
|
||||
Strip::Symbols => strip_symbols_in_osx(sess, &out_filename, None),
|
||||
Strip::None => {}
|
||||
match (strip, crate_type) {
|
||||
(Strip::Debuginfo, _) => strip_symbols_in_osx(sess, &out_filename, Some("-S")),
|
||||
// Per the manpage, `-x` is the maximum safe strip level for dynamic libraries. (#93988)
|
||||
(Strip::Symbols, CrateType::Dylib | CrateType::Cdylib | CrateType::ProcMacro) => {
|
||||
strip_symbols_in_osx(sess, &out_filename, Some("-x"))
|
||||
}
|
||||
(Strip::Symbols, _) => strip_symbols_in_osx(sess, &out_filename, None),
|
||||
(Strip::None, _) => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue