diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2003-07-07 21:26:19 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2003-07-07 21:26:19 (GMT) |
commit | 70fedcd583e1fe6ce2194691c546a0350f9a87fe (patch) | |
tree | 136004645da5af79b0eae2165eb93adb29995cf6 /configure.in | |
parent | dfda8d79ee0a1eabdcbda8648681fb2bf42a81e5 (diff) | |
download | cpython-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.in')
-rw-r--r-- | configure.in | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 8ab79b5..210eab3 100644 --- a/configure.in +++ b/configure.in @@ -641,6 +641,22 @@ AC_SUBST(BASECFLAGS) # 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. + AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing) + ac_save_cc="$CC" + CC="$CC -fno-strict-aliasing" + AC_TRY_RUN([int main() { return 0; }], + ac_cv_no_strict_aliasing_ok=yes, + ac_cv_no_strict_aliasing_ok=no, + ac_cv_no_strict_aliasing_ok=no) + CC="$ac_save_cc" + AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok) + 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" |