Module: wine Branch: master Commit: 295d521b11644fb76c36854336b13c2155bb7d79 URL: https://gitlab.winehq.org/wine/wine/-/commit/295d521b11644fb76c36854336b13c2...
Author: Brendan Shanks bshanks@codeweavers.com Date: Wed Nov 29 11:28:38 2023 -0800
ntdll: Fix macOS build error with LLVM 17.
LLVM no longer allows non-private labels to appear between .cfi_startproc/endproc when targeting Mach-O.
Based on a patch by Jacek Caban.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55863
---
dlls/ntdll/unix/signal_x86_64.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index ea177982d05..0c291633ac6 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -1892,15 +1892,15 @@ static BOOL handle_syscall_trap( ucontext_t *sigcontext )
if ((void *)RIP_sig( sigcontext ) == __wine_syscall_dispatcher) { - extern void __wine_syscall_dispatcher_prolog_end(void); + extern const void *__wine_syscall_dispatcher_prolog_end_ptr;
- RIP_sig( sigcontext ) = (ULONG64)__wine_syscall_dispatcher_prolog_end; + RIP_sig( sigcontext ) = (ULONG64)__wine_syscall_dispatcher_prolog_end_ptr; } else if ((void *)RIP_sig( sigcontext ) == __wine_unix_call_dispatcher) { - extern void __wine_unix_call_dispatcher_prolog_end(void); + extern const void *__wine_unix_call_dispatcher_prolog_end_ptr;
- RIP_sig( sigcontext ) = (ULONG64)__wine_unix_call_dispatcher_prolog_end; + RIP_sig( sigcontext ) = (ULONG64)__wine_unix_call_dispatcher_prolog_end_ptr; R10_sig( sigcontext ) = RCX_sig( sigcontext ); } else return FALSE; @@ -2607,8 +2607,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "popq 0x80(%rcx)\n\t" __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") "movl $0,0xb4(%rcx)\n\t" /* frame->restore_flags */ - ".globl " __ASM_NAME("__wine_syscall_dispatcher_prolog_end") "\n" - __ASM_NAME("__wine_syscall_dispatcher_prolog_end") ":\n\t" + __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_prolog_end") ":\n\t" "movq %rax,0x00(%rcx)\n\t" "movq %rbx,0x08(%rcx)\n\t" __ASM_CFI_REG_IS_AT1(rbx, rcx, 0x08) @@ -2844,8 +2843,7 @@ __ASM_GLOBAL_FUNC( __wine_unix_call_dispatcher, __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") __ASM_CFI_REG_IS_AT2(rip, rcx, 0xf0,0x00) "movl $0,0xb4(%rcx)\n\t" /* frame->restore_flags */ - ".globl " __ASM_NAME("__wine_unix_call_dispatcher_prolog_end") "\n" - __ASM_NAME("__wine_unix_call_dispatcher_prolog_end") ":\n\t" + __ASM_LOCAL_LABEL("__wine_unix_call_dispatcher_prolog_end") ":\n\t" "movq %rbx,0x08(%rcx)\n\t" __ASM_CFI_REG_IS_AT1(rbx, rcx, 0x08) "movq %rsi,0x20(%rcx)\n\t" @@ -2943,6 +2941,14 @@ __ASM_GLOBAL_FUNC( __wine_unix_call_dispatcher, __ASM_CFI(".cfi_adjust_cfa_offset 8\n\t") "ret" )
+asm( ".data\n\t" + ".globl " __ASM_NAME("__wine_syscall_dispatcher_prolog_end_ptr") "\n" + __ASM_NAME("__wine_syscall_dispatcher_prolog_end_ptr") ":\n\t" + ".quad " __ASM_LOCAL_LABEL("__wine_syscall_dispatcher_prolog_end") "\n\t" + ".globl " __ASM_NAME("__wine_unix_call_dispatcher_prolog_end_ptr") "\n" + __ASM_NAME("__wine_unix_call_dispatcher_prolog_end_ptr") ":\n\t" + ".quad " __ASM_LOCAL_LABEL("__wine_unix_call_dispatcher_prolog_end") "\n\t" + ".text\n\t" );
/*********************************************************************** * __wine_setjmpex