From 802a52cb1b9825a8baa63276b0e6620d7f4edc83 Mon Sep 17 00:00:00 2001 From: Brendan Shanks Date: Wed, 19 Jun 2024 15:36:27 -0700 Subject: [PATCH] ntdll: Make __wine_syscall_dispatcher_return a separate function to fix Xcode 16 build errors. LLVM no longer allows non-private labels to appear between .cfi_startproc/endproc when targeting Mach-O. For consistency, also modify ARM and i386. --- dlls/ntdll/unix/signal_arm.c | 6 +++--- dlls/ntdll/unix/signal_arm64.c | 6 +++--- dlls/ntdll/unix/signal_i386.c | 5 ++--- dlls/ntdll/unix/signal_x86_64.c | 6 +++--- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index a477d8d2ed8..77d66909135 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -1252,9 +1252,9 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "5:\tmovw r0, #0x000d\n\t" /* STATUS_INVALID_PARAMETER */ "movt r0, #0xc000\n\t" - "b " __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_return") "\n\t" - ".globl " __ASM_NAME("__wine_syscall_dispatcher_return") "\n" - __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t" + "b " __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_return") ) + +__ASM_GLOBAL_FUNC( __wine_syscall_dispatcher_return, "mov r8, r0\n\t" "mov r0, r1\n\t" "b " __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_return") ) diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index 58911d9b1f2..667bc1108cf 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -1607,9 +1607,9 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "ret x16\n" "4:\tmov x0, #0xc0000000\n\t" /* STATUS_INVALID_PARAMETER */ "movk x0, #0x000d\n\t" - "b " __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_return") "\n\t" - ".globl " __ASM_NAME("__wine_syscall_dispatcher_return") "\n" - __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t" + "b " __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_return") ) + +__ASM_GLOBAL_FUNC( __wine_syscall_dispatcher_return, "mov sp, x0\n\t" "mov x0, x1\n\t" "b " __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_return") ) diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 6457f0221bd..61d41ec3589 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -2768,10 +2768,9 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, __ASM_CFI("\t.cfi_restore_state\n") "6:\tmovl $0xc000000d,%eax\n\t" /* STATUS_INVALID_PARAMETER */ - "jmp " __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_return") "\n\t" + "jmp " __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_return") ) - ".globl " __ASM_NAME("__wine_syscall_dispatcher_return") "\n" - __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t" +__ASM_GLOBAL_FUNC( __wine_syscall_dispatcher_return, "movl 8(%esp),%eax\n\t" "movl 4(%esp),%esp\n\t" "jmp " __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_return") ) diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index a163d5d0b33..e84044fa805 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -2876,9 +2876,9 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, __ASM_CFI("\t.cfi_restore_state\n") "5:\tmovl $0xc000000d,%eax\n\t" /* STATUS_INVALID_PARAMETER */ "movq %rsp,%rcx\n\t" - "jmp " __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_return") "\n\t" - ".globl " __ASM_NAME("__wine_syscall_dispatcher_return") "\n" - __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t" + "jmp " __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_return") ) + +__ASM_GLOBAL_FUNC( __wine_syscall_dispatcher_return, "movq %rdi,%rcx\n\t" "movl 0xb0(%rcx),%r14d\n\t" /* frame->syscall_flags */ "movq %rsi,%rax\n\t"