-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 arm64e-apple-ios & arm64e-apple-darwin targets #115526
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
27 changes: 27 additions & 0 deletions
27
compiler/rustc_target/src/spec/targets/arm64e_apple_darwin.rs
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,27 @@ | ||
use crate::spec::base::apple::{macos_llvm_target, opts, Arch}; | ||
use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; | ||
|
||
pub fn target() -> Target { | ||
let arch = Arch::Arm64e; | ||
let mut base = opts("macos", arch); | ||
base.cpu = "apple-m1".into(); | ||
base.max_atomic_width = Some(128); | ||
|
||
// FIXME: The leak sanitizer currently fails the tests, see #88132. | ||
base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::THREAD; | ||
|
||
Target { | ||
// Clang automatically chooses a more specific target based on | ||
// MACOSX_DEPLOYMENT_TARGET. To enable cross-language LTO to work | ||
// correctly, we do too. | ||
llvm_target: macos_llvm_target(arch).into(), | ||
pointer_width: 64, | ||
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".into(), | ||
arch: arch.target_arch(), | ||
options: TargetOptions { | ||
mcount: "\u{1}mcount".into(), | ||
frame_pointer: FramePointer::NonLeaf, | ||
..base | ||
}, | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
compiler/rustc_target/src/spec/targets/arm64e_apple_ios.rs
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,30 @@ | ||
use crate::spec::base::apple::{ios_llvm_target, opts, Arch}; | ||
use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; | ||
|
||
pub fn target() -> Target { | ||
let arch = Arch::Arm64e; | ||
let mut base = opts("ios", arch); | ||
base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::THREAD; | ||
|
||
Target { | ||
llvm_target: ios_llvm_target(arch).into(), | ||
pointer_width: 64, | ||
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".into(), | ||
arch: arch.target_arch(), | ||
options: TargetOptions { | ||
features: "+neon,+fp-armv8,+apple-a12,+v8.3a,+paca,+pacg".into(), | ||
max_atomic_width: Some(128), | ||
forces_embed_bitcode: true, | ||
frame_pointer: FramePointer::NonLeaf, | ||
bitcode_llvm_cmdline: "-triple\0\ | ||
arm64e-apple-ios14.1.0\0\ | ||
-emit-obj\0\ | ||
-disable-llvm-passes\0\ | ||
-target-abi\0\ | ||
darwinpcs\0\ | ||
-Os\0" | ||
.into(), | ||
..base | ||
}, | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# `arm64e-apple-darwin` | ||
|
||
**Tier: 3 (with Host Tools)** | ||
|
||
ARM64e macOS (11.0+, Big Sur+) | ||
|
||
## Target maintainers | ||
|
||
- Artyom Tetyukhin ([@arttet](https://github.com/https://github.com/arttet)) | ||
|
||
## Requirements | ||
|
||
Target for `macOS` on late-generation `M` series Apple chips. | ||
|
||
## 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-darwin" ] | ||
``` | ||
|
||
## 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 macOS 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. |
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,37 @@ | ||
# `arm64e-apple-ios` | ||
|
||
**Tier: 3** | ||
|
||
ARM64e iOS (12.0+) | ||
|
||
## Target maintainers | ||
|
||
- Artyom Tetyukhin ([@arttet](https://github.com/https://github.com/arttet)) | ||
|
||
## Requirements | ||
|
||
These targets only support cross-compilation. | ||
The targets do support `std`. | ||
|
||
## 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-ios" ] | ||
``` | ||
|
||
## 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 iOS 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. |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While its not a Git conflict, all of the legacy bitcode stuff was removed from the other targets last night in #117364. I can open a follow-up PR to remove it here as well if you don't want to do it since the timing is kinda awkward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could open a followup PR, that would be awesome :) I'd rather not have @arttet wait on another round of review (i.e. me)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do. I'll watch for this one to merge then followup.