Add a tvOS entry to the platform-support documentation

This commit is contained in:
Thom Chiovoloni 2023-03-14 21:24:49 -07:00
parent abb1911682
commit df9640211d
No known key found for this signature in database
2 changed files with 72 additions and 2 deletions

View File

@ -214,7 +214,7 @@ host tools.
target | std | host | notes
-------|:---:|:----:|-------
`aarch64-apple-ios-macabi` | ? | | Apple Catalyst on ARM64
`aarch64-apple-tvos` | * | | ARM64 tvOS
[`aarch64-apple-tvos`](platform-support/apple-tvos.md) | ? | | ARM64 tvOS
[`aarch64-apple-watchos-sim`](platform-support/apple-watchos.md) | ✓ | | ARM64 Apple WatchOS Simulator
[`aarch64-kmc-solid_asp3`](platform-support/kmc-solid.md) | ✓ | | ARM64 SOLID with TOPPERS/ASP3
[`aarch64-nintendo-switch-freestanding`](platform-support/aarch64-nintendo-switch-freestanding.md) | * | | ARM64 Nintendo Switch, Horizon
@ -316,7 +316,7 @@ target | std | host | notes
`thumbv7neon-unknown-linux-musleabihf` | ? | | Thumb2-mode ARMv7a Linux with NEON, MUSL
[`wasm64-unknown-unknown`](platform-support/wasm64-unknown-unknown.md) | ? | | WebAssembly
`x86_64-apple-ios-macabi` | ✓ | | Apple Catalyst on x86_64
`x86_64-apple-tvos` | * | | x86 64-bit tvOS
[`x86_64-apple-tvos`](platform-support/apple-tvos.md) | ? | | x86 64-bit tvOS
[`x86_64-apple-watchos-sim`](platform-support/apple-watchos.md) | ✓ | | x86 64-bit Apple WatchOS simulator
[`x86_64-pc-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 7.1 RTOS |
[`x86_64-pc-windows-gnullvm`](platform-support/pc-windows-gnullvm.md) | ✓ | ✓ |

View File

@ -0,0 +1,70 @@
# `*-apple-tvos`
- aarch64-apple-tvos
- x86_64-apple-tvos
**Tier: 3**
Apple WatchOS targets:
- Apple tvOS on aarch64
- Apple tvOS Simulator on x86_64
## Target maintainers
* [@thomcc](https://github.com/thomcc)
## Requirements
These targets are cross-compiled. You will need appropriate versions of XCode
and the SDKs for tvOS (`AppleTVOS.sdk`) and/or the tvOS Simulator
(`AppleTVSimulator.sdk`) to build a toolchain and target these platforms.
The targets support the full standard library including the allocator to the
best of my knowledge, however they are very new, not yet well-tested tested, and
it is possible that there are various bugs.
In theory we support back to tvOS version 7.0, although the actual minimum
version you can target may be newer than this, for example due to the versions
of XCode and your SDKs.
As with the other Apple targets, `rustc` respects the common environment
variables used by XCode to configure this, in this case
`TVOS_DEPLOYMENT_TARGET`.
## Building the target
The targets can be built by enabling them for a `rustc` build, for example:
```toml
[build]
build-stage = 1
target = ["aarch64-apple-tvos", "x86_64-apple-tvos"]
```
It's possible that cargo under `-Zbuild-std` may also be used to target them.
## Building Rust programs
*Note: Building for this target requires the corresponding TVOS SDK, as provided by Xcode.*
Rust programs can be built for these targets
```text
$ rustc --target aarch64-apple-tvos your-code.rs
...
$ rustc --target x86_64-apple-tvos your-code.rs
```
## Testing
There is no support for running the Rust or standard library testsuite on tvOS
or the simulators at the moment. Testing has mostly been done manually with
builds of static libraries called from XCode or a simulator.
It hopefully will be possible to improve this in the future.
## Cross-compilation toolchains and C code
This target can be cross-compiled from x86_64 or aarch64 macOS hosts.
Other hosts are not supported for cross-compilation, but might work when also
providing the required Xcode SDK.