forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#77484 - terhechte:support-ios-catalyst-maca…
…bi-arm64-target-triple, r=nikomatsakis Add support for Arm64 Catalyst on ARM Macs This is an iteration on rust-lang#63467 which was merged a while ago. In the aforementioned PR, I added support for the `X86_64-apple-ios-macabi` target triple, which is Catalyst, iOS apps running on macOS. Very soon, Apple will launch ARM64 based Macs which will introduce `aarch64_apple_darwin.rs`, macOS apps using the Darwin ABI running on ARM. This PR adds support for Catalyst apps on ARM Macs: iOS apps compiled for the darwin ABI. I don't have access to a Apple Developer Transition Kit (DTK), so I can't really test if the generated binaries work correctly. I'm vaguely hopeful that somebody with access to a DTK could give this a spin.
- Loading branch information
Showing
5 changed files
with
43 additions
and
3 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
35 changes: 35 additions & 0 deletions
35
compiler/rustc_target/src/spec/aarch64_apple_ios_macabi.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,35 @@ | ||
use super::apple_sdk_base::{opts, Arch}; | ||
use crate::spec::{LinkerFlavor, Target, TargetOptions}; | ||
|
||
pub fn target() -> Target { | ||
let base = opts(Arch::Arm64_macabi); | ||
Target { | ||
llvm_target: "arm64-apple-ios14.2-macabi".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "64".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".to_string(), | ||
arch: "aarch64".to_string(), | ||
target_os: "ios".to_string(), | ||
target_env: String::new(), | ||
target_vendor: "apple".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
options: TargetOptions { | ||
features: "+neon,+fp-armv8,+apple-a12".to_string(), | ||
eliminate_frame_pointer: false, | ||
max_atomic_width: Some(128), | ||
unsupported_abis: super::arm_base::unsupported_abis(), | ||
forces_embed_bitcode: true, | ||
// Taken from a clang build on Xcode 11.4.1. | ||
// These arguments are not actually invoked - they just have | ||
// to look right to pass App Store validation. | ||
bitcode_llvm_cmdline: "-triple\0\ | ||
arm64-apple-ios14.2-macabi\0\ | ||
-emit-obj\0\ | ||
-disable-llvm-passes\0\ | ||
-Os\0" | ||
.to_string(), | ||
..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