[PATCH 0/1] MR2158: ntdll: Fix compile error on ARM64 macOS.
Fix the error: ``` <inline asm>:305:2: error: conditional branch requires assembler-local label. '.L__wine_syscall_dispatcher_return' is external. cbnz w16, .L__wine_syscall_dispatcher_return ``` I don't know why LLVM/clang on macOS requires a local label for conditional branches. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54256 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2158
From: Brendan Shanks <bshanks(a)codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54256 --- dlls/ntdll/unix/signal_arm64.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index bd9818c808a..2684c1dcb67 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -1607,8 +1607,9 @@ __ASM_GLOBAL_FUNC( __wine_unix_call_dispatcher, "mov x0, x2\n\t" /* args */ "blr x16\n\t" "ldr w16, [sp, #0x10c]\n\t" /* frame->restore_flags */ - "cbnz w16, .L__wine_syscall_dispatcher_return\n\t" - "ldr x18, [sp, #0x90]\n\t" + "cbz w16, 1f\n\t" + "b .L__wine_syscall_dispatcher_return\n" + "1:\tldr x18, [sp, #0x90]\n\t" "ldp x16, x17, [sp, #0xf8]\n\t" "mov sp, x16\n\t" "ret x17" ) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2158
I don't know why LLVM/clang on macOS requires a local label for conditional branches.
I believe the issue is the other way around - it does require a local label for conditional branches everywhere. It's just that the definition of what is a local label is platform dependent. On macOS/MachO, extern C symbols are all prefixed with an underscore. Local labels are symbols that don't start with an underscore, but starts with a capital `L`. This is contrary to ELF where local labels are identifiers that start with a period `.`. I guess the proper way to handle this is to wrap this up in a macro or function, like how many other similar details are handled elsewhere. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2158#note_23774
Thanks for this fix. Really helped me out! -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2158#note_24145
participants (4)
-
Brendan Shanks -
Brendan Shanks (@bshanks) -
Jason Millard (@jsm174) -
Martin Storsjö