summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-07-07 21:26:19 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-07-07 21:26:19 (GMT)
commit70fedcd583e1fe6ce2194691c546a0350f9a87fe (patch)
tree136004645da5af79b0eae2165eb93adb29995cf6 /configure
parentdfda8d79ee0a1eabdcbda8648681fb2bf42a81e5 (diff)
downloadcpython-70fedcd583e1fe6ce2194691c546a0350f9a87fe.zip
cpython-70fedcd583e1fe6ce2194691c546a0350f9a87fe.tar.gz
cpython-70fedcd583e1fe6ce2194691c546a0350f9a87fe.tar.bz2
Use -fno-strict-aliasing if available. Fixes #766696. Will backport to 2.2.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure45
1 files changed, 44 insertions, 1 deletions
diff --git a/configure b/configure
index 3f4ed4d..dc31f16 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.in Revision: 1.421 .
+# From configure.in Revision: 1.422 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53 for python 2.3.
#
@@ -3645,6 +3645,49 @@ fi
# tweak BASECFLAGS based on compiler and platform
case $GCC in
yes)
+ # Python violates C99 rules, by casting between incompatible
+ # pointer types. GCC may generate bad code as a result of that,
+ # so use -fno-strict-aliasing if supported.
+ echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5
+echo $ECHO_N "checking whether $CC accepts -fno-strict-aliasing... $ECHO_C" >&6
+ ac_save_cc="$CC"
+ CC="$CC -fno-strict-aliasing"
+ if test "$cross_compiling" = yes; then
+ ac_cv_no_strict_aliasing_ok=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+int main() { return 0; }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_no_strict_aliasing_ok=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+( exit $ac_status )
+ac_cv_no_strict_aliasing_ok=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+ CC="$ac_save_cc"
+ echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5
+echo "${ECHO_T}$ac_cv_no_strict_aliasing_ok" >&6
+ if test $ac_cv_no_strict_aliasing_ok = yes
+ then
+ BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
+ fi
case $ac_sys_system in
SCO_SV*)
BASECFLAGS="$BASECFLAGS -m486 -DSCO5"