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
This commit is contained in:
Brendan Shanks 2023-11-29 11:28:38 -08:00 committed by Alexandre Julliard
parent b088d311a0
commit 295d521b11

View file

@ -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