diff options
| author | Mads Marquart <mads@marquart.dk> | 2024-08-21 18:21:39 +0200 |
|---|---|---|
| committer | Mads Marquart <mads@marquart.dk> | 2024-09-09 13:55:14 +0200 |
| commit | 97df8fb7ecce4ff77d1da199742a822dfddeac2f (patch) | |
| tree | 5e55808f7dadbbcabde0886c1c54eecb3b833011 /compiler/rustc_target/src | |
| parent | 1f44f0a66fa0892ca680a26e271d22993d53de5c (diff) | |
| download | rust-97df8fb7ecce4ff77d1da199742a822dfddeac2f.tar.gz rust-97df8fb7ecce4ff77d1da199742a822dfddeac2f.zip | |
Fix default/minimum deployment target for Aarch64 simulator targets
The minimum that `rustc` encoded did not match the version in Clang, and that meant that that when linking, we ended up bumping the version. Specifically, this sets the correct deployment target of the following simulator and Mac Catalyst targets: - `aarch64-apple-ios-sim` from 10.0 to 14.0 - `aarch64-apple-tvos-sim` from 10.0 to 14.0 - `aarch64-apple-watchos-sim` from 5.0 to 7.0 - `aarch64-apple-ios-macabi` from 13.1 to 14.0 I have chosen to not document the simulator target versions in the platform support docs, as it is fundamentally uninteresting; the normal targets (e.g. `aarch64-apple-ios`, `aarch64-apple-tvos`) still have the same deployment target as before, and that's what developers should actually target.
Diffstat (limited to 'compiler/rustc_target/src')
| -rw-r--r-- | compiler/rustc_target/src/spec/base/apple/mod.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/rustc_target/src/spec/base/apple/mod.rs b/compiler/rustc_target/src/spec/base/apple/mod.rs index b1fe49f76ca..5da47322b92 100644 --- a/compiler/rustc_target/src/spec/base/apple/mod.rs +++ b/compiler/rustc_target/src/spec/base/apple/mod.rs @@ -323,12 +323,18 @@ fn deployment_target(os: &str, arch: Arch, abi: TargetAbi) -> (u16, u8, u8) { }; // On certain targets it makes sense to raise the minimum OS version. + // + // This matches what LLVM does, see: + // <https://github.com/llvm/llvm-project/blob/llvmorg-18.1.8/llvm/lib/TargetParser/Triple.cpp#L1900-L1932> let min = match (os, arch, abi) { - // Use 11.0 on Aarch64 as that's the earliest version with M1 support. ("macos", Arch::Arm64 | Arch::Arm64e, _) => (11, 0, 0), - ("ios", Arch::Arm64e, _) => (14, 0, 0), + ("ios", Arch::Arm64 | Arch::Arm64e, TargetAbi::MacCatalyst) => (14, 0, 0), + ("ios", Arch::Arm64 | Arch::Arm64e, TargetAbi::Simulator) => (14, 0, 0), + ("ios", Arch::Arm64e, TargetAbi::Normal) => (14, 0, 0), // Mac Catalyst defaults to 13.1 in Clang. ("ios", _, TargetAbi::MacCatalyst) => (13, 1, 0), + ("tvos", Arch::Arm64 | Arch::Arm64e, TargetAbi::Simulator) => (14, 0, 0), + ("watchos", Arch::Arm64 | Arch::Arm64e, TargetAbi::Simulator) => (7, 0, 0), _ => os_min, }; |
