Bug 832623 - Disable -fstrict-aliasing in the JS engine for gcc <= 4.4 on all platforms, not just Linux/Android. r=glandium

This commit is contained in:
Justin Lebar 2013-01-22 16:14:27 -05:00
parent ec7cf5a38b
commit 505b6cd144

View File

@ -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