Skip to content

Commit df96402

Browse files
committed
Add a tvOS entry to the platform-support documentation
1 parent abb1911 commit df96402

File tree

2 files changed

+72
-2
lines changed

2 files changed

+72
-2
lines changed

src/doc/rustc/src/platform-support.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ host tools.
214214
target | std | host | notes
215215
-------|:---:|:----:|-------
216216
`aarch64-apple-ios-macabi` | ? | | Apple Catalyst on ARM64
217-
`aarch64-apple-tvos` | * | | ARM64 tvOS
217+
[`aarch64-apple-tvos`](platform-support/apple-tvos.md) | ? | | ARM64 tvOS
218218
[`aarch64-apple-watchos-sim`](platform-support/apple-watchos.md) | ✓ | | ARM64 Apple WatchOS Simulator
219219
[`aarch64-kmc-solid_asp3`](platform-support/kmc-solid.md) | ✓ | | ARM64 SOLID with TOPPERS/ASP3
220220
[`aarch64-nintendo-switch-freestanding`](platform-support/aarch64-nintendo-switch-freestanding.md) | * | | ARM64 Nintendo Switch, Horizon
@@ -316,7 +316,7 @@ target | std | host | notes
316316
`thumbv7neon-unknown-linux-musleabihf` | ? | | Thumb2-mode ARMv7a Linux with NEON, MUSL
317317
[`wasm64-unknown-unknown`](platform-support/wasm64-unknown-unknown.md) | ? | | WebAssembly
318318
`x86_64-apple-ios-macabi` | ✓ | | Apple Catalyst on x86_64
319-
`x86_64-apple-tvos` | * | | x86 64-bit tvOS
319+
[`x86_64-apple-tvos`](platform-support/apple-tvos.md) | ? | | x86 64-bit tvOS
320320
[`x86_64-apple-watchos-sim`](platform-support/apple-watchos.md) | ✓ | | x86 64-bit Apple WatchOS simulator
321321
[`x86_64-pc-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 7.1 RTOS |
322322
[`x86_64-pc-windows-gnullvm`](platform-support/pc-windows-gnullvm.md) | ✓ | ✓ |
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# `*-apple-tvos`
2+
- aarch64-apple-tvos
3+
- x86_64-apple-tvos
4+
5+
**Tier: 3**
6+
7+
Apple WatchOS targets:
8+
- Apple tvOS on aarch64
9+
- Apple tvOS Simulator on x86_64
10+
11+
## Target maintainers
12+
13+
* [@thomcc](https://github.com/thomcc)
14+
15+
## Requirements
16+
17+
These targets are cross-compiled. You will need appropriate versions of XCode
18+
and the SDKs for tvOS (`AppleTVOS.sdk`) and/or the tvOS Simulator
19+
(`AppleTVSimulator.sdk`) to build a toolchain and target these platforms.
20+
21+
The targets support the full standard library including the allocator to the
22+
best of my knowledge, however they are very new, not yet well-tested tested, and
23+
it is possible that there are various bugs.
24+
25+
In theory we support back to tvOS version 7.0, although the actual minimum
26+
version you can target may be newer than this, for example due to the versions
27+
of XCode and your SDKs.
28+
29+
As with the other Apple targets, `rustc` respects the common environment
30+
variables used by XCode to configure this, in this case
31+
`TVOS_DEPLOYMENT_TARGET`.
32+
33+
## Building the target
34+
35+
The targets can be built by enabling them for a `rustc` build, for example:
36+
37+
```toml
38+
[build]
39+
build-stage = 1
40+
target = ["aarch64-apple-tvos", "x86_64-apple-tvos"]
41+
```
42+
43+
It's possible that cargo under `-Zbuild-std` may also be used to target them.
44+
45+
## Building Rust programs
46+
47+
*Note: Building for this target requires the corresponding TVOS SDK, as provided by Xcode.*
48+
49+
Rust programs can be built for these targets
50+
51+
```text
52+
$ rustc --target aarch64-apple-tvos your-code.rs
53+
...
54+
$ rustc --target x86_64-apple-tvos your-code.rs
55+
```
56+
57+
## Testing
58+
59+
There is no support for running the Rust or standard library testsuite on tvOS
60+
or the simulators at the moment. Testing has mostly been done manually with
61+
builds of static libraries called from XCode or a simulator.
62+
63+
It hopefully will be possible to improve this in the future.
64+
65+
## Cross-compilation toolchains and C code
66+
67+
This target can be cross-compiled from x86_64 or aarch64 macOS hosts.
68+
69+
Other hosts are not supported for cross-compilation, but might work when also
70+
providing the required Xcode SDK.

0 commit comments

Comments
 (0)