@@ -3200,9 +3200,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo
3200
3200
}
3201
3201
3202
3202
fn add_apple_sdk ( cmd : & mut dyn Linker , sess : & Session , flavor : LinkerFlavor ) -> Option < PathBuf > {
3203
- let arch = & sess. target . arch ;
3204
3203
let os = & sess. target . os ;
3205
- let llvm_target = & sess. target . llvm_target ;
3206
3204
if sess. target . vendor != "apple"
3207
3205
|| !matches ! ( os. as_ref( ) , "ios" | "tvos" | "watchos" | "visionos" | "macos" )
3208
3206
|| !matches ! ( flavor, LinkerFlavor :: Darwin ( ..) )
@@ -3214,30 +3212,8 @@ fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) ->
3214
3212
return None ;
3215
3213
}
3216
3214
3217
- let sdk_name = match ( arch. as_ref ( ) , os. as_ref ( ) ) {
3218
- ( "aarch64" , "tvos" ) if llvm_target. ends_with ( "-simulator" ) => "appletvsimulator" ,
3219
- ( "aarch64" , "tvos" ) => "appletvos" ,
3220
- ( "x86_64" , "tvos" ) => "appletvsimulator" ,
3221
- ( "arm" , "ios" ) => "iphoneos" ,
3222
- ( "aarch64" , "ios" ) if llvm_target. contains ( "macabi" ) => "macosx" ,
3223
- ( "aarch64" , "ios" ) if llvm_target. ends_with ( "-simulator" ) => "iphonesimulator" ,
3224
- ( "aarch64" , "ios" ) => "iphoneos" ,
3225
- ( "x86" , "ios" ) => "iphonesimulator" ,
3226
- ( "x86_64" , "ios" ) if llvm_target. contains ( "macabi" ) => "macosx" ,
3227
- ( "x86_64" , "ios" ) => "iphonesimulator" ,
3228
- ( "x86_64" , "watchos" ) => "watchsimulator" ,
3229
- ( "arm64_32" , "watchos" ) => "watchos" ,
3230
- ( "aarch64" , "watchos" ) if llvm_target. ends_with ( "-simulator" ) => "watchsimulator" ,
3231
- ( "aarch64" , "watchos" ) => "watchos" ,
3232
- ( "aarch64" , "visionos" ) if llvm_target. ends_with ( "-simulator" ) => "xrsimulator" ,
3233
- ( "aarch64" , "visionos" ) => "xros" ,
3234
- ( "arm" , "watchos" ) => "watchos" ,
3235
- ( _, "macos" ) => "macosx" ,
3236
- _ => {
3237
- sess. dcx ( ) . emit_err ( errors:: UnsupportedArch { arch, os } ) ;
3238
- return None ;
3239
- }
3240
- } ;
3215
+ let sdk_name = apple:: sdk_name ( & sess. target ) ;
3216
+
3241
3217
let sdk_root = match get_apple_sdk_root ( sdk_name) {
3242
3218
Ok ( s) => s,
3243
3219
Err ( e) => {
0 commit comments