Re: Forcing -fno-strict-aliasing to all compiles breaks compiles with xlc/xlc_r

Bojan Smojver <[email protected]>
Newsgroups gmane.comp.apache.apreq
Message-ID <[email protected]>
On Mon, 2008-03-03 at 09:03 +1100, Bojan Smojver wrote:

> Yeah, we should only use -fno-strict-aliasing with GCC.

Can you let me know if this helps? You'll need to run buildconf, of
course...

-- 
Bojan
apreq-fno-strict-aliasing.patch (text/x-patch, 746 B)
Index: acinclude.m4
===================================================================
--- acinclude.m4	(revision 632858)
+++ acinclude.m4	(working copy)
@@ -214,8 +214,13 @@
                       ])
                 # -Wdeclaration-after-statement is only supported on gcc 3.4+
         fi
-        APR_ADDTO([CFLAGS], "-fno-strict-aliasing")
 
+        old_cflags="$CFLAGS"
+        CFLAGS="$CFLAGS -fno-strict-aliasing"
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]])],
+                          [CFLAGS=$old_cflags; APR_ADDTO([CFLAGS], "-fno-strict-aliasing")],
+                          [CFLAGS=$old_cflags])
+
         APR_ADDTO([CPPFLAGS], "`$APR_CONFIG --cppflags`")
 
         get_version="$SHELL $abs_srcdir/build/get-version.sh"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.