[PATCH] 5.4 doesn't build with Clang 2.9
| From: | Gwynne Raskind | Date: | Fri, 05 Aug 2011 13:28:42 +0000 |
| Subject: | [PATCH] 5.4 doesn't build with Clang 2.9 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-54404@lists.php.net to get a copy of this message | ||
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:"
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:"