[1/1] Clang compile failure due to use of __builtin_shuffle

Submitted by StormByte on Aug. 7, 2018, 9:49 a.m.

Details

Message ID e266af10-a4a7-128c-405e-070fc3983ec0@gmail.com
State New
Series "Series without cover letter"
Headers show

Commit Message

StormByte Aug. 7, 2018, 9:49 a.m.
While playing with Clang and compiling a Gentoo system with it, I
realized that pixman is not compiling because of the use
of /__builtin_shuffle which according to LLVM mailing list, should not
be used directly [1]./

//
/As such, I investigated a bit, and made a patch for making it compile
compatible with Clang that I attach here in the hope that it is reviewed./
//
/Thanks,/
//
/David C. Manuelda/
//
/[1]: //http://lists.llvm.org/pipermail/cfe-dev/2017-August/055142.html
<http://lists.llvm.org/pipermail/cfe-dev/2017-August/055142.html>/

Patch hide | download patch | download mbox

--- test/utils-prng.c.original	2018-08-07 09:04:57.690219651 +0000
+++ test/utils-prng.c	2018-08-07 09:28:33.619254582 +0000
@@ -199,7 +199,7 @@ 
         }
         else
         {
-#ifdef HAVE_GCC_VECTOR_EXTENSIONS
+#if defined(HAVE_GCC_VECTOR_EXTENSIONS) && defined(__GNUC__) && !defined(__clang__)
             const uint8x16 bswap_shufflemask =
             {
                 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12

Comments

Matt Turner Aug. 14, 2018, 8:39 p.m.
On Tue, Aug 7, 2018 at 2:50 AM StormByte <stormbyte@gmail.com> wrote:
>
> While playing with Clang and compiling a Gentoo system with it, I realized that pixman is not compiling because of the use of __builtin_shuffle which according to LLVM mailing list, should not be used directly [1].
>
> As such, I investigated a bit, and made a patch for making it compile compatible with Clang that I attach here in the hope that it is reviewed.
> Thanks,
> David C. Manuelda
> [1]: http://lists.llvm.org/pipermail/cfe-dev/2017-August/055142.html

Thanks. This has already been reported as
https://bugs.gentoo.org/646360 and I committed a patch two months ago
to fix it -- see
https://gitlab.freedesktop.org/pixman/pixman/commit/bd2b49185b28c5024597a5e530af9fc25de3193a

The next version of pixman will include the patch.