Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add target docs for aarch64-apple-darwin (M1/M2 macs) #124134

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ so Rustup may install the documentation for a similar tier 1 target instead.

target | notes
-------|-------
`aarch64-apple-darwin` | ARM64 macOS (11.0+, Big Sur+)
[`aarch64-apple-darwin`](platform-support/aarch64-apple-darwin.md) | ARM64 macOS (11.0+, Big Sur+)
`aarch64-pc-windows-msvc` | ARM64 Windows MSVC
`aarch64-unknown-linux-musl` | ARM64 Linux with musl 1.2.3
`arm-unknown-linux-gnueabi` | ARMv6 Linux (kernel 3.2, glibc 2.17)
Expand Down
41 changes: 41 additions & 0 deletions src/doc/rustc/src/platform-support/aarch64-apple-darwin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# `aarch64-apple-darwin`

**Tier: 2 with host tools**

64-bit Arm-based Apple devices running macOS: Macs with M1-family or later Apple Silicon CPUs.

## Target maintainers

- ???

## Requirements

This target supports host tools and cross-compilation. It provides the full standard library including std and alloc.

Binaries built for this target expect a Apple Silicon Mac on macOS 11.0 Big Sur+.

### Format

The default binary format is Mach-O, the executable format used on Apple's platforms.

## Building the target

Just add it to the `target` with:
```sh
rustup target add aarch64-apple-darwin
Comment on lines +23 to +25
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this section is supposed to be for building rustc such that it includes the target, not just for building code that uses the target. Although looking at the other documents it's kind of inconsistently used?

Copy link
Author

Choose a reason for hiding this comment

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

The command for building the target std is always the same, so I think this should be fine.

```

## Building Rust programs

Rust ships pre-compiled artifacts for this target or build your own copy of `core` by using
`build-std`.

## Testing

Binaries produced for this target can be run directly on Apple Silicon Macs natively.
The Rust test suite can be run for this target on such hardware.

## Cross-compilation toolchains and C code

This target supports C code. To build compatible C code, you should use a toolchain targeting aarch64-apple-darwin, such as Xcode on a Mac or GCC.
The toolchain target triple matches this Rust target triple.
Loading