Bug 821502 - Disable -fstrict-aliasing in JS for GCC 4.4 and earlier on Linux and Android. r=glandium,terrence

This commit is contained in:
Justin Lebar 2013-01-08 01:19:25 +01:00
parent 8da44475e9
commit 98c041fb38

View File

@ -4097,6 +4097,29 @@ else
fi
fi
dnl ========================================================
dnl = Disable -fstrict-aliasing on Linux/Android with GCC 4.4 and earlier.
dnl = See bug 821502.
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([,])
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
fi
esac
dnl ========================================================
dnl = Link js shell to system readline
dnl ========================================================