GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support tvOS and watchOS (and simulator) targets · Issue #48862 · rust-lang/rust

Support tvOS and watchOS (and simulator) targets #48862

New issue
Copy link
New issue
Copy link
Closed
Closed
Support tvOS and watchOS (and simulator) targets#48862
Copy link
Labels
A-target-specsArea: Compile-target specificationsArea: Compile-target specificationsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.O-iosOperating system: iOSOperating system: iOSO-macosOperating system: macOSOperating system: macOSO-tvosOperating system: tvOS (including simulator)Operating system: tvOS (including simulator)O-watchosOperating System: watchOSOperating System: watchOST-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.

Description

@comex
comex
opened on Mar 9, 2018
Issue body actions

Apple'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:

  • Simulators now have -simulator in the LLVM triple, e.g. x86_64-apple-tvos12.4.0-simulator
  • Catalyst (which someone already submitted a PR adding initial support for) has triples like x86_64-apple-ios13.0-macabi. It still uses the macOS SDK, but with a custom header/library search path.
  • watchOS has an additional architecture, arm64_32; example LLVM triple: arm64_32-apple-watchos6.0.0.
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

Activity

Next
  1. Centril
    added
    A-target-specsArea: Compile-target specificationsArea: Compile-target specifications
    on Mar 10, 2018
  2. XAMPPRocky
    added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.
    on May 14, 2018
  3. appaquet commented on Mar 1, 2019

    @appaquet
    appaquet
    on Mar 1, 2019
    More actions

    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
  4. lerouxrgd commented on Mar 1, 2019

    @lerouxrgd
    lerouxrgd
    on Mar 1, 2019
    More actions

    Would it be feasible to add a codegen-backends implementation based on Swift's llvm ? (In the same way emscripten was added)

  5. pruthvikar commented on Jan 30, 2020

    @pruthvikar
    pruthvikar
    on Jan 30, 2020
    More actions

    @appaquet Would you be able to share how you managed to compile and link for armv7k?

  6. appaquet commented on Jan 30, 2020

    @appaquet
    appaquet
    on Jan 30, 2020
    More actions

    @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
  7. pruthvikar commented on Jan 30, 2020

    @pruthvikar
    pruthvikar
    on Jan 30, 2020
    More actions

    That should come in very handy, thanks!

  8. bors
    added a commit that references this issue on Feb 27, 2020

    Auto merge of #68191 - simlay:add-tvSO-target, r=nagisa

    97c90e5
  9. Centril
    added 2 commits that reference this issue on Mar 11, 2020

    Rollup merge of rust-lang#68191 - simlay:add-tvSO-target, r=nagisa

    8296e2c

    Rollup merge of rust-lang#68191 - simlay:add-tvSO-target, r=nagisa

    37e967f
  10. bors
    added a commit that references this issue on Mar 12, 2020

    Auto merge of #68191 - simlay:add-tvSO-target, r=nagisa

    e5e8ba4
  11. iMonZ commented on Jun 5, 2022

    @iMonZ
    iMonZ
    on Jun 5, 2022
    More actions

    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

    Reacted by Kit Plummer
  12. jinleili commented on Sep 26, 2022

    @jinleili
    jinleili
    on Sep 26, 2022
    More actions

    From https://doc.rust-lang.org/nightly/rustc/platform-support.html, aarch64-apple-tvos target only supports no_std development.

  13. 2 remaining items

  14. hakonk commented on Jun 18, 2023

    @hakonk
    hakonk
    on Jun 18, 2023
    More actions

    I'm also curious about what's needed to make std work on tvOS.

  15. workingjubilee
    added
    O-macosOperating system: macOSOperating system: macOS
    O-iosOperating system: iOSOperating system: iOS
    O-tvosOperating system: tvOS (including simulator)Operating system: tvOS (including simulator)
    on Jul 22, 2023
  16. workingjubilee commented on Jul 22, 2023

    @workingjubilee
    workingjubilee
    on Jul 22, 2023
    Member
    More actions

    See #103503
    All of these targets are at the status they should be, I believe.

    Closing.

    Reacted by Håkon Knutzen and Mads Marquart
  17. workingjubilee
    closed this as completedon Jul 22, 2023
  18. hakonk commented on Jul 23, 2023

    @hakonk
    hakonk
    on Jul 23, 2023
    More actions

    Great, @workingjubilee ! I'm happy to see this!

  19. bcardarella commented on Sep 8, 2023

    @bcardarella
    bcardarella
    on Sep 8, 2023
    More actions

    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

  20. bcardarella commented on Sep 8, 2023

    @bcardarella
    bcardarella
    on Sep 8, 2023
    More actions

    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
    
  21. workingjubilee commented on Sep 9, 2023

    @workingjubilee
    workingjubilee
    on Sep 9, 2023
    Member
    More actions

    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.

  22. bcardarella commented on Sep 9, 2023

    @bcardarella
    bcardarella
    on Sep 9, 2023
    More actions

    @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

  23. bcardarella commented on Sep 9, 2023

    @bcardarella
    bcardarella
    on Sep 9, 2023
    More actions

    @workingjubilee wouldn't the x86_64-apple-tvos architecture not work on the M1/M2 macs as the simulator?

  24. bcardarella commented on Sep 9, 2023

    @bcardarella
    bcardarella
    on Sep 9, 2023
    More actions

    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

  25. bcardarella commented on Sep 9, 2023

    @bcardarella
    bcardarella
    on Sep 9, 2023
    More actions

    This is Swift's own:

    https://github.com/apple/swift/blob/ffbc65c8c48cb38db190fa0618fe2b5937a334b8/utils/build-script-impl#L649-L658

  26. workingjubilee commented on Sep 9, 2023

    @workingjubilee
    workingjubilee
    on Sep 9, 2023
    Member
    More actions

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-target-specsArea: Compile-target specificationsArea: Compile-target specificationsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.O-iosOperating system: iOSOperating system: iOSO-macosOperating system: macOSOperating system: macOSO-tvosOperating system: tvOS (including simulator)Operating system: tvOS (including simulator)O-watchosOperating System: watchOSOperating System: watchOST-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.