-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document all Apple targets in rustc's platform support
- Fixed std support in top-level docs. - Added `*-apple-darwin` docs. - Added `i686-apple-darwin` docs. - Moved `aarch64-apple-ios-sim` to `*-apple-ios` and document all the iOS targets there. - Added `*-apple-ios-macabi` docs. - Add myself (madsmtm) as co-maintainer of most of these targets.
- Loading branch information
Showing
14 changed files
with
376 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 0 additions & 55 deletions
55
src/doc/rustc/src/platform-support/aarch64-apple-ios-sim.md
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# `*-apple-darwin` | ||
|
||
Apple macOS targets. | ||
|
||
**Tier: 1** | ||
|
||
- `x86_64-apple-darwin`: macOS on 64-bit x86. | ||
|
||
**Tier: 2 (with Host Tools)** | ||
|
||
- `aarch64-apple-darwin`: macOS on ARM64 (M1-family or later Apple Silicon CPUs). | ||
|
||
## Target maintainers | ||
|
||
- [@thomcc](https://github.com/thomcc) | ||
- [@madsmtm](https://github.com/madsmtm) | ||
|
||
## Requirements | ||
|
||
### OS version | ||
|
||
The minimum supported version is macOS 10.12 Sierra on x86, and macOS 11.0 Big | ||
Sur on ARM64. | ||
|
||
This version can be raised per-binary by changing the [deployment target], | ||
which might yield more performance optimizations. `rustc` respects the common | ||
environment variables used by Xcode to do so, in this case | ||
`MACOSX_DEPLOYMENT_TARGET`. | ||
|
||
The current default deployment target for `rustc` can be retrieved with | ||
[`rustc --print=deployment-target`][rustc-print]. | ||
|
||
[deployment target]: https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html | ||
[rustc-print]: ../command-line-arguments.md#option-print | ||
|
||
### Binary format | ||
|
||
The default binary format is Mach-O, the executable format used on Apple's | ||
platforms. | ||
|
||
## Building | ||
|
||
These targets are distributed through `rustup`, and otherwise require no | ||
special configuration. | ||
|
||
## Testing | ||
|
||
There are no special requirements for testing and running this target. | ||
|
||
x86 binaries can be run on Apple Silicon by using Rosetta. | ||
|
||
## Cross-compilation toolchains and C code | ||
|
||
Cross-compilation of these targets are supported using Clang, but may require | ||
Xcode or the macOS SDK (`MacOSX.sdk`) to be available to compile C code and | ||
to link. | ||
|
||
The path to the SDK can be passed to `rustc` using the common `SDKROOT` | ||
environment variable. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# `*-apple-ios-macabi` | ||
|
||
Apple Mac Catalyst targets. | ||
|
||
**Tier: 3** | ||
|
||
- `aarch64-apple-ios-macabi`: Mac Catalyst on ARM64. | ||
- `x86_64-apple-ios-macabi`: Mac Catalyst on 64-bit x86. | ||
|
||
## Target maintainers | ||
|
||
- [@madsmtm](https://github.com/madsmtm) | ||
|
||
## Requirements | ||
|
||
These targets are cross-compiled, and require the corresponding macOS SDK | ||
(`MacOSX.sdk`) which contain `./System/iOSSupport` headers to allow linking to | ||
iOS-specific headers, as provided by Xcode 11 or higher. | ||
|
||
The path to the SDK can be passed to `rustc` using the common `SDKROOT` | ||
environment variable. | ||
|
||
### OS version | ||
|
||
The minimum supported version is iOS 13.1. | ||
|
||
This can be raised per-binary by changing the deployment target. `rustc` | ||
respects the common environment variables used by Xcode to do so, in this | ||
case `IPHONEOS_DEPLOYMENT_TARGET`. | ||
|
||
## Building the target | ||
|
||
The targets can be built by enabling them for a `rustc` build in | ||
`config.toml`, by adding, for example: | ||
|
||
```toml | ||
[build] | ||
target = ["aarch64-apple-ios-macabi", "x86_64-apple-ios-macabi"] | ||
``` | ||
|
||
Using the unstable `-Zbuild-std` with a nightly Cargo may also work. | ||
|
||
## Building Rust programs | ||
|
||
Rust programs can be built for these targets by specifying `--target`, if | ||
`rustc` has been built with support for them. For example: | ||
|
||
```console | ||
$ rustc --target aarch64-apple-ios-macabi your-code.rs | ||
``` | ||
|
||
## Testing | ||
|
||
Mac Catalyst binaries can be run directly on macOS 10.15 Catalina or newer. | ||
|
||
x86 binaries can be run on Apple Silicon by using Rosetta. | ||
|
||
Note that using certain UIKit functionality requires the binary to be bundled. |
Oops, something went wrong.