@@ -1011,11 +1011,11 @@ fn link_natively(
10111011 ( Strip :: Debuginfo , _) => {
10121012 strip_with_external_utility ( sess, stripcmd, out_filename, & [ "--strip-debug" ] )
10131013 }
1014- // Per the manpage, `-x` is the maximum safe strip level for dynamic libraries. (#93988)
1014+ // Per the manpage, --discard-all is the maximum safe strip level for dynamic libraries. (#93988)
10151015 (
10161016 Strip :: Symbols ,
10171017 CrateType :: Dylib | CrateType :: Cdylib | CrateType :: ProcMacro | CrateType :: Sdylib ,
1018- ) => strip_with_external_utility ( sess, stripcmd, out_filename, & [ "-x " ] ) ,
1018+ ) => strip_with_external_utility ( sess, stripcmd, out_filename, & [ "--discard-all " ] ) ,
10191019 ( Strip :: Symbols , _) => {
10201020 strip_with_external_utility ( sess, stripcmd, out_filename, & [ "--strip-all" ] )
10211021 }
@@ -1032,8 +1032,10 @@ fn link_natively(
10321032 // `llvm-strip` and hope.
10331033 let stripcmd = if !sess. host . is_like_solaris { "rust-objcopy" } else { "/usr/bin/strip" } ;
10341034 match strip {
1035- // Always preserve the symbol table (-x).
1036- Strip :: Debuginfo => strip_with_external_utility ( sess, stripcmd, out_filename, & [ "-x" ] ) ,
1035+ // Remove most local symbols and debug sections (--discard-all).
1036+ Strip :: Debuginfo => {
1037+ strip_with_external_utility ( sess, stripcmd, out_filename, & [ "--discard-all" ] )
1038+ }
10371039 // Strip::Symbols is handled via the --strip-all linker option.
10381040 Strip :: Symbols => { }
10391041 Strip :: None => { }
0 commit comments