Add arm64e-apple-tvos target

This commit is contained in:
Artyom Tetyukhin 2024-09-20 18:53:09 +04:00
parent 2b11f265b6
commit 340b38ed67
No known key found for this signature in database
GPG Key ID: 72A53C0ACCC6DE01
7 changed files with 72 additions and 3 deletions

View File

@ -1714,8 +1714,10 @@ fn $module() {
("x86_64-apple-ios-macabi", x86_64_apple_ios_macabi),
("aarch64-apple-ios-macabi", aarch64_apple_ios_macabi),
("aarch64-apple-ios-sim", aarch64_apple_ios_sim),
("aarch64-apple-tvos", aarch64_apple_tvos),
("aarch64-apple-tvos-sim", aarch64_apple_tvos_sim),
("arm64e-apple-tvos", arm64e_apple_tvos),
("x86_64-apple-tvos", x86_64_apple_tvos),
("armv7k-apple-watchos", armv7k_apple_watchos),

View File

@ -0,0 +1,24 @@
use crate::spec::base::apple::{base, Arch, TargetAbi};
use crate::spec::{FramePointer, Target, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("tvos", Arch::Arm64e, TargetAbi::Normal);
Target {
llvm_target,
metadata: crate::spec::TargetMetadata {
description: Some("ARM64e Apple tvOS".into()),
tier: Some(3),
host_tools: Some(false),
std: Some(true),
},
pointer_width: 64,
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128-Fn32".into(),
arch,
options: TargetOptions {
features: "+neon,+fp-armv8,+apple-a12,+v8.3a,+pauth".into(),
max_atomic_width: Some(128),
frame_pointer: FramePointer::NonLeaf,
..opts
},
}
}

View File

@ -25,6 +25,7 @@
- [\*-apple-ios-macabi](platform-support/apple-ios-macabi.md)
- [arm64e-apple-ios](platform-support/arm64e-apple-ios.md)
- [\*-apple-tvos](platform-support/apple-tvos.md)
- [arm64e-apple-tvos](platform-support/arm64e-apple-tvos.md)
- [\*-apple-watchos](platform-support/apple-watchos.md)
- [\*-apple-visionos](platform-support/apple-visionos.md)
- [aarch64-nintendo-switch-freestanding](platform-support/aarch64-nintendo-switch-freestanding.md)

View File

@ -245,8 +245,9 @@ host tools.
target | std | host | notes
-------|:---:|:----:|-------
[`arm64e-apple-ios`](platform-support/arm64e-apple-ios.md) | ✓ | | ARM64e Apple iOS
[`arm64e-apple-darwin`](platform-support/arm64e-apple-darwin.md) | ✓ | ✓ | ARM64e Apple Darwin
[`arm64e-apple-ios`](platform-support/arm64e-apple-ios.md) | ✓ | | ARM64e Apple iOS
[`arm64e-apple-tvos`](platform-support/arm64e-apple-tvos.md) | ✓ | | ARM64e Apple tvOS
[`aarch64-apple-tvos`](platform-support/apple-tvos.md) | ✓ | | ARM64 tvOS
[`aarch64-apple-tvos-sim`](platform-support/apple-tvos.md) | ✓ | | ARM64 tvOS Simulator
[`aarch64-apple-watchos`](platform-support/apple-watchos.md) | ✓ | | ARM64 Apple WatchOS

View File

@ -0,0 +1,37 @@
# `arm64e-apple-tvos`
**Tier: 3**
ARM64e tvOS (10.0+)
## Target maintainers
- Artyom Tetyukhin ([@arttet](https://github.com/https://github.com/arttet))
## Requirements
This target is cross-compiled and supports `std`.
To build this target Xcode 12 or higher on macOS is required.
## Building the target
You can build Rust with support for the targets by adding it to the `target` list in `config.toml`:
```toml
[build]
target = [ "arm64e-apple-tvos" ]
```
## Building Rust programs
Rust does not yet ship pre-compiled artifacts for this target.
To compile for this target, you will need to build Rust with the target enabled (see [Building the target](#building-the-target) above).
## Testing
The target does support running binaries on tvOS platforms with `arm64e` architecture.
## Cross-compilation toolchains and C code
The targets do support `C` code.
To build compatible `C` code, you have to use XCode with the same compiler and flags.

View File

@ -51,9 +51,7 @@
static TARGETS: &[&str] = &[
"aarch64-apple-darwin",
"arm64e-apple-darwin",
"aarch64-apple-ios",
"arm64e-apple-ios",
"aarch64-apple-ios-macabi",
"aarch64-apple-ios-sim",
"aarch64-unknown-fuchsia",
@ -68,6 +66,9 @@
"aarch64-unknown-none-softfloat",
"aarch64-unknown-redox",
"aarch64-unknown-uefi",
"arm64e-apple-darwin",
"arm64e-apple-ios",
"arm64e-apple-tvos",
"arm-linux-androideabi",
"arm-unknown-linux-gnueabi",
"arm-unknown-linux-gnueabihf",

View File

@ -18,6 +18,9 @@
//@ revisions: aarch64_apple_tvos_sim
//@ [aarch64_apple_tvos_sim] compile-flags: --target aarch64-apple-tvos-sim
//@ [aarch64_apple_tvos_sim] needs-llvm-components: aarch64
//@ revisions: arm64e_apple_tvos
//@ [arm64e_apple_tvos] compile-flags: --target arm64e-apple-tvos
//@ [arm64e_apple_tvos] needs-llvm-components: aarch64
//@ revisions: aarch64_apple_watchos
//@ [aarch64_apple_watchos] compile-flags: --target aarch64-apple-watchos
//@ [aarch64_apple_watchos] needs-llvm-components: aarch64