GeezerVison is showing github.com — Support tvOS and watchOS (and simulator) targets · Issue #48862 · rust-lang/rust
Support tvOS and watchOS (and simulator) targets #48862DescriptionApple's division of OS targets is a bit odd: apps for iPhones and iPads both use an iOS or "iPhoneOS" target, but watchOS and tvOS are treated as entirely separate targets or "platforms".
rustc currently supports macOS ({x86_64,i686}-apple-darwin), iOS ({armv7,armv7s,aarch64}-apple-ios), and the iOS Simulator (i386-apple-ios), but not tvOS or watchOS.
Here's the full list of platforms. (I'm not sure if the version-min argument is needed for rustc, but it would be needed in cc-rs, which is also missing support.)
Edit (9/10/19): Changes since this was originally posted:
| OS Name |
Xcode Platform Name |
Valid Architectures |
LLVM Triple |
Clang -mxxx-version-min |
| macOS |
MacOSX |
i386 x86_64 |
x86_64-apple-macosx10.13.0 |
-mmacosx-version-min or -mmacos-version-min |
| iOS |
iPhoneOS |
arm64 armv7 armv7s |
arm64-apple-ios11.2.0 |
-miphoneos-version-min or -mios-version-min |
| iOS Simulator |
iPhoneOSSimulator |
i386 x86_64 |
x86_64-apple-ios11.2.0 |
-miphonesimulator-version-min or -mios-simulator-version-min |
| watchOS |
WatchOS |
armv7k |
thumbv7k-apple-watchos4.2.0 |
-mwatchos-version-min |
| watchOS Simulator |
WatchSimulator |
i386 x86_64 |
x86_64-apple-watchos4.2.0 |
-mwatchsimulator-version-min or -mwatchos-simulator-version-min |
| tvOS |
AppleTVOS |
arm64 |
arm64-apple-tvos11.2.0 |
-mappletvos-version-min or -mtvos-version-min |
| tvOS Simulator |
AppleTVSimulator |
x86_64 |
x86_64-apple-tvos11.2.0 |
-mappletvsimulator-version-min or -mtvos-simulator-version-min |
Example output of xcodebuild -showsdks:
iOS SDKs:
iOS 11.2 -sdk iphoneos11.2
iOS Simulator SDKs:
Simulator - iOS 11.2 -sdk iphonesimulator11.2
macOS SDKs:
macOS 10.13 -sdk macosx10.13
tvOS SDKs:
tvOS 11.2 -sdk appletvos11.2
tvOS Simulator SDKs:
Simulator - tvOS 11.2 -sdk appletvsimulator11.2
watchOS SDKs:
watchOS 4.2 -sdk watchos4.2
watchOS Simulator SDKs:
Simulator - watchOS 4.2 -sdk watchsimulator4.2
Reacted by mtak-, Matthew Iannucci, Alik Aslanyan, Sercan Değirmenci, Linus Unnebäck, Hamilton Chapman, Loic Zimmermann, Sacha Arbonel, Pruthvikar Reddy, Jeffrey Walton and 15 more Reacted by mtak-, extrawurst, Sercan Değirmenci, Florian Doyon, Andrei Borisov, Hamilton Chapman, Yan Li, Jonas Pettersson, ivnsch, David and 1 more Activityappaquet commented on Mar 1, 2019 Starting from the iOS implementation in rustc, I got i386 and armv7k for watchos to compile and link in Xcode 10.2 beta 3. It requires quite a few modifications to support the watchos platform, but I think it's quite trivial as watchOS is based on iOS. Unfortunatelly, it will require changes in quite a few crates that have conditional compilation on iOS target (cc, compiler-rt, backtrace, etc.).
Unfortunately, this isn't sufficient for Apple Store release... Apple now requires a new arm64_32 target as of watchOS 5.0. There is a very recent proposal to upstream it. Xcode comes with a bitcode translation tool that takes armv7k code and translates it to arm64_32 (which I understand being possible as they have same pointer/int size), but couldn't make it work with armv7k generated by rustc...
As mentionned in #35968, in order to prevent this never ending catching up on Xcode, I think using Swift's llvm is the only way to fully support Apple ecosystem... Reacted by Romain Leroux and Pruthvikar Reddy lerouxrgd commented on Mar 1, 2019 Would it be feasible to add a codegen-backends implementation based on Swift's llvm ? (In the same way emscripten was added) pruthvikar commented on Jan 30, 2020 @appaquet Would you be able to share how you managed to compile and link for armv7k? appaquet commented on Jan 30, 2020 @pruthvikar Unfortunately it's been a while and I haven't touched it since, so I may not be very helpful... But here are the changes I had made on rustc: master...appaquet:watchos
But as I had mentioned, arm64_32 was impossible to target since it required changes that had not been merged in LLVM back when I tested it. Reacted by Pruthvikar Reddy and Akash Gurava pruthvikar commented on Jan 30, 2020 That should come in very handy, thanks! iMonZ commented on Jun 5, 2022 rustc --print target-list shows "aarch64-apple-tvos" but then I get the error:
~/Downloads/rust … rustup target add aarch64-apple-tvos 111ms Sun 5 Jun 03:43:10 2022
error: toolchain 'beta-aarch64-apple-darwin' does not contain component 'rust-std' for target 'aarch64-apple-tvos'; did you mean 'aarch64-apple-ios'?
note: not all platforms have the standard library pre-compiled: https://doc.rust-lang.org/nightly/rustc/platform-support.html
jinleili commented on Sep 26, 2022 hakonk commented on Jun 18, 2023 I'm also curious about what's needed to make std work on tvOS. workingjubilee commented on Jul 22, 2023 See #103503
All of these targets are at the status they should be, I believe.
Closing. Reacted by Håkon Knutzen and Mads Marquart hakonk commented on Jul 23, 2023 bcardarella commented on Sep 8, 2023 am I understanding this issue as indicating that the TvOS simulator is supported? We cannot compile to it but we can compile directly to TvOS bcardarella commented on Sep 8, 2023 Just to confirm I'm on the correct version of rustc:
➜ ~ rustc --version
rustc 1.72.0 (5680fa18f 2023-08-23)
➜ ~ rustc --print target-list | grep tvos
aarch64-apple-tvos
x86_64-apple-tvos
workingjubilee commented on Sep 9, 2023 The tuple naming may be somewhat nonintuitive. The x86_64-apple-tvos target is a simulator target, and the aarch64-apple-tvos target is not, as you can see by the table in comex's original post. I hope that clarifies things? If you desire a rename, more tuples, etc., I recommend pursuing that in a new proposal as due to various circumstances this one is about to be out-of-date for any discussion of how these targets actually are. bcardarella commented on Sep 9, 2023 @workingjubilee you're right, let me dig in and see why we're not able to compile for the simulator. Thank you for the quick reply bcardarella commented on Sep 9, 2023 @workingjubilee wouldn't the x86_64-apple-tvos architecture not work on the M1/M2 macs as the simulator? bcardarella commented on Sep 9, 2023 For example, if I get the compiler targets for WatchOS:
➜ ~ rustc --print target-list | grep watchos
aarch64-apple-watchos-sim
arm64_32-apple-watchos
armv7k-apple-watchos
x86_64-apple-watchos-sim
it includes both the x86 and aarch64 targets for the simulator bcardarella commented on Sep 9, 2023 workingjubilee commented on Sep 9, 2023
@workingjubilee wouldn't the x86_64-apple-tvos architecture not work on the M1/M2 macs as the simulator?
Uhhh, it probably seems obvious to you, but for some reason I am missing the last 20% of context here so I'm not immediately certain what you're actually asking. Which is the other reason why I suggested you open a new issue: It would be nice to see the full "problem statement" ("I want to do X, I tried Y, it didn't work, this was what the compiler vomited out").
You can @ me in that issue if you want my attention specifically, but it is also more likely to get attention in general, because it will be visible to people immediately triaging the issues (especially recently-opened ones). And we may need to determine it's a regression and triage it as such and so on.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|