summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2018-07-21 09:48:59 +1000
committerJan Schmidt <jan@centricular.com>2018-07-21 09:48:59 +1000
commita5bd5a4c4912d30d2e45f93e53c2ea11c880edb2 (patch)
treeb092651f1e2963afc1f87d97f7c41259722ca226
parent21790488028f81143cf12053a9b085688363553e (diff)
pixman: Fix build with Clang 5
Import a patch from upstream pixman to disable use of GCC __builtin_shuffle that was removed in Clang 5.0 Fixes the MacOS/iOS build
-rw-r--r--recipes/pixman.recipe3
-rw-r--r--recipes/pixman/0003-Fix-build-with-clang-5.patch67
2 files changed, 69 insertions, 1 deletions
diff --git a/recipes/pixman.recipe b/recipes/pixman.recipe
index 56b84a2d..814c1d9a 100644
--- a/recipes/pixman.recipe
+++ b/recipes/pixman.recipe
@@ -11,7 +11,8 @@ class Recipe(recipe.Recipe):
licenses = [License.MIT]
autoreconf = True
patches = ['pixman/0001-Fix-build-on-Android.patch',
- 'pixman/0002-Enable-CPU-detection-on-Android.patch']
+ 'pixman/0002-Enable-CPU-detection-on-Android.patch',
+ 'pixman/0003-Fix-build-with-clang-5.patch']
files_libs = ['libpixman-1']
files_devel = ['include/pixman-1', 'lib/pkgconfig/pixman-1.pc']
diff --git a/recipes/pixman/0003-Fix-build-with-clang-5.patch b/recipes/pixman/0003-Fix-build-with-clang-5.patch
new file mode 100644
index 00000000..c1073166
--- /dev/null
+++ b/recipes/pixman/0003-Fix-build-with-clang-5.patch
@@ -0,0 +1,67 @@
+From bd2b49185b28c5024597a5e530af9fc25de3193a Mon Sep 17 00:00:00 2001
+From: Vladimir Smirnov <civil@gentoo.org>
+Date: Mon, 4 Jun 2018 10:04:15 -0700
+Subject: [PATCH] test: Adjust for clang's removal of __builtin_shuffle
+
+__builtin_shuffle was removed in clang 5.0.
+
+Build log says:
+test/utils-prng.c:207:27: error: use of unknown builtin '__builtin_shuffle' [-Wimplicit-function-declaration]
+ randdata.vb = __builtin_shuffle (randdata.vb, bswap_shufflemask);
+ ^
+test/utils-prng.c:207:25: error: assigning to 'uint8x16' (vector of 16 'uint8_t' values) from incompatible type 'int'
+ randdata.vb = __builtin_shuffle (randdata.vb, bswap_shufflemask);
+ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+2 errors generated
+
+Link to original discussion:
+http://lists.llvm.org/pipermail/cfe-dev/2017-August/055140.html
+
+It's possible to build pixman if attached patch is applied. Basically
+patch adds check for __builtin_shuffle support and in case there is
+none, falls back to clang-specific __builtin_shufflevector that do the
+same but have different API.
+
+Bugzilla: https://bugs.gentoo.org/646360
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104886
+Tested-by: Philip Chimento <philip.chimento@gmail.com>
+Reviewed-by: Matt Turner <mattst88@gmail.com>
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+---
+ test/utils-prng.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/test/utils-prng.c b/test/utils-prng.c
+index c27b5be..0cf53dd 100644
+--- a/test/utils-prng.c
++++ b/test/utils-prng.c
+@@ -199,12 +199,25 @@ randmemset_internal (prng_t *prng,
+ }
+ else
+ {
++
++#ifndef __has_builtin
++#define __has_builtin(x) 0
++#endif
++
+ #ifdef HAVE_GCC_VECTOR_EXTENSIONS
+- const uint8x16 bswap_shufflemask =
++# if __has_builtin(__builtin_shufflevector)
++ randdata.vb =
++ __builtin_shufflevector (randdata.vb, randdata.vb,
++ 3, 2, 1, 0, 7, 6 , 5, 4,
++ 11, 10, 9, 8, 15, 14, 13, 12);
++# else
++ static const uint8x16 bswap_shufflemask =
+ {
+ 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12
+ };
+ randdata.vb = __builtin_shuffle (randdata.vb, bswap_shufflemask);
++# endif
++
+ store_rand_128_data (buf, &randdata, aligned);
+ buf += 16;
+ #else
+--
+2.17.1
+