clover: Work around build failure with AltiVec.
authorMatt Turner <mattst88@gmail.com>
Thu, 2 Mar 2017 04:43:21 +0000 (04:43 +0000)
committerMatt Turner <mattst88@gmail.com>
Thu, 2 Mar 2017 23:49:00 +0000 (15:49 -0800)
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
src/gallium/state_trackers/clover/Makefile.am

index a3d1a00bdd00f0a8d7938bca5e5e136a6042a3a3..57c4b1e06221a066fbdd3a5685b8d023cc6226d7 100644 (file)
@@ -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"
index a657e5b88afca73722b10e53e6d95c2b2ac9fe31..321393536dc6939019dcd13ac3d723c110f5112e 100644 (file)
@@ -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 = \