Mesa (13.0): clover: Work around build failure with AltiVec.

Emil Velikov evelikov at kemper.freedesktop.org
Thu Mar 16 02:41:56 UTC 2017


Module: Mesa
Branch: 13.0
Commit: 3b782f6bc405971e70a090be90a2899bb6d751fc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3b782f6bc405971e70a090be90a2899bb6d751fc

Author: Matt Turner <mattst88 at gmail.com>
Date:   Thu Mar  2 04:43:21 2017 +0000

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 at riseup.net>
(cherry picked from commit 7d1195c1e4d071fe796bf5f210c468ea1cc86225)
[Emil Velikov: resolve trivial conflicts]
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

Conflicts:
	configure.ac

---

 configure.ac                                  | 15 +++++++++++++++
 src/gallium/state_trackers/clover/Makefile.am |  3 +++
 2 files changed, 18 insertions(+)

diff --git a/configure.ac b/configure.ac
index fd78fbb..16ceea8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1974,6 +1974,21 @@ 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 = \




More information about the mesa-commit mailing list