[Mesa-dev] [PATCH] configure.ac/swr: build swr with -fno-strict-aliasing

Tim Rowley timothy.o.rowley at intel.com
Tue Aug 2 17:53:22 UTC 2016


swr rasterizer contains numerous data transfers between vectors
and ordinary C types.  Fixing for strict aliasing will take time.
---
 configure.ac                        | 7 +++++++
 src/gallium/drivers/swr/Makefile.am | 1 +
 2 files changed, 8 insertions(+)

diff --git a/configure.ac b/configure.ac
index aea5890..fb4a12a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -312,6 +312,8 @@ if test "x$GCC" = xyes; then
     MSVC2013_COMPAT_CFLAGS="-Werror=pointer-arith"
     MSVC2013_COMPAT_CXXFLAGS="-Werror=pointer-arith"
 
+    NO_STRICT_ALIASING_CFLAGS="-fno-strict-aliasing"
+    
     # Enable -Werror=vla if compiler supports it
     save_CFLAGS="$CFLAGS"
     AC_MSG_CHECKING([whether $CC supports -Werror=vla])
@@ -341,11 +343,16 @@ if test "x$GXX" = xyes; then
 
     # We don't want floating-point math functions to set errno or trap
     CXXFLAGS="$CXXFLAGS -fno-math-errno -fno-trapping-math"
+
+    NO_STRICT_ALIASING_CXXFLAGS="-fno-strict-aliasing"
 fi
 
 AC_SUBST([MSVC2013_COMPAT_CFLAGS])
 AC_SUBST([MSVC2013_COMPAT_CXXFLAGS])
 
+AC_SUBST([NO_STRICT_ALIASING_CFLAGS])
+AC_SUBST([NO_STRICT_ALIASING_CXXFLAGS])
+
 dnl even if the compiler appears to support it, using visibility attributes isn't
 dnl going to do anything useful currently on cygwin apart from emit lots of warnings
 case "$host_os" in
diff --git a/src/gallium/drivers/swr/Makefile.am b/src/gallium/drivers/swr/Makefile.am
index 3459af3..fa02349 100644
--- a/src/gallium/drivers/swr/Makefile.am
+++ b/src/gallium/drivers/swr/Makefile.am
@@ -29,6 +29,7 @@ noinst_LTLIBRARIES = libmesaswr.la
 libmesaswr_la_SOURCES = $(LOADER_SOURCES)
 
 COMMON_CXXFLAGS = \
+	$(NO_STRICT_ALIASING_CXXFLAGS) \
 	$(GALLIUM_DRIVER_CFLAGS) \
 	$(LLVM_CXXFLAGS) \
 	$(SWR_CXX11_CXXFLAGS) \
-- 
2.7.4



More information about the mesa-dev mailing list