Re: Forcing -fno-strict-aliasing to all compiles breaks compiles with xlc/xlc_r
Chris Dukes <[email protected]>
| Newsgroups | gmane.comp.apache.apreq |
|---|---|
| Message-ID | <OFD54A6A67.81A0D799-ON87257405.00679F6A-85257405.006A77D9@us.ibm.com> |
No joy.
xlc -fno-strict-aliasing -c -o conftest.o confest.c
will work
Follow that with
xlc -fno-strict-aliasing -c -o conftest conftest.o
and it'll error with
ld: 0706-005 Cannot find or open file: no-strict-aliasing
ld:fopen(): A file or directory in the path name does not exist.
This is because '-f' supposed to be passed to 'ld' by xlc on AIX.
Your test is including the '-c', allowing it to pass.
I think the root problem is being introduced with placing $CFLAGS in the
link invocation of libtool.
Unfortunately, this solution would lead to other problems if someone is
also making use of '-qipa' in optimization (Not that it makes much sense
for this package).
Thanks,
Chris Dukes
Bojan Smojver <[email protected]>
03/02/2008 05:32 PM
To
Chris Dukes/Durham/Contr/IBM@IBMUS
cc
[email protected]
Subject
Re: Forcing -fno-strict-aliasing to all compiles breaks compiles with
xlc/xlc_r
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
(application/octet-stream, 765 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"