From: Martin Storsjo Subject: [PATCH v2] configure: Avoid clobbering x18 on arm64 when building with clang Message-Id: <1498041582-15269-1-git-send-email-martin@martin.st> Date: Wed, 21 Jun 2017 13:39:42 +0300 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. If targeting arm64, check for the clang cflags that allows this register to be left untouched. This makes sure that wine for aarch64 built with clang doesn't crash immediately on startup. Signed-off-by: Martin Storsjo --- Now with the sign-off included, which was forgotten in v1. --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 7ae29f7..5b5a1d8 100644 --- a/configure.ac +++ b/configure.ac @@ -179,6 +179,11 @@ case $host in CFLAGS="$CFLAGS -marm" AC_SUBST(TARGETFLAGS,"-marm") ;; + aarch64*) + # Clang needs these flags in order not to clobber the x18 register + WINE_TRY_CFLAGS([-Xclang -target-feature -Xclang +reserve-x18], + [CFLAGS="$CFLAGS -Xclang -target-feature -Xclang +reserve-x18"]) + ;; i[[3456789]]86*) enable_win16=${enable_win16:-yes} ;; -- 2.7.4