Skip to content

Commit 52960d4

Browse files
committed
Fixed builds with modified libc
1 parent 572d6cd commit 52960d4

File tree

11 files changed

+15
-12
lines changed

11 files changed

+15
-12
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2967,7 +2967,7 @@ fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
29672967
("aarch64", "watchos") if llvm_target.ends_with("-simulator") => "watchsimulator",
29682968
("aarch64", "watchos") => "watchos",
29692969
("aarch64", "visionos") if llvm_target.ends_with("-simulator") => "xrsimulator",
2970-
("aarch64", "visionos") => "visionos",
2970+
("aarch64", "visionos") => "xros",
29712971
("arm", "watchos") => "watchos",
29722972
(_, "macos") => "macosx",
29732973
_ => {
@@ -3025,10 +3025,10 @@ fn get_apple_sdk_root(sdk_name: &str) -> Result<String, errors::AppleSdkRootErro
30253025
"watchsimulator"
30263026
if sdkroot.contains("WatchOS.platform") || sdkroot.contains("MacOSX.platform") => {}
30273027
"visionos"
3028-
if sdkroot.contains("visionos.platform") || sdkroot.contains("MacOSX.platform") => {
3028+
if sdkroot.contains("XROS.platform") || sdkroot.contains("MacOSX.platform") => {
30293029
}
30303030
"visionossimulator"
3031-
if sdkroot.contains("visionos.platform") || sdkroot.contains("MacOSX.platform") => {
3031+
if sdkroot.contains("XROS.platform") || sdkroot.contains("MacOSX.platform") => {
30323032
}
30333033
// Ignore `SDKROOT` if it's not a valid path.
30343034
_ if !p.is_absolute() || p == Path::new("/") || !p.exists() => {}

compiler/rustc_target/src/spec/base/apple/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ fn link_env_remove(os: &'static str) -> StaticCow<[StaticCow<str>]> {
297297
|| sdkroot.contains("AppleTVSimulator.platform")
298298
|| sdkroot.contains("WatchOS.platform")
299299
|| sdkroot.contains("WatchSimulator.platform")
300-
|| sdkroot.contains("visionos.platform")
300+
|| sdkroot.contains("XROS.platform")
301301
{
302302
env_remove.push("SDKROOT".into())
303303
}
@@ -307,7 +307,7 @@ fn link_env_remove(os: &'static str) -> StaticCow<[StaticCow<str>]> {
307307
// although this is apparently ignored when using the linker at "/usr/bin/ld".
308308
env_remove.push("IPHONEOS_DEPLOYMENT_TARGET".into());
309309
env_remove.push("TVOS_DEPLOYMENT_TARGET".into());
310-
env_remove.push("VISIONOS_DEPLOYMENT_TARGET".into());
310+
env_remove.push("XROS_DEPLOYMENT_TARGET".into());
311311
env_remove.into()
312312
} else {
313313
// Otherwise if cross-compiling for a different OS/SDK (including Mac Catalyst), remove any part
@@ -375,7 +375,7 @@ pub fn watchos_sim_llvm_target(arch: Arch) -> String {
375375

376376
fn visionos_deployment_target() -> (u32, u32) {
377377
// If you are looking for the default deployment target, prefer `rustc --print deployment-target`.
378-
from_set_deployment_target("VISIONOS_DEPLOYMENT_TARGET").unwrap_or((1, 0))
378+
from_set_deployment_target("XROS_DEPLOYMENT_TARGET").unwrap_or((1, 0))
379379
}
380380

381381
pub fn visionos_llvm_target(arch: Arch) -> String {

compiler/rustc_target/src/spec/base/apple/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn macos_link_environment_unmodified() {
3737
crate::spec::cvs![
3838
"IPHONEOS_DEPLOYMENT_TARGET",
3939
"TVOS_DEPLOYMENT_TARGET",
40-
"VISIONOS_DEPLOYMENT_TARGET"
40+
"XROS_DEPLOYMENT_TARGET"
4141
],
4242
);
4343
}

compiler/rustc_target/src/spec/targets/aarch64_apple_visionos.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ pub fn target() -> Target {
1515
std: None,
1616
},
1717
pointer_width: 64,
18-
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
18+
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".into(),
1919
arch: arch.target_arch(),
2020
options: TargetOptions {
21-
features: "+neon,+fp-armv8,+apple-a12".into(),
21+
features: "+neon,+fp-armv8,+apple-a16".into(),
2222
max_atomic_width: Some(128),
2323
frame_pointer: FramePointer::NonLeaf,
2424
..base

compiler/rustc_target/src/spec/targets/aarch64_apple_visionos_sim.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ pub fn target() -> Target {
1515
std: None,
1616
},
1717
pointer_width: 64,
18-
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
18+
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".into(),
1919
arch: arch.target_arch(),
2020
options: TargetOptions {
21-
features: "+neon,+fp-armv8,+apple-m1".into(),
21+
features: "+neon,+fp-armv8,+apple-a16".into(),
2222
max_atomic_width: Some(128),
2323
frame_pointer: FramePointer::NonLeaf,
2424
..base

library/std/src/os/unix/net/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ mod tests;
2020
target_os = "ios",
2121
target_os = "tvos",
2222
target_os = "watchos",
23+
target_os = "visionos",
2324
target_os = "macos",
2425
target_os = "netbsd",
2526
target_os = "openbsd",
@@ -46,6 +47,7 @@ pub use self::stream::*;
4647
target_os = "ios",
4748
target_os = "tvos",
4849
target_os = "watchos",
50+
target_os = "visionos",
4951
target_os = "macos",
5052
target_os = "netbsd",
5153
target_os = "openbsd",

library/std/src/os/unix/net/stream.rs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
target_os = "tvos",
88
target_os = "macos",
99
target_os = "watchos",
10+
target_os = "visionos",
1011
target_os = "netbsd",
1112
target_os = "openbsd"
1213
))]
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/librustdoc/clean/cfg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ impl<'a> fmt::Display for Display<'a> {
511511
"wasi" => "WASI",
512512
"watchos" => "watchOS",
513513
"windows" => "Windows",
514-
"visionos" => "visionos",
514+
"visionos" => "visionOS",
515515
_ => "",
516516
},
517517
(sym::target_arch, Some(arch)) => match arch.as_str() {

0 commit comments

Comments
 (0)