<div dir='auto'><div>Signed-off-by: AndrĂ© Hentschel <nerv@dawncrow.de><br><div class="gmail_extra" dir="auto"><br></div><div class="gmail_extra" dir="auto"><br></div><div class="gmail_extra"> (Second try from smartphone)<br><div class="gmail_quote">Am 26.06.2017 9:14 vorm. schrieb Martin Storsjo <martin@martin.st>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">On aarch64/arm64 on linux, the compiler is free to use x18 for normal<br>
code generation (while the register is reserved on iOS/darwin, and<br>
on windows).</p>
<p dir="ltr">If targeting arm64, check for the flags that allows this register to<br>
be left untouched (the flag is supported both by gcc and clang).</p>
<p dir="ltr">This makes sure that wine for aarch64 built with clang doesn't<br>
crash immediately on startup. (clang/llvm seems to be more eager on<br>
using this register than gcc.)</p>
<p dir="ltr">Similar issues can still pop up as soon as system library functions<br>
that happen to touch x18 are called, unless the system libraries have<br>
been built with the same flag.</p>
<p dir="ltr">Signed-off-by: Martin Storsjo <martin@martin.st><br>
---<br>
Changed to try a different flag which is supported by both gcc and clang.<br>
(Internally, clang maps it to the flag used in the previous generation<br>
of the patch.) Reworded the commit message to clarify that the same issue<br>
is present with gcc as well (although I hit the issue sooner with clang).</p>
<p dir="ltr">Also clarified, both in the commit message and in the configure comment,<br>
that this issue isn't a complete fix.<br>
---<br>
 configure.ac | 6 ++++++<br>
 1 file changed, 6 insertions(+)</p>
<p dir="ltr">diff --git a/configure.ac b/configure.ac<br>
index 7ae29f7..fe98b80 100644<br>
--- a/configure.ac<br>
+++ b/configure.ac<br>
@@ -179,6 +179,12 @@ case $host in<br>
     CFLAGS="$CFLAGS -marm"<br>
     AC_SUBST(TARGETFLAGS,"-marm")<br>
     ;;<br>
+  aarch64*)<br>
+    # Avoid clobbering the x18 register which is reserved in windows.<br>
+    # This isn't complete/enough unless all of the system libraries have<br>
+    # been built with the same flag though.<br>
+    WINE_TRY_CFLAGS([-ffixed-x18], [CFLAGS="$CFLAGS -ffixed-x18"])<br>
+    ;;<br>
   i[[3456789]]86*)<br>
     enable_win16=${enable_win16:-yes}<br>
     ;;<br>
-- <br>
2.7.4<br><br></p>
</blockquote></div><br></div></div></div>