@@ -1107,14 +1107,14 @@ fn link_natively(
1107
1107
let stripcmd = "rust-objcopy" ;
1108
1108
match ( strip, crate_type) {
1109
1109
( Strip :: Debuginfo , _) => {
1110
- strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( "-S" ) )
1110
+ strip_symbols_with_external_utility ( sess, stripcmd, out_filename, & [ "-S" ] )
1111
1111
}
1112
1112
// Per the manpage, `-x` is the maximum safe strip level for dynamic libraries. (#93988)
1113
1113
( Strip :: Symbols , CrateType :: Dylib | CrateType :: Cdylib | CrateType :: ProcMacro ) => {
1114
- strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( "-x" ) )
1114
+ strip_symbols_with_external_utility ( sess, stripcmd, out_filename, & [ "-x" ] )
1115
1115
}
1116
1116
( Strip :: Symbols , _) => {
1117
- strip_symbols_with_external_utility ( sess, stripcmd, out_filename, None )
1117
+ strip_symbols_with_external_utility ( sess, stripcmd, out_filename, & [ "" ] )
1118
1118
}
1119
1119
( Strip :: None , _) => { }
1120
1120
}
@@ -1131,7 +1131,7 @@ fn link_natively(
1131
1131
match strip {
1132
1132
// Always preserve the symbol table (-x).
1133
1133
Strip :: Debuginfo => {
1134
- strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( "-x" ) )
1134
+ strip_symbols_with_external_utility ( sess, stripcmd, out_filename, & [ "-x" ] )
1135
1135
}
1136
1136
// Strip::Symbols is handled via the --strip-all linker option.
1137
1137
Strip :: Symbols => { }
@@ -1148,11 +1148,15 @@ fn link_natively(
1148
1148
match strip {
1149
1149
Strip :: Debuginfo => {
1150
1150
// FIXME: AIX's strip utility only offers option to strip line number information.
1151
- strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( "-l" ) )
1151
+ strip_symbols_with_external_utility ( sess, stripcmd, out_filename, & [
1152
+ "-X32_64" , "-l" ,
1153
+ ] )
1152
1154
}
1153
1155
Strip :: Symbols => {
1154
1156
// Must be noted this option might remove symbol __aix_rust_metadata and thus removes .info section which contains metadata.
1155
- strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( "-r" ) )
1157
+ strip_symbols_with_external_utility ( sess, stripcmd, out_filename, & [
1158
+ "-X32_64" , "-r" ,
1159
+ ] )
1156
1160
}
1157
1161
Strip :: None => { }
1158
1162
}
@@ -1165,12 +1169,10 @@ fn strip_symbols_with_external_utility(
1165
1169
sess : & Session ,
1166
1170
util : & str ,
1167
1171
out_filename : & Path ,
1168
- option : Option < & str > ,
1172
+ options : & [ & str ] ,
1169
1173
) {
1170
1174
let mut cmd = Command :: new ( util) ;
1171
- if let Some ( option) = option {
1172
- cmd. arg ( option) ;
1173
- }
1175
+ cmd. args ( options) ;
1174
1176
1175
1177
let mut new_path = sess. get_tools_search_paths ( false ) ;
1176
1178
if let Some ( path) = env:: var_os ( "PATH" ) {
0 commit comments