@@ -181,9 +181,12 @@ impl Build {
181
181
"x86_64-unknown-netbsd" => "BSD-x86_64" ,
182
182
"wasm32-unknown-emscripten" => "gcc" ,
183
183
"wasm32-unknown-unknown" => "gcc" ,
184
+ "aarch64-apple-ios" => "ios64-cross" ,
184
185
_ => panic ! ( "don't know how to configure OpenSSL for {}" , target) ,
185
186
} ;
186
187
188
+ let mut ios_isysroot: std:: option:: Option < String > = None ;
189
+
187
190
configure. arg ( os) ;
188
191
189
192
// If we're not on MSVC we configure cross compilers and cross tools and
@@ -210,12 +213,39 @@ impl Build {
210
213
211
214
// Make sure we pass extra flags like `-ffunction-sections` and
212
215
// other things like ARM codegen flags.
216
+ let mut skip_next = false ;
217
+ let mut is_isysroot = false ;
213
218
for arg in compiler. args ( ) {
214
219
// For whatever reason `-static` on MUSL seems to cause
215
220
// issues...
216
221
if target. contains ( "musl" ) && arg == "-static" {
217
222
continue
218
223
}
224
+
225
+ // cargo-lipo specifies this but OpenSSL complains
226
+ if target. contains ( "apple-ios" ) {
227
+ if arg == "-arch" {
228
+ skip_next = true ;
229
+ continue
230
+ }
231
+
232
+ if arg == "-isysroot" {
233
+ is_isysroot = true ;
234
+ continue
235
+ }
236
+
237
+ if is_isysroot {
238
+ is_isysroot = false ;
239
+ ios_isysroot = Some ( arg. to_str ( ) . unwrap ( ) . to_string ( ) ) ;
240
+ continue
241
+ }
242
+ }
243
+
244
+ if skip_next {
245
+ skip_next = false ;
246
+ continue
247
+ }
248
+
219
249
configure. arg ( arg) ;
220
250
}
221
251
@@ -290,6 +320,13 @@ impl Build {
290
320
build. env ( "MAKEFLAGS" , s) ;
291
321
}
292
322
}
323
+
324
+ if let Some ( ref isysr) = ios_isysroot {
325
+ let components: Vec < & str > = isysr. split ( "/SDKs/" ) . collect ( ) ;
326
+ build. env ( "CROSS_TOP" , components[ 0 ] ) ;
327
+ build. env ( "CROSS_SDK" , components[ 1 ] ) ;
328
+ }
329
+
293
330
self . run_command ( build, "building OpenSSL" ) ;
294
331
295
332
let mut install = self . cmd_make ( ) ;
0 commit comments