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 5115fa7ec3a..9cadd1ceb10 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -1756,9 +1756,9 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "5:\tmovw r0, #0x000d\n\t" /* STATUS_INVALID_PARAMETER */ "movt r0, #0xc000\n\t" "add sp, sp, #0x10\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 f96ec330796..898f2555bbb 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -1864,9 +1864,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 751b0081534..b0026711044 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -2742,10 +2742,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 ab544908883..029374610b7 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -2821,9 +2821,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" -- GitLab