php7: add a patch to fix build on aarch64
authorMichael Heimpold <redacted>
Wed, 11 Jan 2017 21:08:54 +0000 (22:08 +0100)
committerMichael Heimpold <redacted>
Wed, 11 Jan 2017 21:24:26 +0000 (22:24 +0100)
This fixes the following build error, spotted by the LEDE buildbots:

{standard input}: Assembler messages:
{standard input}:557: Error: operand 3 should be an integer register -- `mul x0,x0,1048576'
{standard input}:558: Error: operand 3 should be an integer register -- `smulh x1,x0,1048576'
Makefile:1466: recipe for target 'ext/opcache/zend_accelerator_module.lo' failed

Signed-off-by: Michael Heimpold <redacted>
lang/php7/patches/1005-fix-asm-constraints-in-aarch64-multiply-macro.patch [new file with mode: 0644]

diff --git a/lang/php7/patches/1005-fix-asm-constraints-in-aarch64-multiply-macro.patch b/lang/php7/patches/1005-fix-asm-constraints-in-aarch64-multiply-macro.patch
new file mode 100644 (file)
index 0000000..0afa951
--- /dev/null
@@ -0,0 +1,29 @@
+From 6cbb9f4c247c5361b8c165fbb40b4118d5d7c0e5 Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab@linux-m68k.org>
+Date: Mon, 25 Apr 2016 11:59:14 +0200
+Subject: [PATCH] Fix asm constraints in aarch64 multiply macro
+
+All operands must be register operands and the output operands are early
+clobbered.
+---
+ Zend/zend_multiply.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h
+index dfd21f7..651dd43 100644
+--- a/Zend/zend_multiply.h
++++ b/Zend/zend_multiply.h
+@@ -53,8 +53,8 @@
+       __asm__("mul %0, %2, %3\n"                                                                              \
+               "smulh %1, %2, %3\n"                                                                            \
+               "sub %1, %1, %0, asr #63\n"                                                                     \
+-                      : "=X"(__tmpvar), "=X"(usedval)                                                 \
+-                      : "X"(a), "X"(b));                                                                              \
++                      : "=&r"(__tmpvar), "=&r"(usedval)                                               \
++                      : "r"(a), "r"(b));                                                                              \
+       if (usedval) (dval) = (double) (a) * (double) (b);                              \
+       else (lval) = __tmpvar;                                                                                 \
+ } while (0)
+-- 
+2.8.0
+
git clone https://git.99rst.org/PROJECT