[PATCH video-intel] config: add -fno-strict-aliasing now that it is out of $CWARNFLAGS
Gaetan Nadon
memsize at videotron.ca
Mon Feb 22 14:03:54 PST 2010
This patch will ensure the modules continues to suppress the
optimization, based on strict aliasing rules, after the option
is removed from $CWARNFLAGS. There is no change in the object
code produced.
There is no attempt to determine if the module should or should not
have such an optimization. A new warning (-Wstrict-aliasing=2)
has been added to the XORG_CWARNFLAGS macro to help find code
that may interfere with optimization.
---
configure.ac | 7 +++++++
src/Makefile.am | 11 +++++++++--
src/xvmc/Makefile.am | 12 ++++++++++--
uxa/Makefile.am | 6 +++++-
4 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index 87cbe55..687dcf7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,6 +40,13 @@ m4_ifndef([XORG_MACROS_VERSION],
XORG_MACROS_VERSION(1.3)
XORG_DEFAULT_OPTIONS
+# Suppress optimization based on strict aliasing rules
+ALIASING_CFLAGS=
+if test "x$GCC" = xyes; then
+ ALIASING_CFLAGS=-fno-strict-aliasing
+fi
+AC_SUBST([ALIASING_CFLAGS])
+
# Checks for programs.
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
diff --git a/src/Makefile.am b/src/Makefile.am
index b4bafbd..b84feff 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -26,8 +26,15 @@ SUBDIRS = xvmc render_program
# _ladir passes a dummy rpath to libtool so the thing will actually link
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
-AM_CFLAGS = @CWARNFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ \
- @PCIACCESS_CFLAGS@ -I$(top_srcdir)/uxa -I$(top_srcdir)/src/render_program
+AM_CFLAGS = \
+ $(CWARNFLAGS) \
+ $(ALIASING_CFLAGS) \
+ $(XORG_CFLAGS) \
+ $(DRM_CFLAGS) \
+ $(DRI_CFLAGS) \
+ $(PCIACCESS_CFLAGS) \
+ -I$(top_srcdir)/uxa \
+ -I$(top_srcdir)/src/render_program
intel_drv_la_LTLIBRARIES = intel_drv.la
intel_drv_la_LDFLAGS = -module -avoid-version
diff --git a/src/xvmc/Makefile.am b/src/xvmc/Makefile.am
index be8824b..815eda8 100644
--- a/src/xvmc/Makefile.am
+++ b/src/xvmc/Makefile.am
@@ -7,8 +7,16 @@ SUBDIRS = shader
libI810XvMC_la_SOURCES = I810XvMC.c \
I810XvMC.h
-libI810XvMC_la_CFLAGS = @CWARNFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ \
- -I$(top_srcdir)/src -DTRUE=1 -DFALSE=0
+libI810XvMC_la_CFLAGS = \
+ $(CWARNFLAGS) \
+ $(ALIASING_CFLAGS) \
+ $(XORG_CFLAGS) \
+ $(DRM_CFLAGS) \
+ $(DRI_CFLAGS) \
+ -I$(top_srcdir)/src \
+ -DTRUE=1 \
+ -DFALSE=0
+
libI810XvMC_la_LDFLAGS = -version-number 1:0:0
libI810XvMC_la_LIBADD = @DRI_LIBS@ @DRM_LIBS@ @XVMCLIB_LIBS@
diff --git a/uxa/Makefile.am b/uxa/Makefile.am
index 0dfad48..3658b9a 100644
--- a/uxa/Makefile.am
+++ b/uxa/Makefile.am
@@ -7,7 +7,11 @@ SOLARIS_ASM_CFLAGS=""
INCLUDES = \
$(XORG_INCS)
-AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) $(DIX_CFLAGS)
+AM_CFLAGS = \
+ $(CWARNFLAGS) \
+ $(ALIASING_CFLAGS) \
+ $(XORG_CFLAGS) \
+ $(DIX_CFLAGS)
libuxa_la_SOURCES = \
uxa.c \
--
1.6.0.4
More information about the xorg-devel
mailing list