Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1615,6 +1615,7 @@ supported_targets! {

("aarch64-apple-visionos", aarch64_apple_visionos),
("aarch64-apple-visionos-sim", aarch64_apple_visionos_sim),
("arm64e-apple-visionos", arm64e_apple_visionos),

("armebv7r-none-eabi", armebv7r_none_eabi),
("armebv7r-none-eabihf", armebv7r_none_eabihf),
Expand Down
25 changes: 25 additions & 0 deletions compiler/rustc_target/src/spec/targets/arm64e_apple_visionos.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{Os, SanitizerSet, Target, TargetMetadata, TargetOptions};

pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base(Os::VisionOs, Arch::Arm64e, TargetEnv::Normal);
Target {
llvm_target,
metadata: TargetMetadata {
description: Some("ARM64e Apple visionOS".into()),
tier: Some(3),
host_tools: Some(false),
std: Some(true),
},
pointer_width: 64,
data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32"
.into(),
arch,
options: TargetOptions {
features: "+neon,+apple-a12,+v8.3a,+paca,+pacg".into(),
max_atomic_width: Some(128),
supported_sanitizers: SanitizerSet::ADDRESS | SanitizerSet::THREAD,
..opts
},
}
}
4 changes: 1 addition & 3 deletions src/bootstrap/src/core/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ pub struct Finder {
///
/// Targets can be removed from this list during the usual release process bootstrap compiler bumps,
/// when the newly-bumped stage 0 compiler now knows about the formerly-missing targets.
const STAGE0_MISSING_TARGETS: &[&str] = &[
// just a dummy comment so the list doesn't get onelined
];
const STAGE0_MISSING_TARGETS: &[&str] = &["arm64e-apple-visionos"];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Don't remove the comment.


/// Minimum version threshold for libstdc++ required when using prebuilt LLVM
/// from CI (with`llvm.download-ci-llvm` option).
Expand Down
1 change: 1 addition & 0 deletions src/doc/rustc/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
- [arm64e-apple-tvos](platform-support/arm64e-apple-tvos.md)
- [\*-apple-watchos](platform-support/apple-watchos.md)
- [\*-apple-visionos](platform-support/apple-visionos.md)
- [arm64e-apple-visionos](platform-support/arm64e-apple-visionos.md)
- [aarch64-nintendo-switch-freestanding](platform-support/aarch64-nintendo-switch-freestanding.md)
- [aarch64-unknown-linux-gnu](platform-support/aarch64-unknown-linux-gnu.md)
- [aarch64-unknown-linux-musl](platform-support/aarch64-unknown-linux-musl.md)
Expand Down
1 change: 1 addition & 0 deletions src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ target | std | host | notes
[`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
[`arm64e-apple-visionos`](platform-support/arm64e-apple-visionos.md) | ✓ | | arm64e Apple visionOS
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit:

Suggested change
[`arm64e-apple-visionos`](platform-support/arm64e-apple-visionos.md) | ✓ | | arm64e Apple visionOS
[`arm64e-apple-visionos`](platform-support/arm64e-apple-visionos.md) | ✓ | | ARM64e Apple visionOS

[`armeb-unknown-linux-gnueabi`](platform-support/armeb-unknown-linux-gnueabi.md) | ✓ | ? | Arm BE8 the default Arm big-endian architecture since [Armv6](https://developer.arm.com/documentation/101754/0616/armlink-Reference/armlink-Command-line-Options/--be8?lang=en).
[`armebv7r-none-eabi`](platform-support/armebv7r-none-eabi.md) | * | | Bare Armv7-R, Big Endian
[`armebv7r-none-eabihf`](platform-support/armebv7r-none-eabi.md) | * | | Bare Armv7-R, Big Endian, hardfloat
Expand Down
46 changes: 46 additions & 0 deletions src/doc/rustc/src/platform-support/arm64e-apple-visionos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# `arm64e-apple-visionos`

**Tier: 3**

Apple arm64e visionOS.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit:

Suggested change
Apple arm64e visionOS.
Apple ARM64e visionOS.


## Target maintainers

[@cypherair](https://github.com/cypherair)

## Requirements

This target is cross-compiled and supports `std`.

This target requires the visionOS SDK provided by Xcode.

The deployment target can be configured with `XROS_DEPLOYMENT_TARGET`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you refer to apple-visionos.md instead, similar to what's done in arm64e-apple-ios.md?


## Building the target

You can build Rust with support for the target by adding it to the `target`
list in `bootstrap.toml`:
```toml
[build]
target = ["arm64e-apple-visionos"]
```

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

## Testing

This target is not tested by Rust CI.

Binaries are intended to run on visionOS devices with `arm64e` architecture.

The visionOS simulator targets use `arm64`, not `arm64e`.

## Cross-compilation toolchains and C code

C code should be built with Apple's Clang from Xcode, using the visionOS SDK and
matching deployment target.

The Clang target is suffixed with `-xros`.
3 changes: 3 additions & 0 deletions tests/assembly-llvm/targets/targets-macho.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
//@ revisions: aarch64_apple_visionos
//@ [aarch64_apple_visionos] compile-flags: --target aarch64-apple-visionos
//@ [aarch64_apple_visionos] needs-llvm-components: aarch64
//@ revisions: arm64e_apple_visionos
//@ [arm64e_apple_visionos] compile-flags: --target arm64e-apple-visionos
//@ [arm64e_apple_visionos] needs-llvm-components: aarch64
//@ revisions: aarch64_apple_visionos_sim
//@ [aarch64_apple_visionos_sim] compile-flags: --target aarch64-apple-visionos-sim
//@ [aarch64_apple_visionos_sim] needs-llvm-components: aarch64
Expand Down
Loading