|
2 | 2 |
|
3 | 3 | **Tier: 2 with host tools**
|
4 | 4 |
|
5 |
| -One-sentence description of the target (e.g. CPU, OS) |
| 5 | +64-bit ARM-based Apple devices running macOS, Macs with Apple Silicon M1 or M2 chips. M3 is [`arm64e-apple-darwin`](platform-support/arm64e-apple-darwin.md). |
6 | 6 |
|
7 | 7 | ## Target maintainers
|
8 | 8 |
|
9 | 9 | - ???
|
10 | 10 |
|
11 | 11 | ## Requirements
|
12 | 12 |
|
13 |
| -Does the target support host tools, or only cross-compilation? Does the target |
14 |
| -support std, or alloc (either with a default allocator, or if the user supplies |
15 |
| -an allocator)? |
| 13 | +This target supports host tools and cross-compilation. It provides the full standard library including std and alloc. |
16 | 14 |
|
17 |
| -Document the expectations of binaries built for the target. Do they assume |
18 |
| -specific minimum features beyond the baseline of the CPU/environment/etc? What |
19 |
| -version of the OS or environment do they expect? |
| 15 | +Binaries built for this target expect a Apple Silicon Mac. |
20 | 16 |
|
21 |
| -Are there notable `#[target_feature(...)]` or `-C target-feature=` values that |
22 |
| -programs may wish to use? |
| 17 | +### Format |
23 | 18 |
|
24 |
| -What calling convention does `extern "C"` use on the target? |
25 |
| - |
26 |
| -What format do binaries use by default? ELF, PE, something else? |
| 19 | +The default binary format is Mach-O, the executable format used on Apple's platforms. |
27 | 20 |
|
28 | 21 | ## Building the target
|
29 | 22 |
|
30 |
| -If Rust doesn't build the target by default, how can users build it? Can users |
31 |
| -just add it to the `target` list in `config.toml`? |
| 23 | +Just add it to the `target` with: |
| 24 | +``` |
| 25 | +rustup target add aarch64-apple-darwin |
| 26 | +``` |
32 | 27 |
|
33 | 28 | ## Building Rust programs
|
34 | 29 |
|
35 |
| -Rust does not yet ship pre-compiled artifacts for this target. To compile for |
36 |
| -this target, you will either need to build Rust with the target enabled (see |
37 |
| -"Building the target" above), or build your own copy of `core` by using |
38 |
| -`build-std` or similar. |
| 30 | +Rust ships pre-compiled artifacts for this target or build your own copy of `core` by using |
| 31 | +`build-std`. |
39 | 32 |
|
40 | 33 | ## Testing
|
41 | 34 |
|
42 |
| -Does the target support running binaries, or do binaries have varying |
43 |
| -expectations that prevent having a standard way to run them? If users can run |
44 |
| -binaries, can they do so in some common emulator, or do they need native |
45 |
| -hardware? Does the target support running the Rust testsuite? |
| 35 | +Binaries produced for this target can be run directly on Apple Silicon Macs natively. |
| 36 | +The Rust test suite can be run for this target on such hardware. |
46 | 37 |
|
47 | 38 | ## Cross-compilation toolchains and C code
|
48 | 39 |
|
|
0 commit comments