@@ -1107,11 +1107,13 @@ 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
+ let strip_options = vec ! [ "-S" . to_string( ) ] ;
1111
+ strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( & strip_options) )
1111
1112
}
1112
1113
// Per the manpage, `-x` is the maximum safe strip level for dynamic libraries. (#93988)
1113
1114
( Strip :: Symbols , CrateType :: Dylib | CrateType :: Cdylib | CrateType :: ProcMacro ) => {
1114
- strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( "-x" ) )
1115
+ let strip_options = vec ! [ "-x" . to_string( ) ] ;
1116
+ strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( & strip_options) )
1115
1117
}
1116
1118
( Strip :: Symbols , _) => {
1117
1119
strip_symbols_with_external_utility ( sess, stripcmd, out_filename, None )
@@ -1131,7 +1133,8 @@ fn link_natively(
1131
1133
match strip {
1132
1134
// Always preserve the symbol table (-x).
1133
1135
Strip :: Debuginfo => {
1134
- strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( "-x" ) )
1136
+ let strip_options = vec ! [ "-x" . to_string( ) ] ;
1137
+ strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( & strip_options) )
1135
1138
}
1136
1139
// Strip::Symbols is handled via the --strip-all linker option.
1137
1140
Strip :: Symbols => { }
@@ -1145,14 +1148,17 @@ fn link_natively(
1145
1148
sess. dcx ( ) . emit_warn ( errors:: AixStripNotUsed ) ;
1146
1149
}
1147
1150
let stripcmd = "/usr/bin/strip" ;
1151
+ let mut strip_options = vec ! [ "-X32_64" . to_string( ) ] ;
1148
1152
match strip {
1149
1153
Strip :: Debuginfo => {
1150
1154
// 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" ) )
1155
+ strip_options. push ( "-l" . to_string ( ) ) ;
1156
+ strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( & strip_options) )
1152
1157
}
1153
1158
Strip :: Symbols => {
1154
1159
// 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" ) )
1160
+ strip_options. push ( "-r" . to_string ( ) ) ;
1161
+ strip_symbols_with_external_utility ( sess, stripcmd, out_filename, Some ( & strip_options) )
1156
1162
}
1157
1163
Strip :: None => { }
1158
1164
}
@@ -1165,11 +1171,13 @@ fn strip_symbols_with_external_utility(
1165
1171
sess : & Session ,
1166
1172
util : & str ,
1167
1173
out_filename : & Path ,
1168
- option : Option < & str > ,
1174
+ options : Option < & [ String ] > ,
1169
1175
) {
1170
1176
let mut cmd = Command :: new ( util) ;
1171
- if let Some ( option) = option {
1172
- cmd. arg ( option) ;
1177
+ if let Some ( opts) = options {
1178
+ for option in opts {
1179
+ cmd. arg ( option) ;
1180
+ }
1173
1181
}
1174
1182
1175
1183
let mut new_path = sess. get_tools_search_paths ( false ) ;
0 commit comments