media-libs/mesa: Apply patch to fix Clover build with AltiVec.
authorMatt Turner <mattst88@gentoo.org>
Thu, 2 Mar 2017 23:57:09 +0000 (15:57 -0800)
committerMatt Turner <mattst88@gentoo.org>
Fri, 3 Mar 2017 00:03:11 +0000 (16:03 -0800)
Bug: https://bugs.gentoo.org/587210
Bug: https://bugs.freedesktop.org/68504

media-libs/mesa/files/mesa-13-clover-Work-around-build-failure-with-AltiVec.patch [new file with mode: 0644]
media-libs/mesa/files/mesa-17-clover-Work-around-build-failure-with-AltiVec.patch [new file with mode: 0644]
media-libs/mesa/mesa-13.0.5.ebuild
media-libs/mesa/mesa-17.0.0.ebuild

diff --git a/media-libs/mesa/files/mesa-13-clover-Work-around-build-failure-with-AltiVec.patch b/media-libs/mesa/files/mesa-13-clover-Work-around-build-failure-with-AltiVec.patch
new file mode 100644 (file)
index 0000000..0d2c65a
--- /dev/null
@@ -0,0 +1,70 @@
+From 71a2b2e8a580d2c0bee84b898d8531b27f3c7811 Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Thu, 2 Mar 2017 04:43:21 +0000
+Subject: [PATCH] clover: Work around build failure with AltiVec.
+
+Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=587210
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68504
+Acked-by: Francisco Jerez <currojerez@riseup.net>
+(cherry picked from commit 7d1195c1e4d071fe796bf5f210c468ea1cc86225)
+---
+ configure.ac                                  | 14 ++++++++++++++
+ src/gallium/state_trackers/clover/Makefile.am |  3 +++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index fd78fbb..3646e45 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1974,6 +1974,20 @@ if test "x$enable_opencl" = xyes; then
+     if test "x$have_libelf" != xyes; then
+        AC_MSG_ERROR([Clover requires libelf])
+     fi
++
++    if test "x${ac_cv_cxx_compiler_gnu}" = xyes; then
++        altivec_enabled=no
++        AC_COMPILE_IFELSE([AC_LANG_SOURCE([
++        #if !defined(__VEC__) || !defined(__ALTIVEC__)
++        #error "AltiVec not enabled"
++        #endif
++        ])], altivec_enabled=yes)
++
++        if test "$altivec_enabled" = yes; then
++            CLOVER_STD_OVERRIDE="-std=gnu++11"
++        fi
++        AC_SUBST([CLOVER_STD_OVERRIDE])
++    fi
+ fi
+ AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
+ AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
+diff --git a/src/gallium/state_trackers/clover/Makefile.am b/src/gallium/state_trackers/clover/Makefile.am
+index 8abcfec..edf1e26 100644
+--- a/src/gallium/state_trackers/clover/Makefile.am
++++ b/src/gallium/state_trackers/clover/Makefile.am
+@@ -33,6 +33,7 @@ noinst_LTLIBRARIES = libclover.la libcltgsi.la libclllvm.la
+ libcltgsi_la_CXXFLAGS = \
+       -std=c++11 \
++      $(CLOVER_STD_OVERRIDE) \
+       $(VISIBILITY_CXXFLAGS)
+ libcltgsi_la_SOURCES = $(TGSI_SOURCES)
+@@ -41,6 +42,7 @@ libclllvm_la_CXXFLAGS = \
+       -std=c++11 \
+       $(VISIBILITY_CXXFLAGS) \
+       $(LLVM_CXXFLAGS) \
++      $(CLOVER_STD_OVERRIDE) \
+       $(DEFINES) \
+       $(LIBELF_CFLAGS) \
+       -DLIBCLC_INCLUDEDIR=\"$(LIBCLC_INCLUDEDIR)/\" \
+@@ -51,6 +53,7 @@ libclllvm_la_SOURCES = $(LLVM_SOURCES)
+ libclover_la_CXXFLAGS = \
+       -std=c++11 \
++      $(CLOVER_STD_OVERRIDE) \
+       $(VISIBILITY_CXXFLAGS)
+ libclover_la_LIBADD = \
+-- 
+2.10.2
+
diff --git a/media-libs/mesa/files/mesa-17-clover-Work-around-build-failure-with-AltiVec.patch b/media-libs/mesa/files/mesa-17-clover-Work-around-build-failure-with-AltiVec.patch
new file mode 100644 (file)
index 0000000..87f5f9d
--- /dev/null
@@ -0,0 +1,69 @@
+From 7d1195c1e4d071fe796bf5f210c468ea1cc86225 Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Thu, 2 Mar 2017 04:43:21 +0000
+Subject: [PATCH] clover: Work around build failure with AltiVec.
+
+Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=587210
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68504
+Acked-by: Francisco Jerez <currojerez@riseup.net>
+---
+ configure.ac                                  | 14 ++++++++++++++
+ src/gallium/state_trackers/clover/Makefile.am |  3 +++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index a3d1a00..57c4b1e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2033,6 +2033,20 @@ if test "x$enable_opencl" = xyes; then
+        AC_MSG_ERROR([Clover requires libelf])
+     fi
++    if test "x${ac_cv_cxx_compiler_gnu}" = xyes; then
++        altivec_enabled=no
++        AC_COMPILE_IFELSE([AC_LANG_SOURCE([
++        #if !defined(__VEC__) || !defined(__ALTIVEC__)
++        #error "AltiVec not enabled"
++        #endif
++        ])], altivec_enabled=yes)
++
++        if test "$altivec_enabled" = yes; then
++            CLOVER_STD_OVERRIDE="-std=gnu++11"
++        fi
++        AC_SUBST([CLOVER_STD_OVERRIDE])
++    fi
++
+     llvm_require_version $LLVM_REQUIRED_OPENCL "opencl"
+     llvm_add_default_components "opencl"
+diff --git a/src/gallium/state_trackers/clover/Makefile.am b/src/gallium/state_trackers/clover/Makefile.am
+index a657e5b..3213935 100644
+--- a/src/gallium/state_trackers/clover/Makefile.am
++++ b/src/gallium/state_trackers/clover/Makefile.am
+@@ -32,6 +32,7 @@ noinst_LTLIBRARIES = libclover.la libcltgsi.la libclllvm.la
+ libcltgsi_la_CXXFLAGS = \
+       -std=c++11 \
++      $(CLOVER_STD_OVERRIDE) \
+       $(VISIBILITY_CXXFLAGS)
+ libcltgsi_la_SOURCES = $(TGSI_SOURCES)
+@@ -40,6 +41,7 @@ libclllvm_la_CXXFLAGS = \
+       -std=c++11 \
+       $(VISIBILITY_CXXFLAGS) \
+       $(LLVM_CXXFLAGS) \
++      $(CLOVER_STD_OVERRIDE) \
+       $(DEFINES) \
+       $(LIBELF_CFLAGS) \
+       -DLIBCLC_INCLUDEDIR=\"$(LIBCLC_INCLUDEDIR)/\" \
+@@ -50,6 +52,7 @@ libclllvm_la_SOURCES = $(LLVM_SOURCES)
+ libclover_la_CXXFLAGS = \
+       -std=c++11 \
++      $(CLOVER_STD_OVERRIDE) \
+       $(VISIBILITY_CXXFLAGS)
+ libclover_la_LIBADD = \
+-- 
+2.10.2
+
index 9e3022a4336ffcd55dbab777ba8e335795413bcd..83fa8ce7bd7c353ca72c6870a12894a52c231dff 100644 (file)
@@ -198,7 +198,9 @@ pkg_setup() {
 }
 
 src_prepare() {
-       [[ ${PV} == 9999 ]] && eautoreconf
+       epatch "${FILESDIR}"/${PN}-13-clover-Work-around-build-failure-with-AltiVec.patch
+
+       eautoreconf
 }
 
 multilib_src_configure() {
index c3c5a2c4faa0e3da0c60c6990a018e2715ada974..0aea8a38fb1b9cdf3edfebcfd98217dce2e6dd75 100644 (file)
@@ -206,7 +206,10 @@ pkg_setup() {
 }
 
 src_prepare() {
-       [[ ${PV} == 9999 ]] && eautoreconf
+       eapply "${FILESDIR}"/${PN}-17-clover-Work-around-build-failure-with-AltiVec.patch
+
+       eautoreconf
+
        eapply_user
 }