+2015-05-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * sjlj.m4: New file.
+
2015-05-04 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* bitfields.m4: Change int to long long, and use bitfields of
--- /dev/null
+dnl Check if the compiler is configured for setjmp/longjmp exceptions.
+AC_DEFUN([GCC_CHECK_SJLJ_EXCEPTIONS],
+ [AC_CACHE_CHECK([whether the compiler is configured for setjmp/longjmp exceptions],
+ ac_cv_sjlj_exceptions,
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#ifdef __USING_SJLJ_EXCEPTIONS__
+ this will fail
+ #endif]],
+ [[int i;]])],
+ [ac_cv_sjlj_exceptions=no],
+ [ac_cv_sjlj_exceptions=yes])])])
+2015-05-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * configure.ac: Include config/sjlj.m4.
+ Remove manual SJLJ check, add GCC_CHECK_SJLJ_EXCEPTIONS and adjust.
+ * config.in: Regenerate.
+ * configure: Likewise.
+ * config.host: Replace enable_sjlj_exceptions by ac_cv_sjlj_exceptions.
+
2015-05-12 Uros Bizjak <ubizjak@gmail.com>
* libgcov-util.c: Add space between string literal and macro name.
hppa*-*-linux*)
tmake_file="$tmake_file pa/t-linux t-slibgcc-libgcc"
# Set the libgcc version number
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
else
tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
hppa[12]*-*-hpux10*)
tmake_file="$tmake_file pa/t-hpux pa/t-hpux10 t-libgcc-pic t-slibgcc"
# Set the libgcc version number
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
else
tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
hppa*64*-*-hpux11*)
tmake_file="$tmake_file pa/t-hpux pa/t-pa64 pa/t-stublib t-libgcc-pic t-slibgcc"
# Set the libgcc version number
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
else
tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
hppa[12]*-*-hpux11*)
tmake_file="$tmake_file pa/t-hpux pa/t-stublib t-libgcc-pic t-slibgcc"
# Set the libgcc version number
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
else
tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o"
fi
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_eh_file="i386/t-sjlj-eh"
else
tmake_eh_file="i386/t-dw2-eh"
extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o"
fi
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_eh_file="i386/t-sjlj-eh"
else
tmake_eh_file="i386/t-seh-eh"
;;
esac
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_eh_file="i386/t-sjlj-eh"
else
tmake_eh_file="i386/t-dw2-eh"
;;
esac
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_eh_file="i386/t-sjlj-eh"
else
tmake_eh_file="i386/t-seh-eh"
# with ELF format using glibc 2
# aka the GNU/Linux C library 6.
tmake_file="$tmake_file m68k/t-floatlib m68k/t-linux"
- # If not configured with --enable-sjlj-exceptions, bump the
+ # If not configured with setjmp/longjmp exceptions, bump the
# libgcc version number.
- if test x$enable_sjlj_exceptions != xyes; then
+ if test x$ac_cv_sjlj_exceptions != xyes; then
tmake_file="$tmake_file m68k/t-slibgcc-elf-ver"
fi
md_unwind_header=m68k/linux-unwind.h
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define if the C compiler is configured for setjmp/longjmp exceptions. */
-#undef LIBGCC_SJLJ_EXCEPTIONS
-
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
with_build_libsubdir
enable_decimal_float
with_system_libunwind
-enable_sjlj_exceptions
enable_explicit_exception_frame_registration
with_glibc_version
enable_tls
enable decimal float extension to C. Selecting 'bid'
or 'dpd' choses which decimal floating point format
to use
- --enable-sjlj-exceptions
- force use of builtin_setjmp for exceptions
--enable-explicit-exception-frame-registration
register exception tables explicitly at module
start, for use e.g. for compatibility with
fi
-# The sjlj test is almost duplicated here and in libgo/configure.ac (for C),
-# libstdc++-v3/acinclude.m4 and libjava/configure.ac (for C++), and
-# libobjc/configure.ac (for Objective-C).
-# FIXME: This should be centralized in config/sjlj.m4.
-# Check whether --enable-sjlj-exceptions was given.
-if test "${enable_sjlj_exceptions+set}" = set; then :
- enableval=$enable_sjlj_exceptions; case "$enableval" in
- yes|no|auto) ;;
- *) as_fn_error "unknown argument to --enable-sjlj-exceptions" "$LINENO" 5 ;;
- esac
-else
- enable_sjlj_exceptions=auto
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use setjmp/longjmp exceptions" >&5
-$as_echo_n "checking whether to use setjmp/longjmp exceptions... " >&6; }
-if test "${libgcc_cv_lib_sjlj_exceptions+set}" = set; then :
+# Check if the compiler is configured for setjmp/longjmp exceptions.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is configured for setjmp/longjmp exceptions" >&5
+$as_echo_n "checking whether the compiler is configured for setjmp/longjmp exceptions... " >&6; }
+if test "${ac_cv_sjlj_exceptions+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
-void bar ();
-void clean (int *);
-void foo ()
+#ifdef __USING_SJLJ_EXCEPTIONS__
+ this will fail
+ #endif
+int
+main ()
{
- int i __attribute__ ((cleanup (clean)));
- bar();
+int i;
+ ;
+ return 0;
}
-
_ACEOF
-CFLAGS_hold=$CFLAGS
-CFLAGS="--save-temps -fexceptions"
-libgcc_cv_lib_sjlj_exceptions=unknown
-if ac_fn_c_try_compile; then :
- if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
- libgcc_cv_lib_sjlj_exceptions=yes
- elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
- libgcc_cv_lib_sjlj_exceptions=no
- fi
-fi
-CFLAGS=$CFLAGS_hold
-rm -f conftest*
-
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sjlj_exceptions=no
+else
+ ac_cv_sjlj_exceptions=yes
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_lib_sjlj_exceptions" >&5
-$as_echo "$libgcc_cv_lib_sjlj_exceptions" >&6; }
-
-if test "$enable_sjlj_exceptions" = "auto"; then
- enable_sjlj_exceptions=$libgcc_cv_lib_sjlj_exceptions
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-
-case $enable_sjlj_exceptions in
-yes)
-
-$as_echo "#define LIBGCC_SJLJ_EXCEPTIONS 1" >>confdefs.h
-
- ;;
-no)
- ;;
-*)
- as_fn_error "unable to detect exception model" "$LINENO" 5
- ;;
-esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sjlj_exceptions" >&5
+$as_echo "$ac_cv_sjlj_exceptions" >&6; }
# Check whether --enable-explicit-exception-frame-registration was given.
if test "${enable_explicit_exception_frame_registration+set}" = set; then :
enableval=$enable_explicit_exception_frame_registration;
force_explicit_eh_registry=
if test "$enable_explicit_exception_frame_registration" = yes; then
- if test "$enable_sjlj_exceptions" = yes; then
- as_fn_error "Can't enable both of --enable-sjlj-exceptions
- and --enable-explicit-exception-frame-registration" "$LINENO" 5
+ if test $ac_cv_sjlj_exceptions = yes; then
+ as_fn_error "Can't --enable-explicit-exception-frame-registration
+ with setjmp/longjmp exceptions" "$LINENO" 5
fi
force_explicit_eh_registry=-DUSE_EH_FRAME_REGISTRY_ALWAYS
fi
sinclude(../config/dfp.m4)
sinclude(../config/unwind_ipinfo.m4)
sinclude(../config/gthr.m4)
+sinclude(../config/sjlj.m4)
AC_PREREQ(2.64)
AC_INIT([GNU C Runtime Library], 1.0,,[libgcc])
# config.gcc also contains tests of with_system_libunwind.
GCC_CHECK_UNWIND_GETIPINFO
-# The sjlj test is almost duplicated here and in libgo/configure.ac (for C),
-# libstdc++-v3/acinclude.m4 and libjava/configure.ac (for C++), and
-# libobjc/configure.ac (for Objective-C).
-# FIXME: This should be centralized in config/sjlj.m4.
-AC_ARG_ENABLE(sjlj-exceptions,
- AC_HELP_STRING([--enable-sjlj-exceptions],
- [force use of builtin_setjmp for exceptions]),
- [case "$enableval" in
- yes|no|auto) ;;
- *) AC_MSG_ERROR([unknown argument to --enable-sjlj-exceptions]) ;;
- esac],
- [enable_sjlj_exceptions=auto])
-
-AC_CACHE_CHECK([whether to use setjmp/longjmp exceptions],
-[libgcc_cv_lib_sjlj_exceptions],
-[AC_LANG_CONFTEST(
- [AC_LANG_SOURCE([
-void bar ();
-void clean (int *);
-void foo ()
-{
- int i __attribute__ ((cleanup (clean)));
- bar();
-}
-])])
-CFLAGS_hold=$CFLAGS
-CFLAGS="--save-temps -fexceptions"
-libgcc_cv_lib_sjlj_exceptions=unknown
-AS_IF([ac_fn_c_try_compile],
- [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
- libgcc_cv_lib_sjlj_exceptions=yes
- elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
- libgcc_cv_lib_sjlj_exceptions=no
- fi])
-CFLAGS=$CFLAGS_hold
-rm -f conftest*
-])
-
-if test "$enable_sjlj_exceptions" = "auto"; then
- enable_sjlj_exceptions=$libgcc_cv_lib_sjlj_exceptions
-fi
-
-case $enable_sjlj_exceptions in
-yes)
- AC_DEFINE(LIBGCC_SJLJ_EXCEPTIONS, 1,
- [Define if the C compiler is configured for setjmp/longjmp exceptions.])
- ;;
-no)
- ;;
-*)
- AC_MSG_ERROR([unable to detect exception model])
- ;;
-esac
+# Check if the compiler is configured for setjmp/longjmp exceptions.
+GCC_CHECK_SJLJ_EXCEPTIONS
AC_ARG_ENABLE([explicit-exception-frame-registration],
[AC_HELP_STRING([--enable-explicit-exception-frame-registration],
[
force_explicit_eh_registry=
if test "$enable_explicit_exception_frame_registration" = yes; then
- if test "$enable_sjlj_exceptions" = yes; then
- AC_MSG_ERROR([Can't enable both of --enable-sjlj-exceptions
- and --enable-explicit-exception-frame-registration])
+ if test $ac_cv_sjlj_exceptions = yes; then
+ AC_MSG_ERROR([Can't --enable-explicit-exception-frame-registration
+ with setjmp/longjmp exceptions])
fi
force_explicit_eh_registry=-DUSE_EH_FRAME_REGISTRY_ALWAYS
fi
+2015-05-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * configure.ac: Include config/sjlj.m4.
+ Remove manual SJLJ check, add GCC_CHECK_SJLJ_EXCEPTIONS and adjust.
+ * include/config.h.in: Regenerate.
+ * configure: Likewise.
+ * exception.cc: Replace SJLJ_EXCEPTIONS by __USING_SJLJ_EXCEPTIONS__.
+ * stacktrace.cc: Likewise.
+ * include/default-signal.h: Likewise.
+ * sysdep/i386/backtrace.h: Likewise.
+
2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
* Makefile.in: Regenerated with automake-1.11.6.
dnl # Process this with autoconf to create configure
+
+sinclude(../config/sjlj.m4)
+
AC_PREREQ(2.64)
# Still use "libjava" here to placate dejagnu.
AC_INIT([libjava], [version-unused],, [libjava])
AC_SUBST(INTERPRETER)
AM_CONDITIONAL(INTERPRETER, test "$libgcj_interpreter" = yes)
-AC_MSG_CHECKING([for exception model to use])
-AC_LANG_PUSH(C++)
-AC_ARG_ENABLE(sjlj-exceptions,
- AS_HELP_STRING([--enable-sjlj-exceptions],
- [force use of builtin_setjmp for exceptions]),
-[:],
-[dnl Botheration. Now we've got to detect the exception model.
-dnl Link tests against libgcc.a are problematic since -- at least
-dnl as of this writing -- we've not been given proper -L bits for
-dnl single-tree newlib and libgloss.
-dnl
-dnl This is what AC_TRY_COMPILE would do if it didn't delete the
-dnl conftest files before we got a change to grep them first.
-cat > conftest.$ac_ext << EOF
-[#]line __oline__ "configure"
-struct S { ~S(); };
-void bar();
-void foo()
-{
- S s;
- bar();
-}
-EOF
-old_CXXFLAGS="$CXXFLAGS"
-CXXFLAGS=-S
-if AC_TRY_EVAL(ac_compile); then
- if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=yes
- elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=no
- elif grep __cxa_end_cleanup conftest.s >/dev/null 2>&1 ; then
- # ARM EH ABI.
- enable_sjlj_exceptions=no
- fi
-fi
-CXXFLAGS="$old_CXXFLAGS"
-rm -f conftest*])
-if test x$enable_sjlj_exceptions = xyes; then
- AC_DEFINE(SJLJ_EXCEPTIONS, 1,
- [Define if the compiler is configured for setjmp/longjmp exceptions.])
- ac_exception_model_name=sjlj
-elif test x$enable_sjlj_exceptions = xno; then
- ac_exception_model_name="call frame"
-else
- AC_MSG_ERROR([unable to detect exception model])
-fi
-AC_LANG_POP(C++)
-AC_MSG_RESULT($ac_exception_model_name)
-
-# If we are non using SJLJ exceptions, and this host does not have support
+# If we are not using SJLJ exceptions, and this host does not have support
# for unwinding from a signal handler, enable checked dereferences and divides.
-if test $can_unwind_signal = no && test $enable_sjlj_exceptions = no; then
+GCC_CHECK_SJLJ_EXCEPTIONS
+if test $ac_cv_sjlj_exceptions = no && test $can_unwind_signal = no; then
CHECKREFSPEC=-fcheck-references
DIVIDESPEC=-fuse-divide-subroutine
EXCEPTIONSPEC=
esac
# If we're using sjlj exceptions, forget what we just learned.
-if test "$enable_sjlj_exceptions" = yes; then
+if test "$ac_cv_sjlj_exceptions" = yes; then
SIGNAL_HANDLER=include/default-signal.h
SIGNAL_HANDLER_AUX=
fi
/* We're happy with setjmp/longjmp exceptions or region-based
exception handlers: entry points are provided here for both. */
-#ifdef SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
_Unwind_SjLj_RaiseException (&xh->unwindHeader);
#else
_Unwind_RaiseException (&xh->unwindHeader);
// Using a different personality function name causes link failures
// when trying to mix code using different exception handling models.
-#ifdef SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
#define PERSONALITY_FUNCTION __gcj_personality_sj0
#define __builtin_eh_return_data_regno(x) x
#elif defined (__SEH__)
action_record = 0;
handler_switch_value = 0;
-#ifdef SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
// The given "IP" is an index into the call-site table, with two
// exceptions -- -1 means no-action, and 0 means terminate. But
// since we're using uleb128 values, we've not got random access
goto found_something;
}
}
-#endif // SJLJ_EXCEPTIONS
+#endif // __USING_SJLJ_EXCEPTIONS__
// If ip is not present in the table, C++ would call terminate.
// ??? It is perhaps better to tweek the LSDA so that no-action
/* The size of `void *', as computed by sizeof. */
#undef SIZEOF_VOID_P
-/* Define if the compiler is configured for setjmp/longjmp exceptions. */
-#undef SJLJ_EXCEPTIONS
-
/* Define if if the synchronization code should try to avoid pthread_self
calls by caching thread IDs in a hashtable. */
#undef SLOW_PTHREAD_SELF
#ifndef JAVA_SIGNAL_H
#define JAVA_SIGNAL_H 1
-#ifdef SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
#define HANDLE_SEGV 1
#define HANDLE_FPE 1
#define MAKE_THROW_FRAME(_exception) do {} while (0)
-#else /* SJLJ_EXCEPTIONS */
+#else /* __USING_SJLJ_EXCEPTIONS__ */
#undef HANDLE_SEGV
#undef HANDLE_FPE
#define INIT_SEGV do {} while (0)
#define INIT_FPE do {} while (0)
-#endif /* SJLJ_EXCEPTIONS */
+#endif /* __USING_SJLJ_EXCEPTIONS__ */
#endif /* JAVA_SIGNAL_H */
{
ArrayList *list = new ArrayList ();
-#if defined (SJLJ_EXCEPTIONS) && ! defined (WIN32)
+#if defined (__USING_SJLJ_EXCEPTIONS__) && ! defined (WIN32)
// We can't use the nCodeMap without unwinder support. Instead,
// fake the method name by giving the IP in hex - better than nothing.
jstring hex = JvNewStringUTF ("0x");
list->add (element);
}
-#else /* SJLJ_EXCEPTIONS && !WIN32 */
+#else /* __USING_SJLJ_EXCEPTIONS__ && !WIN32 */
//JvSynchronized (ncodeMap);
UpdateNCodeMap ();
}
finder->close();
-#endif /* SJLJ_EXCEPTIONS && !WIN32 */
+#endif /* __USING_SJLJ_EXCEPTIONS__ && !WIN32 */
JArray<Object *> *array = JvNewObjectArray (list->size (),
&StackTraceElement::class$, NULL);
_Jv_uintptr_t ret_addr;
};
-#ifdef SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
#undef _Unwind_GetIPInfo
#define _Unwind_GetIPInfo(ctx,ip_before_insn) \
#define _Unwind_Backtrace(trace_fn,state_ptr) \
(fallback_backtrace (trace_fn, state_ptr))
-#endif /* SJLJ_EXCEPTIONS */
+#endif /* __USING_SJLJ_EXCEPTIONS__ */
/* Unwind through the call stack calling TRACE_FN with STATE for each stack
frame. Returns the reason why the unwinding was stopped. */
+2015-05-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * configure.ac: Remove manual SJLJ check.
+ * config.h.in: Regenerate.
+ * configure: Likewise.
+ * exception.c: Replace SJLJ_EXCEPTIONS by __USING_SJLJ_EXCEPTIONS__.
+
2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
* aclocal.m4: Regenerated with automake-1.11.6.
/* Define to the version of this package. */
#undef PACKAGE_VERSION
-/* Define if the compiler is configured for setjmp/longjmp exceptions. */
-#undef SJLJ_EXCEPTIONS
-
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
with_gnu_ld
enable_libtool_lock
enable_tls
-enable_sjlj_exceptions
'
ac_precious_vars='build_alias
host_alias
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-tls Use thread-local storage [default=yes]
- --enable-sjlj-exceptions
- force use of builtin_setjmp for exceptions
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10604 "configure"
+#line 10601 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10710 "configure"
+#line 10707 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for exception model to use" >&5
-$as_echo_n "checking for exception model to use... " >&6; }
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-# Check whether --enable-sjlj-exceptions was given.
-if test "${enable_sjlj_exceptions+set}" = set; then :
- enableval=$enable_sjlj_exceptions; :
-else
- cat > conftest.$ac_ext << EOF
-#line 11481 "configure"
-@interface Frob
-@end
-@implementation Frob
-@end
-int proc();
-int foo()
-{
- @try {
- return proc();
- }
- @catch (Frob* ex) {
- return 0;
- }
-}
-EOF
-old_CFLAGS="$CFLAGS"
-CFLAGS="-x objective-c -fgnu-runtime -fobjc-exceptions -S"
-if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=yes
- elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=no
- fi
-fi
-CFLAGS="$old_CFLAGS"
-rm -f conftest*
-fi
-
-if test x$enable_sjlj_exceptions = xyes; then
-
-$as_echo "#define SJLJ_EXCEPTIONS 1" >>confdefs.h
-
- ac_exception_model_name=sjlj
-elif test x$enable_sjlj_exceptions = xno; then
- ac_exception_model_name="call frame"
-else
- as_fn_error "unable to detect exception model" "$LINENO" 5
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_exception_model_name" >&5
-$as_echo "$ac_exception_model_name" >&6; }
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the type of bitfields matters" >&5
$as_echo_n "checking if the type of bitfields matters... " >&6; }
# Check if we have thread-local storage
GCC_CHECK_TLS
-AC_MSG_CHECKING([for exception model to use])
-AC_LANG_PUSH(C)
-AC_ARG_ENABLE(sjlj-exceptions,
- AS_HELP_STRING([--enable-sjlj-exceptions],
- [force use of builtin_setjmp for exceptions]),
-[:],
-[dnl Botheration. Now we've got to detect the exception model.
-dnl Link tests against libgcc.a are problematic since -- at least
-dnl as of this writing -- we've not been given proper -L bits for
-dnl single-tree newlib and libgloss.
-dnl
-dnl This is what AC_TRY_COMPILE would do if it didn't delete the
-dnl conftest files before we got a change to grep them first.
-cat > conftest.$ac_ext << EOF
-[#]line __oline__ "configure"
-@interface Frob
-@end
-@implementation Frob
-@end
-int proc();
-int foo()
-{
- @try {
- return proc();
- }
- @catch (Frob* ex) {
- return 0;
- }
-}
-EOF
-old_CFLAGS="$CFLAGS"
-dnl work around that we don't have Objective-C support in autoconf
-CFLAGS="-x objective-c -fgnu-runtime -fobjc-exceptions -S"
-if AC_TRY_EVAL(ac_compile); then
- if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=yes
- elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=no
- fi
-fi
-CFLAGS="$old_CFLAGS"
-rm -f conftest*])
-if test x$enable_sjlj_exceptions = xyes; then
- AC_DEFINE(SJLJ_EXCEPTIONS, 1,
- [Define if the compiler is configured for setjmp/longjmp exceptions.])
- ac_exception_model_name=sjlj
-elif test x$enable_sjlj_exceptions = xno; then
- ac_exception_model_name="call frame"
-else
- AC_MSG_ERROR([unable to detect exception model])
-fi
-AC_LANG_POP(C)
-AC_MSG_RESULT($ac_exception_model_name)
-
gt_BITFIELD_TYPE_MATTERS
# ------
/* Using a different personality function name causes link failures
when trying to mix code using different exception handling
models. */
-#ifdef SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
#define PERSONALITY_FUNCTION __gnu_objc_personality_sj0
#define __builtin_eh_return_data_regno(x) x
-#elif defined(__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)
+#elif defined(__SEH__)
#define PERSONALITY_FUNCTION __gnu_objc_personality_imp
#else
#define PERSONALITY_FUNCTION __gnu_objc_personality_v0
action_record = 0;
handler_switch_value = 0;
-#ifdef SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
/* The given "IP" is an index into the call-site table, with two
exceptions -- -1 means no-action, and 0 means terminate. But
since we're using uleb128 values, we've not got random access to
goto found_something;
}
}
-#endif /* SJLJ_EXCEPTIONS */
+#endif /* __USING_SJLJ_EXCEPTIONS__ */
/* If ip is not present in the table, C++ would call terminate. */
/* ??? As with Java, it's perhaps better to tweek the LSDA to that
header->base.exception_cleanup = __objc_exception_cleanup;
header->value = exception;
-#ifdef SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
_Unwind_SjLj_RaiseException (&header->base);
#else
_Unwind_RaiseException (&header->base);
+2015-05-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * acinclude.m4 (GLIBCXX_ENABLE_SJLJ_EXCEPTIONS): Delete.
+ * configure.ac: Remove GLIBCXX_ENABLE_SJLJ_EXCEPTIONS.
+ * config.h.in: Regenerate.
+ * configure: Likewise.
+ * libsupc++/eh_personality.cc: Replace _GLIBCXX_SJLJ_EXCEPTIONS by
+ __USING_SJLJ_EXCEPTIONS__.
+ * libsupc++/eh_throw.cc: Likewise.
+ * libsupc++/eh_ptr.cc: Likewise.
+ * doc/html/manual/appendix_porting.html: Remove
+ GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
+ * doc/xml/manual/build_hacking.xml: Likewise.
+ * doc/html/manual/configure.html: Remove --enable-sjlj-exceptions.
+ * doc/xml/manual/configure.xml: Likewise.
+
2015-05-13 Jonathan Wakely <jwakely@redhat.com>
* include/bits/shared_ptr_base.h (__shared_count(unique_ptr&&)): Check
])
-dnl
-dnl Check for exception handling support. If an explicit enable/disable
-dnl sjlj exceptions is given, we don't have to detect. Otherwise the
-dnl target may or may not support call frame exceptions.
-dnl
-dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
-dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
-dnl Neither one forces an attempt at detection.
-dnl
-dnl Defines:
-dnl _GLIBCXX_SJLJ_EXCEPTIONS if the compiler is configured for it
-dnl
-AC_DEFUN([GLIBCXX_ENABLE_SJLJ_EXCEPTIONS], [
- AC_MSG_CHECKING([for exception model to use])
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- GLIBCXX_ENABLE(sjlj-exceptions,auto,,
- [force use of builtin_setjmp for exceptions],
- [permit yes|no|auto])
-
- if test $enable_sjlj_exceptions = auto; then
- # Botheration. Now we've got to detect the exception model. Link tests
- # against libgcc.a are problematic since we've not been given proper -L
- # bits for single-tree newlib and libgloss.
- #
- # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
- cat > conftest.$ac_ext << EOF
-[#]line __oline__ "configure"
-struct S { ~S(); };
-void bar();
-void foo()
-{
- S s;
- bar();
-}
-EOF
- old_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=-S
- if AC_TRY_EVAL(ac_compile); then
- if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=yes
- elif grep _Unwind_SjLj_Register conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=yes
- elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=no
- elif grep __cxa_end_cleanup conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=no
- fi
- fi
- CXXFLAGS="$old_CXXFLAGS"
- rm -f conftest*
- fi
-
- # This is a tad weird, for hysterical raisins. We have to map
- # enable/disable to two different models.
- case $enable_sjlj_exceptions in
- yes)
- AC_DEFINE(_GLIBCXX_SJLJ_EXCEPTIONS, 1,
- [Define if the compiler is configured for setjmp/longjmp exceptions.])
- ac_exception_model_name=sjlj
- ;;
- no)
- ac_exception_model_name="call frame"
- ;;
- *)
- AC_MSG_ERROR([unable to detect exception model])
- ;;
- esac
- AC_LANG_RESTORE
- AC_MSG_RESULT($ac_exception_model_name)
-])
-
-
dnl
dnl Allow visibility attributes to be used on namespaces, objects, etc.
dnl
/* Define if size_t is unsigned int. */
#undef _GLIBCXX_SIZE_T_IS_UINT
-/* Define if the compiler is configured for setjmp/longjmp exceptions. */
-#undef _GLIBCXX_SJLJ_EXCEPTIONS
-
/* Define to the value of the EOF integer constant. */
#undef _GLIBCXX_STDIO_EOF
enable_libtool_lock
enable_hosted_libstdcxx
enable_libstdcxx_verbose
-enable_sjlj_exceptions
enable_libstdcxx_pch
enable_cstdio
enable_clocale
only build freestanding C++ runtime support
--disable-libstdcxx-verbose
disable termination messages to standard error
- --enable-sjlj-exceptions
- force use of builtin_setjmp for exceptions
- [default=auto]
--enable-libstdcxx-pch build pre-compiled libstdc++ headers
[default=$is_hosted]
--enable-cstdio[=PACKAGE]
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11658 "configure"
+#line 11654 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11764 "configure"
+#line 11760 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
# Enable compiler support that doesn't require linking.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exception model to use" >&5
-$as_echo_n "checking for exception model to use... " >&6; }
-
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- # Check whether --enable-sjlj-exceptions was given.
-if test "${enable_sjlj_exceptions+set}" = set; then :
- enableval=$enable_sjlj_exceptions;
- case "$enableval" in
- yes|no|auto) ;;
- *) as_fn_error "Unknown argument to enable/disable sjlj-exceptions" "$LINENO" 5 ;;
- esac
-
-else
- enable_sjlj_exceptions=auto
-fi
-
-
-
- if test $enable_sjlj_exceptions = auto; then
- # Botheration. Now we've got to detect the exception model. Link tests
- # against libgcc.a are problematic since we've not been given proper -L
- # bits for single-tree newlib and libgloss.
- #
- # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
- cat > conftest.$ac_ext << EOF
-#line 15184 "configure"
-struct S { ~S(); };
-void bar();
-void foo()
-{
- S s;
- bar();
-}
-EOF
- old_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=-S
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=yes
- elif grep _Unwind_SjLj_Register conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=yes
- elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=no
- elif grep __cxa_end_cleanup conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=no
- fi
- fi
- CXXFLAGS="$old_CXXFLAGS"
- rm -f conftest*
- fi
-
- # This is a tad weird, for hysterical raisins. We have to map
- # enable/disable to two different models.
- case $enable_sjlj_exceptions in
- yes)
-
-$as_echo "#define _GLIBCXX_SJLJ_EXCEPTIONS 1" >>confdefs.h
-
- ac_exception_model_name=sjlj
- ;;
- no)
- ac_exception_model_name="call frame"
- ;;
- *)
- as_fn_error "unable to detect exception model" "$LINENO" 5
- ;;
- esac
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_exception_model_name" >&5
-$as_echo "$ac_exception_model_name" >&6; }
-
-
# Check whether --enable-libstdcxx-pch was given.
if test "${enable_libstdcxx_pch+set}" = set; then :
enableval=$enable_libstdcxx_pch;
# Fake what AC_TRY_COMPILE does.
cat > conftest.$ac_ext << EOF
-#line 15536 "configure"
+#line 15446 "configure"
int main()
{
typedef bool atomic_type;
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15571 "configure"
+#line 15481 "configure"
int main()
{
typedef short atomic_type;
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15606 "configure"
+#line 15516 "configure"
int main()
{
// NB: _Atomic_word not necessarily int.
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15642 "configure"
+#line 15552 "configure"
int main()
{
typedef long long atomic_type;
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15721 "configure"
+#line 15631 "configure"
int main()
{
_Decimal32 d1;
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15763 "configure"
+#line 15673 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15797 "configure"
+#line 15707 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
GLIBCXX_ENABLE_VERBOSE
# Enable compiler support that doesn't require linking.
-GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
GLIBCXX_ENABLE_PCH($is_hosted)
GLIBCXX_ENABLE_THREADS
GLIBCXX_ENABLE_ATOMIC_BUILTINS
GLIBCXX_ENABLE_DEBUG_FLAGS
GLIBCXX_ENABLE_LONG_LONG
GLIBCXX_ENABLE_PCH
- GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
GLIBCXX_ENABLE_SYMVERS
GLIBCXX_ENABLE_THREADS
</pre><p>
libstdc++ built many different ways: "-msoft-float"
and not, etc. A different libstdc++ will be built for each of
the different multilib versions. This option is on by default.
- </p></dd><dt><span class="term"><code class="code">--enable-sjlj-exceptions</code></span></dt><dd><p>Forces old, set-jump/long-jump exception handling model. If
- at all possible, the new, frame unwinding exception handling routines
- should be used instead, as they significantly reduce both
- runtime memory usage and executable size. This option can
- change the library ABI.
</p></dd><dt><span class="term"><code class="code">--enable-version-specific-runtime-libs</code></span></dt><dd><p>Specify that run-time libraries should be installed in the
compiler-specific subdirectory (i.e.,
<code class="code">${libdir}/gcc-lib/${target_alias}/${gcc_version}</code>)
GLIBCXX_ENABLE_DEBUG_FLAGS
GLIBCXX_ENABLE_LONG_LONG
GLIBCXX_ENABLE_PCH
- GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
GLIBCXX_ENABLE_SYMVERS
GLIBCXX_ENABLE_THREADS
</programlisting>
</para>
</listitem></varlistentry>
- <varlistentry><term><code>--enable-sjlj-exceptions</code></term>
- <listitem><para>Forces old, set-jump/long-jump exception handling model. If
- at all possible, the new, frame unwinding exception handling routines
- should be used instead, as they significantly reduce both
- runtime memory usage and executable size. This option can
- change the library ABI.
- </para>
- </listitem></varlistentry>
-
<varlistentry><term><code>--enable-version-specific-runtime-libs</code></term>
<listitem><para>Specify that run-time libraries should be installed in the
compiler-specific subdirectory (i.e.,
// Using a different personality function name causes link failures
// when trying to mix code using different exception handling models.
-#ifdef _GLIBCXX_SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
#define PERSONALITY_FUNCTION __gxx_personality_sj0
#define __builtin_eh_return_data_regno(x) x
-#elif defined(__SEH__) && !defined (_GLIBCXX_SJLJ_EXCEPTIONS)
+#elif defined(__SEH__)
#define PERSONALITY_FUNCTION __gxx_personality_imp
#else
#define PERSONALITY_FUNCTION __gxx_personality_v0
#endif
-#if defined (__SEH__) && !defined (_GLIBCXX_SJLJ_EXCEPTIONS)
+#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)
static
#else
extern "C"
action_record = 0;
handler_switch_value = 0;
-#ifdef _GLIBCXX_SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
// The given "IP" is an index into the call-site table, with two
// exceptions -- -1 means no-action, and 0 means terminate. But
// since we're using uleb128 values, we've not got random access
goto found_something;
}
}
-#endif // _GLIBCXX_SJLJ_EXCEPTIONS
+#endif // __USING_SJLJ_EXCEPTIONS__
// If ip is not present in the table, call terminate. This is for
// a destructor inside a cleanup, or a library routine the compiler
}
#endif
-#if defined (__SEH__) && !defined (_GLIBCXX_SJLJ_EXCEPTIONS)
+#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)
extern "C"
EXCEPTION_DISPOSITION
__gxx_personality_seh0 (PEXCEPTION_RECORD ms_exc, void *this_frame,
__cxa_eh_globals *globals = __cxa_get_globals ();
globals->uncaughtExceptions += 1;
-#ifdef _GLIBCXX_SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
_Unwind_SjLj_RaiseException (&dep->unwindHeader);
#else
_Unwind_RaiseException (&dep->unwindHeader);
__GXX_INIT_PRIMARY_EXCEPTION_CLASS(header->exc.unwindHeader.exception_class);
header->exc.unwindHeader.exception_cleanup = __gxx_exception_cleanup;
-#ifdef _GLIBCXX_SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
_Unwind_SjLj_RaiseException (&header->exc.unwindHeader);
#else
_Unwind_RaiseException (&header->exc.unwindHeader);
header->exceptionType);
}
-#ifdef _GLIBCXX_SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
_Unwind_SjLj_Resume_or_Rethrow (&header->unwindHeader);
#else
#if defined(_LIBUNWIND_STD_ABI)