There's bug in LLVM 2.9's assembler which causes the build to fail on
the inline assembly, specifically the fsubp instruction. The bug is
LLVM #9164 (http://llvm.org/bugs/show_bug.cgi?id=9164). As I lack Zend
karma, I've attached a patch to fix this issue for affected Clang
builds. I've tested it on multiple architectures (i386, x86_64),
compilers (gcc 4.2, LLVM-GCC, Clang 2.9, Clang SVN), and systems
(Darwin, Ubuntu, BSD), and it appears to work cleanly on all of them.
The patch is against 5.4.

-- Gwynne
Index: Zend/zend_operators.h
===================================================================
--- Zend/zend_operators.h       (revision 314327)
+++ Zend/zend_operators.h       (working copy)
@@ -615,7 +615,11 @@
                        "0:\n\t"
                        "fildl  (%2)\n\t"
                        "fildl  (%1)\n\t"
+#if defined(__clang__) && (__clang_major__ < 2 || (__clang_major__ == 2 && 
__clang_minor__ < 10))
+                       "fsubp  %%st(1), %%st\n\t"  // LLVM bug #9164
+#else
                        "fsubp  %%st, %%st(1)\n\t"
+#endif
                        "movb   $0x2,0xc(%0)\n\t"
                        "fstpl  (%0)\n"
                        "1:"
@@ -635,7 +639,11 @@
                        "0:\n\t"
                        "fildq  (%2)\n\t"
                        "fildq  (%1)\n\t"
+#if defined(__clang__) && (__clang_major__ < 2 || (__clang_major__ == 2 && 
__clang_minor__ < 10))
+                       "fsubp  %%st(1), %%st\n\t"  // LLVM bug #9164
+#else
                        "fsubp  %%st, %%st(1)\n\t"
+#endif
                        "movb   $0x2,0x14(%0)\n\t"
                        "fstpl  (%0)\n"
                        "1:"
-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to