Bug 762071 - JS is being compiled with exceptions enabled. r=khuey.

This commit is contained in:
Rafael Ávila de Espíndola 2012-06-08 13:31:28 -04:00
parent 601ea77982
commit b13a48e799
6 changed files with 64 additions and 65 deletions

View File

@ -52,8 +52,34 @@ esac
fi
])
dnl ============================================================================
dnl C++ rtti
dnl We don't use it in the code, but it can be usefull for debugging, so give
dnl the user the option of enabling it.
dnl ============================================================================
AC_DEFUN([MOZ_RTTI],
[
MOZ_ARG_ENABLE_BOOL(cpp-rtti,
[ --enable-cpp-rtti Enable C++ RTTI ],
[ _MOZ_USE_RTTI=1 ],
[ _MOZ_USE_RTTI= ])
if test -z "$_MOZ_USE_RTTI"; then
if test "$GNU_CC"; then
CXXFLAGS="$CXXFLAGS -fno-rtti"
else
case "$target" in
*-mingw*)
CXXFLAGS="$CXXFLAGS -GR-"
esac
fi
fi
])
dnl A high level macro for selecting compiler options.
AC_DEFUN([MOZ_COMPILER_OPTS],
[
MOZ_RTTI
if test "$CLANG_CXX"; then
## We disable return-type-c-linkage because jsval is defined as a C++ type but is
## returned by C functions. This is possible because we use knowledge about the ABI
@ -64,7 +90,7 @@ fi
if test "$GNU_CC"; then
CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections"
CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections -fno-exceptions"
fi
dnl ========================================================

View File

@ -315,8 +315,6 @@ MOZ_OPTIMIZE_SIZE_TWEAK = @MOZ_OPTIMIZE_SIZE_TWEAK@
MOZ_ALLOW_HEAP_EXECUTE_FLAGS = @MOZ_ALLOW_HEAP_EXECUTE_FLAGS@
MOZ_RTTI_FLAGS_ON = @_MOZ_RTTI_FLAGS_ON@
PROFILE_GEN_CFLAGS = @PROFILE_GEN_CFLAGS@
PROFILE_GEN_LDFLAGS = @PROFILE_GEN_LDFLAGS@
PROFILE_USE_CFLAGS = @PROFILE_USE_CFLAGS@

View File

@ -723,8 +723,6 @@ case "$target" in
AC_MSG_ERROR([This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
fi
_MOZ_RTTI_FLAGS_ON='-GR'
_MOZ_RTTI_FLAGS_OFF='-GR-'
AC_DEFINE(HAVE_SEH_EXCEPTIONS)
if test -n "$WIN32_REDIST_DIR"; then
@ -1706,8 +1704,6 @@ if test "$GNU_CC"; then
AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
LDFLAGS=$_SAVE_LDFLAGS)
_MOZ_RTTI_FLAGS_ON=-frtti
_MOZ_RTTI_FLAGS_OFF=-fno-rtti
# Check for -mssse3 on $CC
AC_MSG_CHECKING([for -mssse3 option to $CC])
@ -2867,6 +2863,7 @@ if test -z "$COMPILE_ENVIRONMENT"; then
SKIP_LIBRARY_CHECKS=1
fi
MOZ_COMPILER_OPTS
if test -z "$SKIP_COMPILER_CHECKS"; then
dnl Checks for typedefs, structures, and compiler characteristics.
dnl ========================================================
@ -2997,24 +2994,6 @@ else
AC_MSG_RESULT(no)
fi
dnl ========================================================
dnl C++ rtti
dnl Should be smarter and check that the compiler does indeed have rtti
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(cpp-rtti,
[ --enable-cpp-rtti Enable C++ RTTI ],
[ _MOZ_USE_RTTI=1 ],
[ _MOZ_USE_RTTI= ])
if test "$_MOZ_USE_RTTI"; then
_MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
else
_MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
fi
AC_SUBST(_MOZ_RTTI_FLAGS_ON)
dnl Check whether we can use gcc's c++0x mode
AC_LANG_CPLUSPLUS
@ -3022,17 +3001,14 @@ if test "$GNU_CXX"; then
_SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
if test -z "$_MOZ_USE_RTTI"; then
CXXFLAGS="$CXXFLAGS $_MOZ_RTTI_FLAGS"
AC_CACHE_CHECK(for gcc c++0x headers bug without rtti,
ac_cv_cxx0x_headers_bug,
[AC_TRY_COMPILE([#include <memory>], [],
ac_cv_cxx0x_headers_bug="no",
ac_cv_cxx0x_headers_bug="yes")])
CXXFLAGS="$_SAVE_CXXFLAGS"
if test "$ac_cv_cxx0x_headers_bug" = "no"; then
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
fi
AC_CACHE_CHECK(for gcc c++0x headers bug without rtti,
ac_cv_cxx0x_headers_bug,
[AC_TRY_COMPILE([#include <memory>], [],
ac_cv_cxx0x_headers_bug="no",
ac_cv_cxx0x_headers_bug="yes")])
CXXFLAGS="$_SAVE_CXXFLAGS"
if test "$ac_cv_cxx0x_headers_bug" = "no"; then
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
fi
fi
@ -3230,7 +3206,6 @@ AC_SUBST(WRAP_SYSTEM_INCLUDES)
AC_SUBST(VISIBILITY_FLAGS)
MOZ_GCC_PR49911
MOZ_COMPILER_OPTS
dnl Check for __force_align_arg_pointer__ for SSE2 on gcc
dnl ========================================================
@ -8688,7 +8663,6 @@ CFLAGS=`echo \
$CFLAGS`
CXXFLAGS=`echo \
$_MOZ_RTTI_FLAGS \
$_WARNINGS_CXXFLAGS \
$CXXFLAGS`

View File

@ -52,8 +52,34 @@ esac
fi
])
dnl ============================================================================
dnl C++ rtti
dnl We don't use it in the code, but it can be usefull for debugging, so give
dnl the user the option of enabling it.
dnl ============================================================================
AC_DEFUN([MOZ_RTTI],
[
MOZ_ARG_ENABLE_BOOL(cpp-rtti,
[ --enable-cpp-rtti Enable C++ RTTI ],
[ _MOZ_USE_RTTI=1 ],
[ _MOZ_USE_RTTI= ])
if test -z "$_MOZ_USE_RTTI"; then
if test "$GNU_CC"; then
CXXFLAGS="$CXXFLAGS -fno-rtti"
else
case "$target" in
*-mingw*)
CXXFLAGS="$CXXFLAGS -GR-"
esac
fi
fi
])
dnl A high level macro for selecting compiler options.
AC_DEFUN([MOZ_COMPILER_OPTS],
[
MOZ_RTTI
if test "$CLANG_CXX"; then
## We disable return-type-c-linkage because jsval is defined as a C++ type but is
## returned by C functions. This is possible because we use knowledge about the ABI
@ -64,7 +90,7 @@ fi
if test "$GNU_CC"; then
CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections"
CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections -fno-exceptions"
fi
dnl ========================================================

View File

@ -116,8 +116,6 @@ MOZ_PGO_OPTIMIZE_FLAGS = @MOZ_PGO_OPTIMIZE_FLAGS@
MOZ_OPTIMIZE_LDFLAGS = @MOZ_OPTIMIZE_LDFLAGS@
MOZ_OPTIMIZE_SIZE_TWEAK = @MOZ_OPTIMIZE_SIZE_TWEAK@
MOZ_RTTI_FLAGS_ON = @_MOZ_RTTI_FLAGS_ON@
PROFILE_GEN_CFLAGS = @PROFILE_GEN_CFLAGS@
PROFILE_GEN_LDFLAGS = @PROFILE_GEN_LDFLAGS@
PROFILE_USE_CFLAGS = @PROFILE_USE_CFLAGS@

View File

@ -708,9 +708,6 @@ case "$target" in
AC_MSG_ERROR([This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
fi
_MOZ_RTTI_FLAGS_ON='-GR'
_MOZ_RTTI_FLAGS_OFF='-GR-'
dnl Ensure that mt.exe is 'Microsoft (R) Manifest Tool',
dnl not something else like "magnetic tape manipulation utility".
MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
@ -1573,8 +1570,6 @@ if test "$GNU_CC"; then
DSO_CFLAGS=''
DSO_PIC_CFLAGS='-fPIC'
ASFLAGS="$ASFLAGS -fPIC"
_MOZ_RTTI_FLAGS_ON=-frtti
_MOZ_RTTI_FLAGS_OFF=-fno-rtti
# Turn on GNU-specific warnings:
# -Wall - turn on a lot of warnings
@ -2627,6 +2622,7 @@ if test "$ENABLE_METHODJIT_TYPED_ARRAY"; then
AC_DEFINE(JS_METHODJIT_TYPED_ARRAY)
fi
MOZ_COMPILER_OPTS
if test -z "$SKIP_COMPILER_CHECKS"; then
dnl Checks for typedefs, structures, and compiler characteristics.
dnl ========================================================
@ -2896,7 +2892,6 @@ AC_SUBST(WRAP_SYSTEM_INCLUDES)
AC_SUBST(VISIBILITY_FLAGS)
MOZ_GCC_PR49911
MOZ_COMPILER_OPTS
dnl Check for __force_align_arg_pointer__ for SSE2 on gcc
dnl ========================================================
@ -4537,23 +4532,6 @@ if test "$ac_cv_struct_tm_zone_tm_gmtoff" = "yes" ; then
fi
fi # ! SKIP_COMPILER_CHECKS
dnl ========================================================
dnl C++ rtti
dnl Should be smarter and check that the compiler does indeed have rtti
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(cpp-rtti,
[ --enable-cpp-rtti Enable C++ RTTI ],
[ _MOZ_USE_RTTI=1 ],
[ _MOZ_USE_RTTI= ])
if test "$_MOZ_USE_RTTI"; then
_MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
else
_MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
fi
AC_SUBST(_MOZ_RTTI_FLAGS_ON)
AC_DEFINE(CPP_THROW_NEW, [throw()])
AC_LANG_C
@ -4786,7 +4764,6 @@ CFLAGS=`echo \
$CFLAGS`
CXXFLAGS=`echo \
$_MOZ_RTTI_FLAGS \
$_WARNINGS_CXXFLAGS \
$CXXFLAGS`