https://bugs.winehq.org/show_bug.cgi?id=55863
Bug ID: 55863 Summary: Wine fails to build on macOS with LLVM 17 Product: Wine Version: 8.19 Hardware: x86-64 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@winehq.org Reporter: bshanks@codeweavers.com
When building Wine on macOS with LLVM 17 (i.e. from Homebrew), the build fails with:
clang -arch x86_64 -m64 -c -o dlls/ntdll/unix/signal_x86_64.o ../dlls/ntdll/unix/signal_x86_64.c -Idlls/ntdll -I../dlls/ntdll -Iinclude \ -I../include -D__WINESRC__ -D_NTSYSTEM_ -D_ACRTIMP= -DWINBASEAPI= -DWINE_UNIX_LIB -Wall -pipe \ -fcf-protection=none -fno-stack-protector -fno-strict-aliasing -Wdeclaration-after-statement \ -Wempty-body -Wignored-qualifiers -Winit-self -Wno-pragma-pack -Wstrict-prototypes -Wtype-limits \ -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -gdwarf-4 -fPIC \ -fasynchronous-unwind-tables -g -O2 -fPIC -Wall -Wdeclaration-after-statement -Wwrite-strings -Wtype-limits -march=core2 -mfpmath=sse -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 In file included from ../dlls/ntdll/unix/signal_x86_64.c:81: ../dlls/ntdll/unix/dwarf.h:915:45: warning: taking the absolute value of unsigned type 'ULONG_PTR' (aka 'unsigned long') has no effect [-Wabsolute-value] 915 | case DW_OP_abs: stack[sp] = labs(stack[sp]); break; | ^ ../dlls/ntdll/unix/dwarf.h:915:45: note: remove the call to 'labs' since unsigned values cannot be negative 915 | case DW_OP_abs: stack[sp] = labs(stack[sp]); break; | ^~~~ <inline asm>:159:2: error: invalid CFI advance_loc expression 159 | .cfi_escape 0x10, 0x03, 0x02, 0x72, 0x08 | ^ <inline asm>:362:2: error: invalid CFI advance_loc expression 362 | .cfi_escape 0x10, 0x03, 0x02, 0x72, 0x08 | ^ 1 warning and 2 errors generated. make: *** [dlls/ntdll/unix/signal_x86_64.o] Error 1
This is caused by a recent LLVM change to "reject CFI advance_loc separated by a non-private label for Mach-O":
https://reviews.llvm.org/D153167
I believe the lines causing errors are '__ASM_CFI_REG_IS_AT1(rbx, rcx, 0x08)' in __wine_syscall_dispatcher and '__ASM_CFI_REG_IS_AT1(rbx, rcx, 0x08)' in __wine_unix_call_dispatcher, but it's not specifically those lines, the problem is all the CFI advance_loc calls in those functions after the .globl labels.