[PATCH xserver] config: add -fno-strict-aliasing now that it is out of $CWARNFLAGS

Gaetan Nadon memsize at videotron.ca
Mon Feb 22 14:05:52 PST 2010


This patch will ensure the xserver 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 xserver 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.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 configure.ac |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index de252f3..0ba9822 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,6 +79,14 @@ AC_SYS_LARGEFILE
 XORG_PROG_RAWCPP
 AC_PATH_PROG(SED,sed)
 
+# Suppress strict aliasing optimization
+ALIASING_CFLAGS=
+if test "x$GCC" = xyes; then
+    ALIASING_CFLAGS=-fno-strict-aliasing
+fi
+AC_SUBST([ALIASING_CFLAGS])
+CWARNFLAGS="$CWARNFLAGS $ALIASING_CFLAGS"
+
 # Quoted so that make will expand $(CWARNFLAGS) in makefiles to allow
 # easier overrides at build time.
 XSERVER_CFLAGS='$(CWARNFLAGS)'
-- 
1.6.0.4



More information about the xorg-devel mailing list