@@ -11,7 +11,6 @@ use Arch::*;
1111#[ allow( non_camel_case_types) ]
1212#[ derive( Copy , Clone ) ]
1313pub enum Arch {
14- Armv7 ,
1514 Armv7k ,
1615 Armv7s ,
1716 Arm64 ,
@@ -29,7 +28,6 @@ pub enum Arch {
2928impl Arch {
3029 pub fn target_name ( self ) -> & ' static str {
3130 match self {
32- Armv7 => "armv7" ,
3331 Armv7k => "armv7k" ,
3432 Armv7s => "armv7s" ,
3533 Arm64 | Arm64_macabi | Arm64_sim => "arm64" ,
@@ -43,7 +41,7 @@ impl Arch {
4341
4442 pub fn target_arch ( self ) -> Cow < ' static , str > {
4543 Cow :: Borrowed ( match self {
46- Armv7 | Armv7k | Armv7s => "arm" ,
44+ Armv7k | Armv7s => "arm" ,
4745 Arm64 | Arm64_32 | Arm64_macabi | Arm64_sim => "aarch64" ,
4846 I386 | I686 => "x86" ,
4947 X86_64 | X86_64_sim | X86_64_macabi | X86_64h => "x86_64" ,
@@ -52,7 +50,7 @@ impl Arch {
5250
5351 fn target_abi ( self ) -> & ' static str {
5452 match self {
55- Armv7 | Armv7k | Armv7s | Arm64 | Arm64_32 | I386 | I686 | X86_64 | X86_64h => "" ,
53+ Armv7k | Armv7s | Arm64 | Arm64_32 | I386 | I686 | X86_64 | X86_64h => "" ,
5654 X86_64_macabi | Arm64_macabi => "macabi" ,
5755 // x86_64-apple-ios is a simulator target, even though it isn't
5856 // declared that way in the target like the other ones...
@@ -62,9 +60,8 @@ impl Arch {
6260
6361 fn target_cpu ( self ) -> & ' static str {
6462 match self {
65- Armv7 => "cortex-a8" , // iOS7 is supported on iPhone 4 and higher
6663 Armv7k => "cortex-a8" ,
67- Armv7s => "cortex-a9" ,
64+ Armv7s => "swift" , // iOS 10 is only supported on iPhone 5 or higher.
6865 Arm64 => "apple-a7" ,
6966 Arm64_32 => "apple-s4" ,
7067 // Only macOS 10.12+ is supported, which means
@@ -118,9 +115,6 @@ fn pre_link_args(os: &'static str, arch: Arch, abi: &'static str) -> LinkArgs {
118115}
119116
120117pub fn opts ( os : & ' static str , arch : Arch ) -> TargetOptions {
121- // TODO: iOS 10+ always has TLS too.
122- let has_thread_local = os == "macos" ;
123-
124118 let abi = arch. target_abi ( ) ;
125119
126120 TargetOptions {
@@ -136,12 +130,17 @@ pub fn opts(os: &'static str, arch: Arch) -> TargetOptions {
136130 pre_link_args : pre_link_args ( os, arch, abi) ,
137131 families : cvs ! [ "unix" ] ,
138132 is_like_osx : true ,
139- default_dwarf_version : 2 ,
133+ // LLVM notes that macOS 10.11+ and iOS 9+ default
134+ // to v4, so we do the same.
135+ // https://github.com/llvm/llvm-project/blob/378778a0d10c2f8d5df8ceff81f95b6002984a4b/clang/lib/Driver/ToolChains/Darwin.cpp#L1203
136+ default_dwarf_version : 4 ,
140137 frame_pointer : FramePointer :: Always ,
141138 has_rpath : true ,
142139 dll_suffix : ".dylib" . into ( ) ,
143140 archive_format : "darwin" . into ( ) ,
144- has_thread_local,
141+ // Thread locals became available with iOS 8 and macOS 10.7,
142+ // and both are far below our minimum.
143+ has_thread_local : true ,
145144 abi_return_struct_as_int : true ,
146145 emit_debug_gdb_scripts : false ,
147146 eh_frame_header : false ,
@@ -281,8 +280,8 @@ fn link_env_remove(arch: Arch, os: &'static str) -> StaticCow<[StaticCow<str>]>
281280 // Otherwise if cross-compiling for a different OS/SDK, remove any part
282281 // of the linking environment that's wrong and reversed.
283282 match arch {
284- Armv7 | Armv7k | Armv7s | Arm64 | Arm64_32 | I386 | I686 | X86_64 | X86_64_sim
285- | X86_64h | Arm64_sim => {
283+ Armv7k | Armv7s | Arm64 | Arm64_32 | I386 | I686 | X86_64 | X86_64_sim | X86_64h
284+ | Arm64_sim => {
286285 cvs ! [ "MACOSX_DEPLOYMENT_TARGET" ]
287286 }
288287 X86_64_macabi | Arm64_macabi => cvs ! [ "IPHONEOS_DEPLOYMENT_TARGET" ] ,
@@ -292,7 +291,7 @@ fn link_env_remove(arch: Arch, os: &'static str) -> StaticCow<[StaticCow<str>]>
292291
293292fn ios_deployment_target ( ) -> ( u32 , u32 ) {
294293 // If you are looking for the default deployment target, prefer `rustc --print deployment-target`.
295- from_set_deployment_target ( "IPHONEOS_DEPLOYMENT_TARGET" ) . unwrap_or ( ( 7 , 0 ) )
294+ from_set_deployment_target ( "IPHONEOS_DEPLOYMENT_TARGET" ) . unwrap_or ( ( 10 , 0 ) )
296295}
297296
298297fn mac_catalyst_deployment_target ( ) -> ( u32 , u32 ) {
0 commit comments