about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMads Marquart <mads@marquart.dk>2024-08-21 18:21:39 +0200
committerMads Marquart <mads@marquart.dk>2024-09-09 13:55:14 +0200
commit97df8fb7ecce4ff77d1da199742a822dfddeac2f (patch)
tree5e55808f7dadbbcabde0886c1c54eecb3b833011 /tests
parent1f44f0a66fa0892ca680a26e271d22993d53de5c (diff)
downloadrust-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 'tests')
-rw-r--r--tests/run-make/apple-deployment-target/rmake.rs28
1 files changed, 16 insertions, 12 deletions
diff --git a/tests/run-make/apple-deployment-target/rmake.rs b/tests/run-make/apple-deployment-target/rmake.rs
index b2d1af65177..230f33a8d78 100644
--- a/tests/run-make/apple-deployment-target/rmake.rs
+++ b/tests/run-make/apple-deployment-target/rmake.rs
@@ -55,11 +55,8 @@ fn main() {
         rustc().env(env_var, example_version).run();
         minos("foo.o", example_version);
 
-        // FIXME(madsmtm): Doesn't work on Mac Catalyst and the simulator.
-        if !target().contains("macabi") && !target().contains("sim") {
-            rustc().env_remove(env_var).run();
-            minos("foo.o", default_version);
-        }
+        rustc().env_remove(env_var).run();
+        minos("foo.o", default_version);
     });
 
     // Test that version makes it to the linker when linking dylibs.
@@ -105,8 +102,18 @@ fn main() {
             rustc
         };
 
-        // FIXME(madsmtm): Doesn't work on watchOS for some reason?
-        if !target().contains("watchos") {
+        // FIXME(madsmtm): Xcode's version of Clang seems to require a minimum
+        // version of 9.0 on aarch64-apple-watchos for some reason? Which is
+        // odd, because the first Aarch64 watch was Apple Watch Series 4,
+        // which runs on as low as watchOS 5.0.
+        //
+        // You can see Clang's behaviour by running:
+        // ```
+        // echo "int main() { return 0; }" > main.c
+        // xcrun --sdk watchos clang --target=aarch64-apple-watchos main.c
+        // vtool -show a.out
+        // ```
+        if target() != "aarch64-apple-watchos" {
             rustc().env(env_var, example_version).run();
             minos("foo", example_version);
 
@@ -148,10 +155,7 @@ fn main() {
         rustc().env(env_var, higher_example_version).run();
         minos("foo.o", higher_example_version);
 
-        // FIXME(madsmtm): Doesn't work on Mac Catalyst and the simulator.
-        if !target().contains("macabi") && !target().contains("sim") {
-            rustc().env_remove(env_var).run();
-            minos("foo.o", default_version);
-        }
+        rustc().env_remove(env_var).run();
+        minos("foo.o", default_version);
     });
 }