Skip to content

Commit ba898bb

Browse files
committed
Add arm64e-apple-tvos target
1 parent 2b11f26 commit ba898bb

File tree

6 files changed

+71
-3
lines changed

6 files changed

+71
-3
lines changed

compiler/rustc_target/src/spec/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1714,8 +1714,10 @@ supported_targets! {
17141714
("x86_64-apple-ios-macabi", x86_64_apple_ios_macabi),
17151715
("aarch64-apple-ios-macabi", aarch64_apple_ios_macabi),
17161716
("aarch64-apple-ios-sim", aarch64_apple_ios_sim),
1717+
17171718
("aarch64-apple-tvos", aarch64_apple_tvos),
17181719
("aarch64-apple-tvos-sim", aarch64_apple_tvos_sim),
1720+
("arm64e-apple-tvos", arm64e_apple_tvos),
17191721
("x86_64-apple-tvos", x86_64_apple_tvos),
17201722

17211723
("armv7k-apple-watchos", armv7k_apple_watchos),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
use crate::spec::base::apple::{base, Arch, TargetAbi};
2+
use crate::spec::{FramePointer, Target, TargetOptions};
3+
4+
pub(crate) fn target() -> Target {
5+
let (opts, llvm_target, arch) = base("tvos", Arch::Arm64e, TargetAbi::Normal);
6+
Target {
7+
llvm_target,
8+
metadata: crate::spec::TargetMetadata {
9+
description: Some("ARM64e Apple tvOS".into()),
10+
tier: Some(3),
11+
host_tools: Some(false),
12+
std: Some(true),
13+
},
14+
pointer_width: 64,
15+
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128-Fn32".into(),
16+
arch,
17+
options: TargetOptions {
18+
features: "+neon,+fp-armv8,+apple-a12,+v8.3a,+pauth".into(),
19+
max_atomic_width: Some(128),
20+
frame_pointer: FramePointer::NonLeaf,
21+
..opts
22+
},
23+
}
24+
}

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,9 @@ host tools.
245245

246246
target | std | host | notes
247247
-------|:---:|:----:|-------
248-
[`arm64e-apple-ios`](platform-support/arm64e-apple-ios.md) | ✓ | | ARM64e Apple iOS
249248
[`arm64e-apple-darwin`](platform-support/arm64e-apple-darwin.md) | ✓ | ✓ | ARM64e Apple Darwin
249+
[`arm64e-apple-ios`](platform-support/arm64e-apple-ios.md) | ✓ | | ARM64e Apple iOS
250+
[`arm64e-apple-tvos`](platform-support/arm64e-apple-tvos.md) | ✓ | | ARM64e Apple tvOS
250251
[`aarch64-apple-tvos`](platform-support/apple-tvos.md) | ✓ | | ARM64 tvOS
251252
[`aarch64-apple-tvos-sim`](platform-support/apple-tvos.md) | ✓ | | ARM64 tvOS Simulator
252253
[`aarch64-apple-watchos`](platform-support/apple-watchos.md) | ✓ | | ARM64 Apple WatchOS
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# `arm64e-apple-tvos`
2+
3+
**Tier: 3**
4+
5+
ARM64e tvOS (10.0+)
6+
7+
## Target maintainers
8+
9+
- Artyom Tetyukhin ([@arttet](https://github.com/https://github.com/arttet))
10+
11+
## Requirements
12+
13+
This target is cross-compiled and supports `std`.
14+
To build this target Xcode 12 or higher on macOS is required.
15+
16+
## Building the target
17+
18+
You can build Rust with support for the targets by adding it to the `target` list in `config.toml`:
19+
20+
```toml
21+
[build]
22+
target = [ "arm64e-apple-tvos" ]
23+
```
24+
25+
## Building Rust programs
26+
27+
Rust does not yet ship pre-compiled artifacts for this target.
28+
To compile for this target, you will need to build Rust with the target enabled (see [Building the target](#building-the-target) above).
29+
30+
## Testing
31+
32+
The target does support running binaries on tvOS platforms with `arm64e` architecture.
33+
34+
## Cross-compilation toolchains and C code
35+
36+
The targets do support `C` code.
37+
To build compatible `C` code, you have to use XCode with the same compiler and flags.

src/tools/build-manifest/src/main.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ static HOSTS: &[&str] = &[
5151

5252
static TARGETS: &[&str] = &[
5353
"aarch64-apple-darwin",
54-
"arm64e-apple-darwin",
5554
"aarch64-apple-ios",
56-
"arm64e-apple-ios",
5755
"aarch64-apple-ios-macabi",
5856
"aarch64-apple-ios-sim",
5957
"aarch64-unknown-fuchsia",
@@ -68,6 +66,9 @@ static TARGETS: &[&str] = &[
6866
"aarch64-unknown-none-softfloat",
6967
"aarch64-unknown-redox",
7068
"aarch64-unknown-uefi",
69+
"arm64e-apple-darwin",
70+
"arm64e-apple-ios",
71+
"arm64e-apple-tvos",
7172
"arm-linux-androideabi",
7273
"arm-unknown-linux-gnueabi",
7374
"arm-unknown-linux-gnueabihf",

tests/assembly/targets/targets-macho.rs

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
//@ revisions: aarch64_apple_tvos_sim
1919
//@ [aarch64_apple_tvos_sim] compile-flags: --target aarch64-apple-tvos-sim
2020
//@ [aarch64_apple_tvos_sim] needs-llvm-components: aarch64
21+
//@ revisions: arm64e_apple_tvos
22+
//@ [arm64e_apple_tvos] compile-flags: --target arm64e-apple-tvos
23+
//@ [arm64e_apple_tvos] needs-llvm-components: aarch64
2124
//@ revisions: aarch64_apple_watchos
2225
//@ [aarch64_apple_watchos] compile-flags: --target aarch64-apple-watchos
2326
//@ [aarch64_apple_watchos] needs-llvm-components: aarch64

0 commit comments

Comments
 (0)