From 505b6cd144c797f3a657bff2941e21f2c9e01bf5 Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Tue, 22 Jan 2013 16:14:27 -0500 Subject: [PATCH] Bug 832623 - Disable -fstrict-aliasing in the JS engine for gcc <= 4.4 on all platforms, not just Linux/Android. r=glandium --- js/src/configure.in | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/js/src/configure.in b/js/src/configure.in index f3fb2475a0d..2c3c3ae73c3 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -4045,27 +4045,24 @@ else fi dnl ======================================================== -dnl = Disable -fstrict-aliasing on Linux/Android with GCC 4.4 and earlier. -dnl = See bug 821502. +dnl = Disable -fstrict-aliasing with GCC 4.4 and earlier. +dnl = See bugs 821502 and 832623. dnl ======================================================== -case "$target" in -*-android*|*-linuxandroid*|*-*linux*) - if test "$GNU_CC"; then - changequote(,) - GCC_VERSION_FULL=`echo "$CXX_VERSION" | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'` - GCC_VERSION=`echo "$GCC_VERSION_FULL" | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'` - changequote([,]) +if test "$GNU_CC"; then + changequote(,) + GCC_VERSION_FULL=`echo "$CXX_VERSION" | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'` + GCC_VERSION=`echo "$GCC_VERSION_FULL" | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'` + changequote([,]) - GCC_MAJOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print $1 }'` - GCC_MINOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print $2 }'` + GCC_MAJOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print $1 }'` + GCC_MINOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print $2 }'` - dnl GCC 3.x isn't supported, so we don't need to check for that. - if test "$GCC_MAJOR_VERSION" -eq "4" -a "$GCC_MINOR_VERSION" -lt "5" ; then - CFLAGS="$CFLAGS -fno-strict-aliasing" - CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" - fi + dnl GCC 3.x isn't supported, so we don't need to check for that. + if test "$GCC_MAJOR_VERSION" -eq "4" -a "$GCC_MINOR_VERSION" -lt "5" ; then + CFLAGS="$CFLAGS -fno-strict-aliasing" + CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" fi -esac +fi dnl ======================================================== dnl = Link js shell to system readline