Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Bug 821502 - Disable -fstrict-aliasing in JS for GCC 4.4 and earlier …
Browse files Browse the repository at this point in the history
…on Linux and Android. r=glandium,terrence; a=bajaj
  • Loading branch information
jlebar committed Jan 16, 2013
1 parent 25a5d39 commit 78b824a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions js/src/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -4121,6 +4121,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 ========================================================
Expand Down

0 comments on commit 78b824a

Please sign in to comment.