@@ -131,7 +131,7 @@ pub fn opts(os: &'static str, arch: Arch) -> TargetOptions {
131
131
abi : abi. into ( ) ,
132
132
os : os. into ( ) ,
133
133
cpu : arch. target_cpu ( ) . into ( ) ,
134
- link_env_remove : link_env_remove ( arch , os) ,
134
+ link_env_remove : link_env_remove ( os) ,
135
135
vendor : "apple" . into ( ) ,
136
136
linker_flavor : LinkerFlavor :: Darwin ( Cc :: Yes , Lld :: No ) ,
137
137
// macOS has -dead_strip, which doesn't rely on function_sections
@@ -270,7 +270,7 @@ pub fn macos_llvm_target(arch: Arch) -> String {
270
270
format ! ( "{}-apple-macosx{}.{}.0" , arch. target_name( ) , major, minor)
271
271
}
272
272
273
- fn link_env_remove ( arch : Arch , os : & ' static str ) -> StaticCow < [ StaticCow < str > ] > {
273
+ fn link_env_remove ( os : & ' static str ) -> StaticCow < [ StaticCow < str > ] > {
274
274
// Apple platforms only officially support macOS as a host for any compilation.
275
275
//
276
276
// If building for macOS, we go ahead and remove any erroneous environment state
@@ -298,15 +298,9 @@ fn link_env_remove(arch: Arch, os: &'static str) -> StaticCow<[StaticCow<str>]>
298
298
env_remove. push ( "TVOS_DEPLOYMENT_TARGET" . into ( ) ) ;
299
299
env_remove. into ( )
300
300
} else {
301
- // Otherwise if cross-compiling for a different OS/SDK, remove any part
301
+ // Otherwise if cross-compiling for a different OS/SDK (including Mac Catalyst) , remove any part
302
302
// of the linking environment that's wrong and reversed.
303
- match arch {
304
- Armv7k | Armv7s | Arm64 | Arm64e | Arm64_32 | I386 | I386_sim | I686 | X86_64
305
- | X86_64_sim | X86_64h | Arm64_sim => {
306
- cvs ! [ "MACOSX_DEPLOYMENT_TARGET" ]
307
- }
308
- X86_64_macabi | Arm64_macabi => cvs ! [ "IPHONEOS_DEPLOYMENT_TARGET" ] ,
309
- }
303
+ cvs ! [ "MACOSX_DEPLOYMENT_TARGET" ]
310
304
}
311
305
}
312
306
0 commit comments