https://bugs.winehq.org/show_bug.cgi?id=55051
Bug ID: 55051 Summary: Build regression in wine 8.10 using clang on aarch64 (error in backend: Invalid register name "x18") Product: Wine Version: 8.10 Hardware: aarch64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt Assignee: wine-bugs@winehq.org Reporter: pierrick.bouvier@linaro.org Distribution: ---
When compiling wine for aarch64, a build regression appeared in Wine 8.10 when using clang (any version). This is only present when performing make install, which compiles some DLL.
Error is that register x18 is used, and clang reports it as an hard error. gcc reports a warning but does not produce an error (warning: call-clobbered register used for global register variable).
---
Reproduction steps (from linux-aarch64, debian bookworm):
# download llvm-mingw and add to PATH $ ./configure CC="clang" --without-x --without-freetype --prefix=/usr $ make # works $ make install # fails clang -c -o dlls/msvcr110/onexit.o ... fatal error: error in backend: Invalid register name "x18". ... 3. Running pass 'Function Pass Manager' on module 'dlls/msvcrt/onexit.c'. 4. Running pass 'AArch64 Instruction Selection' on function '@_register_onexit_function'
---
Bisect pointed this commit: https://github.com/wine-mirror/wine/commit/56cfbf6b860b46768eeae60eef7dfe0a9... include: Only enable the non-inline NtCurrentTeb() on the Unix side.
This previous commit introduced register x18 for TEB on arm64 (but commit above makes it active): https://github.com/wine-mirror/wine/commit/7f088b0b1387a3b54c438b839046afadf...
This previous bug already discussed this topic (https://bugs.winehq.org/show_bug.cgi?id=38780) but I'm not sure what the conclusion would be.
---
Compiling with CLAGS=-ffixed-x18 silences clang, but I'm not sure it's the right thing to do. gcc works only because it's a warning and not an error.