[Pixman] Pixman not building on MacOS X 10.11

Andrea Canciani ranma42 at gmail.com
Sat Oct 10 13:48:03 PDT 2015


It looks like the latest XCode cannot build pixman:

$ clang --version
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.5.0
Thread model: posix

pixman-mmx.c:100:20: error: constraint 'K' expects an integer constant
expression
        : "y" (__A), "K" (__N)
                          ^~~
Reported here:
https://github.com/Homebrew/homebrew/issues/41056

It looks like the test performed in configure.ac does not match the code
with sufficient accuracy.
In particular, the constant is hardcoded in the configure.ac test, while in
the code it is only available after inlining.

The attached hack gets the code to compile on modern clang, but I believe
first of all we should improve the configure.ac detection code so that
pixman can actually build both on old and on new clang versions (possibly
with mmx disabled, if the asm constraints we need are not implemented).

Andrea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pixman/attachments/20151010/adf5770c/attachment.html>
-------------- next part --------------
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 05c48a4..412beb9 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -89,7 +89,7 @@ _mm_mulhi_pu16 (__m64 __A, __m64 __B)
     return __A;
 }
 
-#  ifdef __OPTIMIZE__
+#  if 0
 extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _mm_shuffle_pi16 (__m64 __A, int8_t const __N)
 {


More information about the Pixman mailing list