1
Fork 0

Raise minimum supported iOS version to 10.0

Drop the armv7-apple-ios target too because its no longer supported
with the hardware iOS 10 requires.
This commit is contained in:
BlackHoleFox 2022-11-13 17:23:26 -06:00
parent 58bbca958d
commit 3b52befdce
8 changed files with 17 additions and 49 deletions

View file

@ -11,7 +11,6 @@ use Arch::*;
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub enum Arch { pub enum Arch {
Armv7,
Armv7k, Armv7k,
Armv7s, Armv7s,
Arm64, Arm64,
@ -29,7 +28,6 @@ pub enum Arch {
impl Arch { impl Arch {
pub fn target_name(self) -> &'static str { pub fn target_name(self) -> &'static str {
match self { match self {
Armv7 => "armv7",
Armv7k => "armv7k", Armv7k => "armv7k",
Armv7s => "armv7s", Armv7s => "armv7s",
Arm64 | Arm64_macabi | Arm64_sim => "arm64", Arm64 | Arm64_macabi | Arm64_sim => "arm64",
@ -43,7 +41,7 @@ impl Arch {
pub fn target_arch(self) -> Cow<'static, str> { pub fn target_arch(self) -> Cow<'static, str> {
Cow::Borrowed(match self { Cow::Borrowed(match self {
Armv7 | Armv7k | Armv7s => "arm", Armv7k | Armv7s => "arm",
Arm64 | Arm64_32 | Arm64_macabi | Arm64_sim => "aarch64", Arm64 | Arm64_32 | Arm64_macabi | Arm64_sim => "aarch64",
I386 | I686 => "x86", I386 | I686 => "x86",
X86_64 | X86_64_sim | X86_64_macabi | X86_64h => "x86_64", X86_64 | X86_64_sim | X86_64_macabi | X86_64h => "x86_64",
@ -52,7 +50,7 @@ impl Arch {
fn target_abi(self) -> &'static str { fn target_abi(self) -> &'static str {
match self { match self {
Armv7 | Armv7k | Armv7s | Arm64 | Arm64_32 | I386 | I686 | X86_64 | X86_64h => "", Armv7k | Armv7s | Arm64 | Arm64_32 | I386 | I686 | X86_64 | X86_64h => "",
X86_64_macabi | Arm64_macabi => "macabi", X86_64_macabi | Arm64_macabi => "macabi",
// x86_64-apple-ios is a simulator target, even though it isn't // x86_64-apple-ios is a simulator target, even though it isn't
// declared that way in the target like the other ones... // declared that way in the target like the other ones...
@ -62,9 +60,8 @@ impl Arch {
fn target_cpu(self) -> &'static str { fn target_cpu(self) -> &'static str {
match self { match self {
Armv7 => "cortex-a8", // iOS7 is supported on iPhone 4 and higher
Armv7k => "cortex-a8", Armv7k => "cortex-a8",
Armv7s => "cortex-a9", Armv7s => "swift", // iOS 10 is only supported on iPhone 5 or higher.
Arm64 => "apple-a7", Arm64 => "apple-a7",
Arm64_32 => "apple-s4", Arm64_32 => "apple-s4",
// Only macOS 10.12+ is supported, which means // 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 {
} }
pub fn opts(os: &'static str, arch: Arch) -> TargetOptions { pub fn opts(os: &'static str, arch: Arch) -> TargetOptions {
// TODO: iOS 10+ always has TLS too.
let has_thread_local = os == "macos";
let abi = arch.target_abi(); let abi = arch.target_abi();
TargetOptions { TargetOptions {
@ -136,12 +130,17 @@ pub fn opts(os: &'static str, arch: Arch) -> TargetOptions {
pre_link_args: pre_link_args(os, arch, abi), pre_link_args: pre_link_args(os, arch, abi),
families: cvs!["unix"], families: cvs!["unix"],
is_like_osx: true, is_like_osx: true,
default_dwarf_version: 2, // LLVM notes that macOS 10.11+ and iOS 9+ default
// to v4, so we do the same.
// https://github.com/llvm/llvm-project/blob/378778a0d10c2f8d5df8ceff81f95b6002984a4b/clang/lib/Driver/ToolChains/Darwin.cpp#L1203
default_dwarf_version: 4,
frame_pointer: FramePointer::Always, frame_pointer: FramePointer::Always,
has_rpath: true, has_rpath: true,
dll_suffix: ".dylib".into(), dll_suffix: ".dylib".into(),
archive_format: "darwin".into(), archive_format: "darwin".into(),
has_thread_local, // Thread locals became available with iOS 8 and macOS 10.7,
// and both are far below our minimum.
has_thread_local: true,
abi_return_struct_as_int: true, abi_return_struct_as_int: true,
emit_debug_gdb_scripts: false, emit_debug_gdb_scripts: false,
eh_frame_header: false, eh_frame_header: false,
@ -281,8 +280,8 @@ fn link_env_remove(arch: Arch, os: &'static str) -> StaticCow<[StaticCow<str>]>
// Otherwise if cross-compiling for a different OS/SDK, remove any part // Otherwise if cross-compiling for a different OS/SDK, remove any part
// of the linking environment that's wrong and reversed. // of the linking environment that's wrong and reversed.
match arch { match arch {
Armv7 | Armv7k | Armv7s | Arm64 | Arm64_32 | I386 | I686 | X86_64 | X86_64_sim Armv7k | Armv7s | Arm64 | Arm64_32 | I386 | I686 | X86_64 | X86_64_sim | X86_64h
| X86_64h | Arm64_sim => { | Arm64_sim => {
cvs!["MACOSX_DEPLOYMENT_TARGET"] cvs!["MACOSX_DEPLOYMENT_TARGET"]
} }
X86_64_macabi | Arm64_macabi => cvs!["IPHONEOS_DEPLOYMENT_TARGET"], 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>]>
fn ios_deployment_target() -> (u32, u32) { fn ios_deployment_target() -> (u32, u32) {
// If you are looking for the default deployment target, prefer `rustc --print deployment-target`. // If you are looking for the default deployment target, prefer `rustc --print deployment-target`.
from_set_deployment_target("IPHONEOS_DEPLOYMENT_TARGET").unwrap_or((7, 0)) from_set_deployment_target("IPHONEOS_DEPLOYMENT_TARGET").unwrap_or((10, 0))
} }
fn mac_catalyst_deployment_target() -> (u32, u32) { fn mac_catalyst_deployment_target() -> (u32, u32) {

View file

@ -1,21 +0,0 @@
use super::apple_base::{ios_llvm_target, opts, Arch};
use crate::spec::{Target, TargetOptions};
pub fn target() -> Target {
let arch = Arch::Armv7;
Target {
// Clang automatically chooses a more specific target based on
// IPHONEOS_DEPLOYMENT_TARGET.
// This is required for the target to pick the right
// MACH-O commands, so we do too.
llvm_target: ios_llvm_target(arch).into(),
pointer_width: 32,
data_layout: "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".into(),
arch: arch.target_arch(),
options: TargetOptions {
features: "+v7,+vfp3,+neon".into(),
max_atomic_width: Some(64),
..opts("ios", arch)
},
}
}

View file

@ -1,10 +1,10 @@
use super::apple_base::{opts, Arch}; use super::apple_base::{ios_llvm_target, opts, Arch};
use crate::spec::{Target, TargetOptions}; use crate::spec::{Target, TargetOptions};
pub fn target() -> Target { pub fn target() -> Target {
let arch = Arch::Armv7s; let arch = Arch::Armv7s;
Target { Target {
llvm_target: "armv7s-apple-ios".into(), llvm_target: ios_llvm_target(arch).into(),
pointer_width: 32, pointer_width: 32,
data_layout: "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".into(), data_layout: "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".into(),
arch: arch.target_arch(), arch: arch.target_arch(),

View file

@ -1390,7 +1390,6 @@ supported_targets! {
("i386-apple-ios", i386_apple_ios), ("i386-apple-ios", i386_apple_ios),
("x86_64-apple-ios", x86_64_apple_ios), ("x86_64-apple-ios", x86_64_apple_ios),
("aarch64-apple-ios", aarch64_apple_ios), ("aarch64-apple-ios", aarch64_apple_ios),
("armv7-apple-ios", armv7_apple_ios),
("armv7s-apple-ios", armv7s_apple_ios), ("armv7s-apple-ios", armv7s_apple_ios),
("x86_64-apple-ios-macabi", x86_64_apple_ios_macabi), ("x86_64-apple-ios-macabi", x86_64_apple_ios_macabi),
("aarch64-apple-ios-macabi", aarch64_apple_ios_macabi), ("aarch64-apple-ios-macabi", aarch64_apple_ios_macabi),

View file

@ -48,7 +48,7 @@ pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) {
// workaround below is to register, via _tlv_atexit, a custom DTOR list once per // workaround below is to register, via _tlv_atexit, a custom DTOR list once per
// thread. thread_local dtors are pushed to the DTOR list without calling // thread. thread_local dtors are pushed to the DTOR list without calling
// _tlv_atexit. // _tlv_atexit.
#[cfg(target_os = "macos")] #[cfg(any(target_os = "macos", target_os = "ios", target_os = "watchos"))]
pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) { pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) {
use crate::cell::Cell; use crate::cell::Cell;
use crate::mem; use crate::mem;

View file

@ -703,14 +703,7 @@ fn configure_cmake(
cflags.push(" "); cflags.push(" ");
cflags.push(s); cflags.push(s);
} }
// Some compiler features used by LLVM (such as thread locals) will not work on a min version below iOS 10.
if target.contains("apple-ios") {
if target.contains("86-") {
cflags.push(" -miphonesimulator-version-min=10.0");
} else {
cflags.push(" -miphoneos-version-min=10.0");
}
}
if builder.config.llvm_clang_cl.is_some() { if builder.config.llvm_clang_cl.is_some() {
cflags.push(&format!(" --target={target}")); cflags.push(&format!(" --target={target}"));
} }

View file

@ -244,7 +244,6 @@ target | std | host | notes
`armv6-unknown-freebsd` | ✓ | ✓ | ARMv6 FreeBSD `armv6-unknown-freebsd` | ✓ | ✓ | ARMv6 FreeBSD
[`armv6-unknown-netbsd-eabihf`](platform-support/netbsd.md) | ✓ | ✓ | ARMv6 NetBSD w/hard-float [`armv6-unknown-netbsd-eabihf`](platform-support/netbsd.md) | ✓ | ✓ | ARMv6 NetBSD w/hard-float
[`armv6k-nintendo-3ds`](platform-support/armv6k-nintendo-3ds.md) | ? | | ARMv6K Nintendo 3DS, Horizon (Requires devkitARM toolchain) [`armv6k-nintendo-3ds`](platform-support/armv6k-nintendo-3ds.md) | ? | | ARMv6K Nintendo 3DS, Horizon (Requires devkitARM toolchain)
`armv7-apple-ios` | ✓ | | ARMv7-A Cortex-A8 iOS
[`armv7-sony-vita-newlibeabihf`](platform-support/armv7-sony-vita-newlibeabihf.md) | ? | | ARMv7-A Cortex-A9 Sony PlayStation Vita (requires VITASDK toolchain) [`armv7-sony-vita-newlibeabihf`](platform-support/armv7-sony-vita-newlibeabihf.md) | ? | | ARMv7-A Cortex-A9 Sony PlayStation Vita (requires VITASDK toolchain)
[`armv7-unknown-linux-ohos`](platform-support/openharmony.md) | ✓ | | ARMv7-A OpenHarmony | [`armv7-unknown-linux-ohos`](platform-support/openharmony.md) | ✓ | | ARMv7-A OpenHarmony |
[`armv7-unknown-linux-uclibceabi`](platform-support/armv7-unknown-linux-uclibceabi.md) | ✓ | ✓ | ARMv7-A Linux with uClibc, softfloat [`armv7-unknown-linux-uclibceabi`](platform-support/armv7-unknown-linux-uclibceabi.md) | ✓ | ✓ | ARMv7-A Linux with uClibc, softfloat

View file

@ -69,7 +69,6 @@ static TARGETS: &[&str] = &[
"arm-unknown-linux-musleabihf", "arm-unknown-linux-musleabihf",
"armv5te-unknown-linux-gnueabi", "armv5te-unknown-linux-gnueabi",
"armv5te-unknown-linux-musleabi", "armv5te-unknown-linux-musleabi",
"armv7-apple-ios",
"armv7-linux-androideabi", "armv7-linux-androideabi",
"thumbv7neon-linux-androideabi", "thumbv7neon-linux-androideabi",
"armv7-unknown-linux-gnueabi", "armv7-unknown-linux-gnueabi",