forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#68191 - simlay:add-tvSO-target, r=nagisa
Added tvOS as targets This is a first attempt of adding support tvOS as described in rust-lang#48862. It's got a lot of overlap with [src/librustc_target/spec/apple_ios_base.rs](https://github.com/rust-lang/rust/blob/31dd4f4acbcbdb02b0745d2136399ed664a28050/src/librustc_target/spec/apple_ios_base.rs). I thought about refactoring `apple_ios_base.rs` to include this as well but that would require each of the ios and tvos targets to be of the something like the form `let base = opts(AppleOS::TV, Arch::Arm64)?;` I also did the same thing for watchOS because from what I can tell, all three targets (iOS, tvOS, and watchOS) have the same logic but have different parameters being sent to `xcrun`. Thoughts? As far as the `data_layout` and other parameters to `Target`, I did as much research as I could but it really seems that processor in the [iPhone 11 is the same as the apple TV](https://en.wikipedia.org/wiki/Apple-designed_processors) so I didn't change any of those parameters. I did get this to build and tested that it's actually running the the below logic (because the parameter to `xcrun` is `appletvos` not `tvos`). I didn't manage to get it to actually compile a file with `fn main(){}` because I don't have the stdlib for `aarch64-apple-tvos` compiled it seems. Is there documentation for this? Similar to the ending of rust-lang#63467, I'm not sure what to do next.
- Loading branch information
Showing
10 changed files
with
90 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use super::apple_sdk_base::{opts, AppleOS, Arch}; | ||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let base = opts(Arch::Arm64, AppleOS::tvOS)?; | ||
Ok(Target { | ||
llvm_target: "arm64-apple-tvos".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: "tvos".to_string(), | ||
target_env: String::new(), | ||
target_vendor: "apple".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
options: TargetOptions { | ||
features: "+neon,+fp-armv8,+cyclone".to_string(), | ||
eliminate_frame_pointer: false, | ||
max_atomic_width: Some(128), | ||
abi_blacklist: super::arm_base::abi_blacklist(), | ||
..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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use super::apple_sdk_base::{opts, AppleOS, Arch}; | ||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let base = opts(Arch::X86_64, AppleOS::iOS)?; | ||
Ok(Target { | ||
llvm_target: "x86_64-apple-tvos".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-f80:128-n8:16:32:64-S128".to_string(), | ||
arch: "x86_64".to_string(), | ||
target_os: "tvos".to_string(), | ||
target_env: String::new(), | ||
target_vendor: "apple".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
options: TargetOptions { max_atomic_width: Some(64), stack_probes: true, ..base }, | ||
}) | ||
} |