Skip to content

Commit de13bd3

Browse files
committed
[watchos] Update WatchOs support - add to supported platforms
1 parent 5aee29b commit de13bd3

File tree

11 files changed

+23
-21
lines changed

11 files changed

+23
-21
lines changed

Cargo.lock

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,8 @@ version = "0.1.0"
490490

491491
[[package]]
492492
name = "cc"
493-
version = "1.0.69"
494-
source = "registry+https://github.com/rust-lang/crates.io-index"
495-
checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2"
493+
version = "1.0.73"
494+
source = "git+https://github.com/alexcrichton/cc-rs?rev=refs/pull/662/head#73f8fe4b5c0024d855398e4fa4ae68b5b82221f2"
496495
dependencies = [
497496
"jobserver",
498497
]
@@ -734,8 +733,7 @@ dependencies = [
734733
[[package]]
735734
name = "compiler_builtins"
736735
version = "0.1.70"
737-
source = "registry+https://github.com/rust-lang/crates.io-index"
738-
checksum = "80873f979f0a344a4ade87c2f70d9ccf5720b83b10c97ec7cd745895d021e85a"
736+
source = "git+https://github.com/rust-lang/compiler-builtins?rev=refs/pull/456/head#eb68e3a2f2a0bd4ea625e4287c2eb2069d1c4fa2"
739737
dependencies = [
740738
"cc",
741739
"rustc-std-workspace-core",
@@ -1965,9 +1963,8 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
19651963

19661964
[[package]]
19671965
name = "libc"
1968-
version = "0.2.116"
1969-
source = "registry+https://github.com/rust-lang/crates.io-index"
1970-
checksum = "565dbd88872dbe4cc8a46e527f26483c1d1f7afa6b884a3bd6cd893d4f98da74"
1966+
version = "0.2.119"
1967+
source = "git+https://github.com/rust-lang/libc?rev=refs/pull/2717/head#f073685f728891f104bf2125f1bcb9f123cf5d3b"
19711968
dependencies = [
19721969
"rustc-std-workspace-core",
19731970
]

Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,11 @@ rustfmt-nightly = { path = "src/tools/rustfmt" }
125125
# See comments in `src/tools/rustc-workspace-hack/README.md` for what's going on
126126
# here
127127
rustc-workspace-hack = { path = 'src/tools/rustc-workspace-hack' }
128-
cc = { git = "https://github.com/vladimir-ea/cc-rs", branch = "watch_os" }
129-
libc = { git = "https://github.com/vladimir-ea/libc", branch = "watch_os" }
128+
129+
# TODO prerequisite changes
130+
compiler_builtins = { git = "https://github.com/rust-lang/compiler-builtins", rev = "refs/pull/456/head" }
131+
cc = { git = "https://github.com/alexcrichton/cc-rs", rev = "refs/pull/662/head" }
132+
libc = { git = "https://github.com/rust-lang/libc", rev = "refs/pull/2717/head" }
130133

131134
# See comments in `library/rustc-std-workspace-core/README.md` for what's going on
132135
# here

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,7 +2475,7 @@ fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
24752475
("x86_64", "watchos") => "watchsimulator",
24762476
("arm64_32", "watchos") => "watchos",
24772477
("aarch64", "watchos") => "watchos",
2478-
("armv7k", "watchos") => "watchos",
2478+
("arm", "watchos") => "watchos",
24792479
_ => {
24802480
sess.err(&format!("unsupported arch `{}` for os `{}`", arch, os));
24812481
return;
@@ -2533,7 +2533,7 @@ fn get_apple_sdk_root(sdk_name: &str) -> Result<String, String> {
25332533
}
25342534
}
25352535
let res =
2536-
Command::new("xcrunp").arg("--show-sdk-path").arg("-sdk").arg(sdk_name).output().and_then(
2536+
Command::new("xcrun").arg("--show-sdk-path").arg("-sdk").arg(sdk_name).output().and_then(
25372537
|output| {
25382538
if output.status.success() {
25392539
Ok(String::from_utf8(output.stdout).unwrap())

compiler/rustc_target/src/spec/apple_sdk_base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub enum Arch {
1818

1919
fn target_abi(arch: Arch) -> String {
2020
match arch {
21-
Armv7 | Armv7s | Arm64 | I386 | X86_64 => "",
21+
Armv7 | Armv7k | Armv7s | Arm64 | Arm64_32 | I386 | X86_64 => "",
2222
X86_64_macabi | Arm64_macabi => "macabi",
2323
Arm64_sim => "sim",
2424
}

compiler/rustc_target/src/spec/arm64_32_apple_watchos.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pub fn target() -> Target {
1111
options: TargetOptions {
1212
features: "+neon,+fp-armv8,+apple-a7".to_string(),
1313
max_atomic_width: Some(64),
14-
unsupported_abis: super::arm_base::unsupported_abis(),
1514
forces_embed_bitcode: true,
1615
// These arguments are not actually invoked - they just have
1716
// to look right to pass App Store validation.

compiler/rustc_target/src/spec/armv7k_apple_watchos.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pub fn target() -> Target {
1111
options: TargetOptions {
1212
features: "+v7,+vfp4,+neon".to_string(),
1313
max_atomic_width: Some(64),
14-
unsupported_abis: super::arm_base::unsupported_abis(),
1514
forces_embed_bitcode: true,
1615
// These arguments are not actually invoked - they just have
1716
// to look right to pass App Store validation.

compiler/rustc_target/src/spec/x86_64_apple_watchos_sim.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::apple_sdk_base::{opts, Arch};
2-
use crate::spec::{StackProbeType, Target, TargetOptions};
2+
use crate::spec::{StackProbeType, Target, TargetOptions, LinkerFlavor, LldFlavor};
33

44
pub fn target() -> Target {
55
let base = opts("watchos", Arch::X86_64);
@@ -8,9 +8,9 @@ pub fn target() -> Target {
88
let llvm_target = super::apple_base::watchos_sim_llvm_target(arch);
99

1010
Target {
11-
llvm_target: llvm_target,
11+
llvm_target,
1212
pointer_width: 64,
13-
data_layout: "e-m:o-i64:64-f80:128-n8:16:32:64-S128".to_string(),
13+
data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128".to_string(),
1414
arch: "x86_64".to_string(),
1515
options: TargetOptions {
1616
max_atomic_width: Some(64),

library/std/src/sys/unix/fs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
1717
all(target_os = "linux", target_env = "gnu"),
1818
target_os = "macos",
1919
target_os = "ios",
20+
target_os = "watchos",
2021
))]
2122
use crate::sys::weak::syscall;
2223
#[cfg(target_os = "macos")]
@@ -27,6 +28,7 @@ use libc::{c_int, mode_t};
2728
#[cfg(any(
2829
target_os = "macos",
2930
target_os = "ios",
31+
target_os = "watchos",
3032
all(target_os = "linux", target_env = "gnu")
3133
))]
3234
use libc::c_char;
@@ -714,6 +716,7 @@ impl DirEntry {
714716
#[cfg(not(any(
715717
target_os = "macos",
716718
target_os = "ios",
719+
target_os = "watchos",
717720
target_os = "netbsd",
718721
target_os = "openbsd",
719722
target_os = "freebsd",

library/std/src/sys/unix/locks/pthread_condvar.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ impl Condvar {
9595
target_os = "watchos",
9696
target_os = "android",
9797
target_os = "espidf"
98-
target_os = "android",
9998
)))]
10099
pub unsafe fn wait_timeout(&self, mutex: &Mutex, dur: Duration) -> bool {
101100
use crate::mem;
@@ -129,7 +128,6 @@ impl Condvar {
129128
target_os = "watchos",
130129
target_os = "android",
131130
target_os = "espidf"
132-
target_os = "android",
133131
))]
134132
pub unsafe fn wait_timeout(&self, mutex: &Mutex, mut dur: Duration) -> bool {
135133
use crate::ptr;

library/unwind/src/libunwind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub const unwinder_private_data_size: usize = 6;
3333
#[cfg(all(target_arch = "arm", not(any(target_os = "ios", target_os = "watchos"))))]
3434
pub const unwinder_private_data_size: usize = 20;
3535

36-
#[cfg(all(target_arch = "arm", any(target_os = "ios", target_os = "watchos")))]
36+
#[cfg(all(any(target_arch = "arm", target_arch="arm64_32"), any(target_os = "ios", target_os = "watchos")))]
3737
pub const unwinder_private_data_size: usize = 5;
3838

3939
#[cfg(all(target_arch = "aarch64", target_pointer_width = "64"))]

src/doc/rustc/src/platform-support.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ target | std | host | notes
217217
`aarch64-wrs-vxworks` | ? | |
218218
`aarch64_be-unknown-linux-gnu_ilp32` | ✓ | ✓ | ARM64 Linux (big-endian, ILP32 ABI)
219219
`aarch64_be-unknown-linux-gnu` | ✓ | ✓ | ARM64 Linux (big-endian)
220+
`arm64_32-apple-watchos` | ✓ | | ARM Apple WatchOS 64-bit with 32-bit pointers
220221
`armv4t-unknown-linux-gnueabi` | ? | |
221222
`armv5te-unknown-linux-uclibceabi` | ? | | ARMv5TE Linux with uClibc
222223
`armv6-unknown-freebsd` | ✓ | ✓ | ARMv6 FreeBSD
@@ -231,6 +232,7 @@ target | std | host | notes
231232
[`armv7a-kmc-solid_asp3-eabi`](platform-support/kmc-solid.md) | ✓ | | ARM SOLID with TOPPERS/ASP3
232233
[`armv7a-kmc-solid_asp3-eabihf`](platform-support/kmc-solid.md) | ✓ | | ARM SOLID with TOPPERS/ASP3, hardfloat
233234
`armv7a-none-eabihf` | * | | ARM Cortex-A, hardfloat
235+
`armv7k-apple-watchos` | ✓ | | ARM Apple WatchOS
234236
`armv7s-apple-ios` | ✓ | |
235237
`avr-unknown-gnu-atmega328` | * | | AVR. Requires `-Z build-std=core`
236238
`bpfeb-unknown-none` | * | | BPF (big endian)
@@ -286,6 +288,7 @@ target | std | host | notes
286288
[`wasm64-unknown-unknown`](platform-support/wasm64-unknown-unknown.md) | ? | | WebAssembly
287289
`x86_64-apple-ios-macabi` | ✓ | | Apple Catalyst on x86_64
288290
`x86_64-apple-tvos` | * | | x86 64-bit tvOS
291+
`x86_64-apple-watchos-sim` | ✓ | | x86 64-bit Apple WatchOS simulator
289292
`x86_64-pc-windows-msvc` | * | | 64-bit Windows XP support
290293
`x86_64-sun-solaris` | ? | | Deprecated target for 64-bit Solaris 10/11, illumos
291294
`x86_64-unknown-dragonfly` | ✓ | ✓ | 64-bit DragonFlyBSD

0 commit comments

Comments
 (0)