@@ -11,7 +11,6 @@ use Arch::*;
11
11
#[ allow( non_camel_case_types) ]
12
12
#[ derive( Copy , Clone ) ]
13
13
pub enum Arch {
14
- Armv7 ,
15
14
Armv7k ,
16
15
Armv7s ,
17
16
Arm64 ,
@@ -29,7 +28,6 @@ pub enum Arch {
29
28
impl Arch {
30
29
pub fn target_name ( self ) -> & ' static str {
31
30
match self {
32
- Armv7 => "armv7" ,
33
31
Armv7k => "armv7k" ,
34
32
Armv7s => "armv7s" ,
35
33
Arm64 | Arm64_macabi | Arm64_sim => "arm64" ,
@@ -43,7 +41,7 @@ impl Arch {
43
41
44
42
pub fn target_arch ( self ) -> Cow < ' static , str > {
45
43
Cow :: Borrowed ( match self {
46
- Armv7 | Armv7k | Armv7s => "arm" ,
44
+ Armv7k | Armv7s => "arm" ,
47
45
Arm64 | Arm64_32 | Arm64_macabi | Arm64_sim => "aarch64" ,
48
46
I386 | I686 => "x86" ,
49
47
X86_64 | X86_64_sim | X86_64_macabi | X86_64h => "x86_64" ,
@@ -52,7 +50,7 @@ impl Arch {
52
50
53
51
fn target_abi ( self ) -> & ' static str {
54
52
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 => "" ,
56
54
X86_64_macabi | Arm64_macabi => "macabi" ,
57
55
// x86_64-apple-ios is a simulator target, even though it isn't
58
56
// declared that way in the target like the other ones...
@@ -62,9 +60,8 @@ impl Arch {
62
60
63
61
fn target_cpu ( self ) -> & ' static str {
64
62
match self {
65
- Armv7 => "cortex-a8" , // iOS7 is supported on iPhone 4 and higher
66
63
Armv7k => "cortex-a8" ,
67
- Armv7s => "cortex-a9" ,
64
+ Armv7s => "swift" , // iOS 10 is only supported on iPhone 5 or higher.
68
65
Arm64 => "apple-a7" ,
69
66
Arm64_32 => "apple-s4" ,
70
67
// 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 {
118
115
}
119
116
120
117
pub fn opts ( os : & ' static str , arch : Arch ) -> TargetOptions {
121
- // TODO: iOS 10+ always has TLS too.
122
- let has_thread_local = os == "macos" ;
123
-
124
118
let abi = arch. target_abi ( ) ;
125
119
126
120
TargetOptions {
@@ -136,12 +130,17 @@ pub fn opts(os: &'static str, arch: Arch) -> TargetOptions {
136
130
pre_link_args : pre_link_args ( os, arch, abi) ,
137
131
families : cvs ! [ "unix" ] ,
138
132
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 ,
140
137
frame_pointer : FramePointer :: Always ,
141
138
has_rpath : true ,
142
139
dll_suffix : ".dylib" . into ( ) ,
143
140
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 ,
145
144
abi_return_struct_as_int : true ,
146
145
emit_debug_gdb_scripts : false ,
147
146
eh_frame_header : false ,
@@ -281,8 +280,8 @@ fn link_env_remove(arch: Arch, os: &'static str) -> StaticCow<[StaticCow<str>]>
281
280
// Otherwise if cross-compiling for a different OS/SDK, remove any part
282
281
// of the linking environment that's wrong and reversed.
283
282
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 => {
286
285
cvs ! [ "MACOSX_DEPLOYMENT_TARGET" ]
287
286
}
288
287
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>]>
292
291
293
292
fn ios_deployment_target ( ) -> ( u32 , u32 ) {
294
293
// 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 ) )
296
295
}
297
296
298
297
fn mac_catalyst_deployment_target ( ) -> ( u32 , u32 ) {
0 commit comments