From b85b31c2db1ac6faed8ab9f220b65d6f8a2d1541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Tue, 4 Aug 2026 16:26:15 +0200 Subject: [PATCH] Fix Mach-O assembly selection for watchOS and visionOS psm fails to build for *-apple-watchos and *-apple-visionos: src/arch/aarch_aapcs64.s:32:1: error: unknown directive .type rust_psm_stack_direction,@function build.rs defines CFG_TARGET_OS_ generically from CARGO_CFG_TARGET_OS, but the Mach-O branch in the four affected .s files enumerates only four of the Apple OS names. For watchOS and visionOS the macro is CFG_TARGET_OS_watchos / CFG_TARGET_OS_visionos, no branch matches, and the file falls through to the #else ELF branch -- emitting .type and .size, which the Mach-O assembler rejects. macOS, iOS and tvOS are unaffected, which is why this went unnoticed. Add the two missing OS names to the Apple branch in all four files that carry the guard: aarch_aapcs64.s, arm_aapcs.s, x86.s, x86_64.s. --- psm/src/arch/aarch_aapcs64.s | 2 +- psm/src/arch/arm_aapcs.s | 2 +- psm/src/arch/x86.s | 2 +- psm/src/arch/x86_64.s | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/psm/src/arch/aarch_aapcs64.s b/psm/src/arch/aarch_aapcs64.s index 656901b..f552c25 100644 --- a/psm/src/arch/aarch_aapcs64.s +++ b/psm/src/arch/aarch_aapcs64.s @@ -3,7 +3,7 @@ .text -#if defined(CFG_TARGET_OS_darwin) || defined(CFG_TARGET_OS_macos) || defined(CFG_TARGET_OS_ios) || defined(CFG_TARGET_OS_tvos) +#if defined(CFG_TARGET_OS_darwin) || defined(CFG_TARGET_OS_macos) || defined(CFG_TARGET_OS_ios) || defined(CFG_TARGET_OS_tvos) || defined(CFG_TARGET_OS_watchos) || defined(CFG_TARGET_OS_visionos) #define GLOBL(fnname) .globl _##fnname #define TYPE(fnname) diff --git a/psm/src/arch/arm_aapcs.s b/psm/src/arch/arm_aapcs.s index d95b80f..f3f35d9 100644 --- a/psm/src/arch/arm_aapcs.s +++ b/psm/src/arch/arm_aapcs.s @@ -4,7 +4,7 @@ .text .syntax unified -#if defined(CFG_TARGET_OS_darwin) || defined(CFG_TARGET_OS_macos) || defined(CFG_TARGET_OS_ios) || defined(CFG_TARGET_OS_tvos) +#if defined(CFG_TARGET_OS_darwin) || defined(CFG_TARGET_OS_macos) || defined(CFG_TARGET_OS_ios) || defined(CFG_TARGET_OS_tvos) || defined(CFG_TARGET_OS_watchos) || defined(CFG_TARGET_OS_visionos) #define GLOBL(fnname) .globl _##fnname #define THUMBTYPE(fnname) .thumb_func _##fnname diff --git a/psm/src/arch/x86.s b/psm/src/arch/x86.s index 2a9e83c..99fbd4e 100644 --- a/psm/src/arch/x86.s +++ b/psm/src/arch/x86.s @@ -4,7 +4,7 @@ .text -#if defined(CFG_TARGET_OS_darwin) || defined(CFG_TARGET_OS_macos) || defined(CFG_TARGET_OS_ios) || defined(CFG_TARGET_OS_tvos) +#if defined(CFG_TARGET_OS_darwin) || defined(CFG_TARGET_OS_macos) || defined(CFG_TARGET_OS_ios) || defined(CFG_TARGET_OS_tvos) || defined(CFG_TARGET_OS_watchos) || defined(CFG_TARGET_OS_visionos) #define GLOBL(fnname) .globl _##fnname #define TYPE(fnname) diff --git a/psm/src/arch/x86_64.s b/psm/src/arch/x86_64.s index 5b1b5f2..778d4d9 100644 --- a/psm/src/arch/x86_64.s +++ b/psm/src/arch/x86_64.s @@ -4,7 +4,7 @@ .text -#if defined(CFG_TARGET_OS_darwin) || defined(CFG_TARGET_OS_macos) || defined(CFG_TARGET_OS_ios) || defined(CFG_TARGET_OS_tvos) +#if defined(CFG_TARGET_OS_darwin) || defined(CFG_TARGET_OS_macos) || defined(CFG_TARGET_OS_ios) || defined(CFG_TARGET_OS_tvos) || defined(CFG_TARGET_OS_watchos) || defined(CFG_TARGET_OS_visionos) #define GLOBL(fnname) .globl _##fnname #define TYPE(fnname)