Created attachment 137090 [details] [review] pixman-clang.patch __builtin_shuffle was removed in clang 5.0 (but it's present in clang 4.x), that's why it's not possible to build pixman-0.34.0 anymore. Build log says: /Users/vsmirnov/gentoo/var/tmp/portage/x11-libs/pixman-0.34.0/work/pixman-0.34.0/test/utils-prng.c:207:27: error: use of unknown builtin '__builtin_shuffle' [-Wimplicit-function-declaration] randdata.vb = __builtin_shuffle (randdata.vb, bswap_shufflemask); ^ /Users/vsmirnov/gentoo/var/tmp/portage/x11-libs/pixman-0.34.0/work/pixman-0.34.0/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 $ clang --version clang version 5.0.1 (tags/RELEASE_501/final) Target: x86_64-apple-darwin17.4.0 Thread model: posix InstalledDir: /Users/vsmirnov/gentoo/usr/lib/llvm/5/bin 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.
Created attachment 137100 [details] [review] clang.patch Apparently gcc doesn't support __has_builtin macro. So correct patch will be like new attachment
I can confirm this patch works. It would be nice to get it committed and into a 0.34.1 release, since it blocks building on macOS.
This affects Xcode 9.3 so the pixman formula in Homebrew is now broken on macOS 10.13, which is what the vast majority of users use now. As Philip Chimento said, a release with the patch applied would be appreciated.
I tested clang 5 and 6, and while everything compiles, it fails the test suite: FAIL: combiner-test FAIL: gradient-crash-test FAIL: stress-test I don't feel good about making a release claiming to fix clang support if these tests fail.
Failing tests are another bug. As you might notice my patch is only replacing __builtin_shuffle with __builtin_shufflevector for a helper function in test. Tests for example will pass allright with CFLAGS="-O1", but not with CFLAGS="-O2" Also the same tests will fail under the same conditions if you just disable vector ops for clang in util-prng.c, so again, not related to the patch.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pixman/pixman/issues/21.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.