[PATCH v2] configure: Avoid clobbering x18 on arm64 when building with clang

Martin Storsjö martin at martin.st
Fri Jun 23 00:16:22 CDT 2017


On Thu, 22 Jun 2017, Alexandre Julliard wrote:

> Martin Storsjo <martin at martin.st> writes:
>
>> On aarch64/arm64, clang/LLVM feels free to use x18 for normal code
>> generation on linux (while the register is reserved on iOS/darwin).
>> For windows/arm64, this register must not be clobbered.
>
> This would have to be made the default system-wide, fixing it on the
> Wine side isn't good enough since we call system libraries.

Fair point. However, it seems like gcc never uses this register (which 
probably is why the arm64 build has seemed to work more or less so far). 
So this would only be an issue with clang-built system libraries. At least 
it has seemed to not have been an issue in debian jessie/arm64 (presumably 
built with gcc), with a gcc-built wine.

FWIW, I tested out wine for arm64 with some of the few arm64 exes present 
in the win10 sdk (afaik the only public source of windows arm64 
binaries?), and it generally seems to work, except for ms va_list 
handling - something like __builtin_ms_va_list (like on x86_64) is needed 
from the compiler.

I tried implementing this in clang (since I'm much more familiar with 
that codebase already, than with gcc), see https://reviews.llvm.org/D34475. 
However, in order for my clang-built wine not to fail right away on things 
my gcc-built wine handled fine, I had to set this flag for the full wine build.

I agree this would be an issue with clang built system libraries on linux 
though. Is it still worthwhile to add to configure, for cases where 
system libraries have been built with gcc? If not, I'll just keep 
on adding it manually to my cflags when configuring, while experimenting 
with this.

// Martin



More information about the wine-devel mailing list