diff options
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 11 | ||||
-rw-r--r-- | libjava/configure.ac | 59 | ||||
-rw-r--r-- | libjava/exception.cc | 8 | ||||
-rw-r--r-- | libjava/include/config.h.in | 3 | ||||
-rw-r--r-- | libjava/include/default-signal.h | 6 | ||||
-rw-r--r-- | libjava/stacktrace.cc | 6 | ||||
-rw-r--r-- | libjava/sysdep/i386/backtrace.h | 4 |
7 files changed, 30 insertions, 67 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index c3b47463..17650b1 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,14 @@ +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. diff --git a/libjava/configure.ac b/libjava/configure.ac index 01c436d..00bbd36 100644 --- a/libjava/configure.ac +++ b/libjava/configure.ac @@ -1,4 +1,7 @@ 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]) @@ -699,58 +702,10 @@ INTERPRETER="$libgcj_interpreter" 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= @@ -1761,7 +1716,7 @@ case "${host}" in 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 diff --git a/libjava/exception.cc b/libjava/exception.cc index cc5ab7c..61734a9 100644 --- a/libjava/exception.cc +++ b/libjava/exception.cc @@ -112,7 +112,7 @@ _Jv_Throw (jthrowable value) /* 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); @@ -194,7 +194,7 @@ get_ttype_entry (_Unwind_Context *context, lsda_header_info *info, long i) // 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__) @@ -331,7 +331,7 @@ PERSONALITY_FUNCTION (int version, 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 @@ -380,7 +380,7 @@ PERSONALITY_FUNCTION (int version, 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 diff --git a/libjava/include/config.h.in b/libjava/include/config.h.in index 8e718ac..ea5afe2 100644 --- a/libjava/include/config.h.in +++ b/libjava/include/config.h.in @@ -423,9 +423,6 @@ /* 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 diff --git a/libjava/include/default-signal.h b/libjava/include/default-signal.h index 6aea734..629acfb 100644 --- a/libjava/include/default-signal.h +++ b/libjava/include/default-signal.h @@ -11,7 +11,7 @@ details. */ #ifndef JAVA_SIGNAL_H #define JAVA_SIGNAL_H 1 -#ifdef SJLJ_EXCEPTIONS +#ifdef __USING_SJLJ_EXCEPTIONS__ #define HANDLE_SEGV 1 #define HANDLE_FPE 1 @@ -37,7 +37,7 @@ while (0) #define MAKE_THROW_FRAME(_exception) do {} while (0) -#else /* SJLJ_EXCEPTIONS */ +#else /* __USING_SJLJ_EXCEPTIONS__ */ #undef HANDLE_SEGV #undef HANDLE_FPE @@ -45,7 +45,7 @@ while (0) #define INIT_SEGV do {} while (0) #define INIT_FPE do {} while (0) -#endif /* SJLJ_EXCEPTIONS */ +#endif /* __USING_SJLJ_EXCEPTIONS__ */ #endif /* JAVA_SIGNAL_H */ diff --git a/libjava/stacktrace.cc b/libjava/stacktrace.cc index d8d1f38..0fc91c4 100644 --- a/libjava/stacktrace.cc +++ b/libjava/stacktrace.cc @@ -325,7 +325,7 @@ _Jv_StackTrace::GetStackTraceElements (_Jv_StackTrace *trace, { 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"); @@ -344,7 +344,7 @@ _Jv_StackTrace::GetStackTraceElements (_Jv_StackTrace *trace, list->add (element); } -#else /* SJLJ_EXCEPTIONS && !WIN32 */ +#else /* __USING_SJLJ_EXCEPTIONS__ && !WIN32 */ //JvSynchronized (ncodeMap); UpdateNCodeMap (); @@ -412,7 +412,7 @@ _Jv_StackTrace::GetStackTraceElements (_Jv_StackTrace *trace, } finder->close(); -#endif /* SJLJ_EXCEPTIONS && !WIN32 */ +#endif /* __USING_SJLJ_EXCEPTIONS__ && !WIN32 */ JArray<Object *> *array = JvNewObjectArray (list->size (), &StackTraceElement::class$, NULL); diff --git a/libjava/sysdep/i386/backtrace.h b/libjava/sysdep/i386/backtrace.h index 1bad2e1..cfdf07b 100644 --- a/libjava/sysdep/i386/backtrace.h +++ b/libjava/sysdep/i386/backtrace.h @@ -36,7 +36,7 @@ struct _Unwind_Context _Jv_uintptr_t ret_addr; }; -#ifdef SJLJ_EXCEPTIONS +#ifdef __USING_SJLJ_EXCEPTIONS__ #undef _Unwind_GetIPInfo #define _Unwind_GetIPInfo(ctx,ip_before_insn) \ @@ -50,7 +50,7 @@ struct _Unwind_Context #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. */ |