[Pixman] [Patch] Fix pixman build with clang

Manoj Gupta manojgupta at chromium.org
Fri Dec 8 23:32:41 UTC 2017


Hi,

I am encountering a build issue in pixman when compiling with with clang.

pixman-mmx.c:100:20: error: constraint 'K' expects an integer constant
expression
        : "y" (__A), "K" (__N)

The error happens because __N is a function parameter and clang does not
process it as an integer literal by design. Note that even gcc cannot
handle it in -O0 mode.

This can be fixed  by forcing the macro version of the function which
exposes __N value
as an integer literal. I am making it #if 0 but it might be worthwhile to
delete the function declaration since there is no much to lose here given
all the function does is  inline asm.

diff -Nuar old/pixman/pixman-mmx.c new/pixman/pixman-mmx.c
--- old/pixman/pixman-mmx.c
+++ new/pixman/pixman-mmx.c
@@ -89,7 +89,7 @@
     return __A;
 }

-#  ifdef __OPTIMIZE__
+#  if 0
 extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__,
__artificial__))
 _mm_shuffle_pi16 (__m64 __A, int8_t const __N)
 {

Thanks,
Manoj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pixman/attachments/20171208/ac9e3340/attachment.html>


More information about the Pixman mailing list