[Mesa-dev] [PATCH automake] gallium/auxiliary: Add -fno-rtti to CXXFLAGS on LLVM >= 3.2.

Johannes Obermayr johannesobermayr at gmx.de
Mon Dec 3 13:27:51 PST 2012


Contrary to old build system automake fails without LLVM_CXXFLAGS.
---
 configure.ac                      |    7 ++++++-
 src/gallium/auxiliary/Makefile.am |    6 ++++++
 2 Dateien geändert, 12 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)

diff --git a/configure.ac b/configure.ac
index e64f643..241b480 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1647,7 +1647,8 @@ if test "x$enable_gallium_llvm" = xyes; then
 	LLVM_CPPFLAGS=`$LLVM_CONFIG --cppflags|sed -e 's/-DNDEBUG\>//g' -e 's/-pedantic//g' -e 's/-Wcovered-switch-default//g'`
 	LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
 	LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
-	DEFINES="${DEFINES} -DHAVE_LLVM=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/0x0\10\2/g'`"
+	LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
+	DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT"
 	MESA_LLVM=1
 
 	dnl Check for Clang interanl headers
@@ -1661,9 +1662,11 @@ if test "x$enable_gallium_llvm" = xyes; then
         fi
     else
 	MESA_LLVM=0
+	LLVM_VERSION_INT=0
     fi
 else
     MESA_LLVM=0
+    LLVM_VERSION_INT=0
 fi
 
 dnl Directory for XVMC libs
@@ -1925,6 +1928,8 @@ AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
 AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
 AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
+AM_CONDITIONAL(LLVM_NEEDS_FNORTTI, test $LLVM_VERSION_INT -ge 302)
+
 AC_SUBST([GALLIUM_MAKE_DIRS])
 
 AM_CONDITIONAL(HAVE_X11_DRIVER, echo "$DRIVER_DIRS" | grep 'x11' >/dev/null 2>&1)
diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am
index fef1a0a..a4eee47 100644
--- a/src/gallium/auxiliary/Makefile.am
+++ b/src/gallium/auxiliary/Makefile.am
@@ -22,6 +22,12 @@ AM_CXXFLAGS = \
 	$(GALLIUM_CFLAGS) \
 	$(LLVM_CXXFLAGS)
 
+if LLVM_NEEDS_FNORTTI
+
+AM_CXXFLAGS += -fno-rtti
+
+endif
+
 libgallium_la_SOURCES += \
 	$(GALLIVM_SOURCES) \
 	$(GALLIVM_CPP_SOURCES)
-- 
1.7.10.4



More information about the mesa-dev mailing list