diff options
-rw-r--r-- | libjava/ChangeLog | 11 | ||||
-rw-r--r-- | libjava/Makefile.in | 8 | ||||
-rw-r--r-- | libjava/aclocal.m4 | 1 | ||||
-rwxr-xr-x | libjava/configure | 92 | ||||
-rw-r--r-- | libjava/configure.ac | 3 | ||||
-rw-r--r-- | libjava/exception.cc | 4 | ||||
-rw-r--r-- | libjava/gcj/Makefile.in | 8 | ||||
-rw-r--r-- | libjava/include/Makefile.in | 8 | ||||
-rw-r--r-- | libjava/include/config.h.in | 3 | ||||
-rw-r--r-- | libjava/stacktrace.cc | 13 | ||||
-rw-r--r-- | libjava/testsuite/Makefile.in | 8 |
11 files changed, 145 insertions, 14 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index c54f4eebd6d..33b21ce28ff 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,14 @@ +2006-09-26 Jack Howarth <howarth@bromo.med.uc.edu> + + PR target/26792: + * exception.cc (PERSONALITY_FUNCTION): use _Unwind_GetIP + if HAVE_GETIPINFO not defined. + * stacktrace.cc (_Jv_StackTrace::UnwindTraceFn): Likewise. + (_Jv_StackTrace::getLineNumberForFrame): Likewise. + * configure.ac: use GCC_CHECK_UNWIND_GETIPINFO. + * aclocal.m4, configure, include/config.h.in, Makefile.in: + Rebuilt. + 2006-09-27 Tom Tromey <tromey@redhat.com> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=201712 diff --git a/libjava/Makefile.in b/libjava/Makefile.in index e81560cabc3..d514fcb8c11 100644 --- a/libjava/Makefile.in +++ b/libjava/Makefile.in @@ -82,9 +82,11 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/lib-link.m4 \ $(top_srcdir)/../config/lib-prefix.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/mingwld.m4 $(top_srcdir)/pkg.m4 \ - $(top_srcdir)/shlibpath.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/../config/tls.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \ + $(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ diff --git a/libjava/aclocal.m4 b/libjava/aclocal.m4 index 7ac7bbc7884..3ba911b2642 100644 --- a/libjava/aclocal.m4 +++ b/libjava/aclocal.m4 @@ -915,6 +915,7 @@ m4_include([../config/lib-link.m4]) m4_include([../config/lib-prefix.m4]) m4_include([../config/no-executables.m4]) m4_include([../config/tls.m4]) +m4_include([../config/unwind_ipinfo.m4]) m4_include([../libtool.m4]) m4_include([mingwld.m4]) m4_include([pkg.m4]) diff --git a/libjava/configure b/libjava/configure index 17dda7c065d..910850d4163 100755 --- a/libjava/configure +++ b/libjava/configure @@ -16496,7 +16496,7 @@ case "${host}" in mips*-*-linux*) SIGNAL_HANDLER=include/mips-signal.h ;; - *-*-darwin*) + powerpc*-*-darwin*) SIGNAL_HANDLER=include/darwin-signal.h ;; *) @@ -16654,6 +16654,96 @@ _ACEOF fi +# For _Unwind_GetIPInfo. + + + + ac_ext=cc +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 + + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" + echo "$as_me:$LINENO: checking for _Unwind_GetIPInfo" >&5 +echo $ECHO_N "checking for _Unwind_GetIPInfo... $ECHO_C" >&6 + if test "${gcc_cv_getipinfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +extern "C" { extern void _Unwind_GetIPInfo(); } +int +main () +{ +_Unwind_GetIPInfo(); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gcc_cv_getipinfo=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gcc_cv_getipinfo=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi + + if test $gcc_cv_getipinfo = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETIPINFO 1 +_ACEOF + + fi + echo "$as_me:$LINENO: result: $gcc_cv_getipinfo" >&5 +echo "${ECHO_T}$gcc_cv_getipinfo" >&6 + CXXFLAGS="$ac_save_CXXFLAGS" + 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 if linker supports static linking on a per library basis LD_START_STATIC_SPEC= LD_FINISH_STATIC_SPEC= diff --git a/libjava/configure.ac b/libjava/configure.ac index 6645723796f..ace631ab2e1 100644 --- a/libjava/configure.ac +++ b/libjava/configure.ac @@ -1480,6 +1480,9 @@ fi # See if we support thread-local storage. GCC_CHECK_TLS +# For _Unwind_GetIPInfo. +GCC_CHECK_UNWIND_GETIPINFO + # Check if linker supports static linking on a per library basis LD_START_STATIC_SPEC= LD_FINISH_STATIC_SPEC= diff --git a/libjava/exception.cc b/libjava/exception.cc index 65bc4ed196b..3d8fda1d790 100644 --- a/libjava/exception.cc +++ b/libjava/exception.cc @@ -231,9 +231,13 @@ PERSONALITY_FUNCTION (int version, // Parse the LSDA header. p = parse_lsda_header (context, language_specific_data, &info); +#ifdef HAVE_GETIPINFO ip = _Unwind_GetIPInfo (context, &ip_before_insn); if (! ip_before_insn) --ip; +#else + ip = _Unwind_GetIP (context) - 1; +#endif landing_pad = 0; action_record = 0; handler_switch_value = 0; diff --git a/libjava/gcj/Makefile.in b/libjava/gcj/Makefile.in index 116620f5073..5236544a99d 100644 --- a/libjava/gcj/Makefile.in +++ b/libjava/gcj/Makefile.in @@ -53,9 +53,11 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/lib-link.m4 \ $(top_srcdir)/../config/lib-prefix.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/mingwld.m4 $(top_srcdir)/pkg.m4 \ - $(top_srcdir)/shlibpath.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/../config/tls.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \ + $(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) CONFIG_HEADER = $(top_builddir)/include/config.h libgcj-config.h diff --git a/libjava/include/Makefile.in b/libjava/include/Makefile.in index a1018272b71..26c8ce9a582 100644 --- a/libjava/include/Makefile.in +++ b/libjava/include/Makefile.in @@ -52,9 +52,11 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/lib-link.m4 \ $(top_srcdir)/../config/lib-prefix.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/mingwld.m4 $(top_srcdir)/pkg.m4 \ - $(top_srcdir)/shlibpath.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/../config/tls.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \ + $(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) CONFIG_HEADER = config.h $(top_builddir)/gcj/libgcj-config.h diff --git a/libjava/include/config.h.in b/libjava/include/config.h.in index e6ea39495d1..a8ebfade662 100644 --- a/libjava/include/config.h.in +++ b/libjava/include/config.h.in @@ -118,6 +118,9 @@ /* Define to 1 if you have the `getifaddrs' function. */ #undef HAVE_GETIFADDRS +/* Define if _Unwind_GetIPInfo is available. */ +#undef HAVE_GETIPINFO + /* Define to 1 if you have the `getpwuid_r' function. */ #undef HAVE_GETPWUID_R diff --git a/libjava/stacktrace.cc b/libjava/stacktrace.cc index 3e6f04cd2c6..7f967baccf0 100644 --- a/libjava/stacktrace.cc +++ b/libjava/stacktrace.cc @@ -131,6 +131,7 @@ _Jv_StackTrace::UnwindTraceFn (struct _Unwind_Context *context, void *state_ptr) else #endif { +#ifdef HAVE_GETIPINFO _Unwind_Ptr ip; int ip_before_insn = 0; ip = _Unwind_GetIPInfo (context, &ip_before_insn); @@ -139,9 +140,13 @@ _Jv_StackTrace::UnwindTraceFn (struct _Unwind_Context *context, void *state_ptr) // to ensure we get the correct line number for the call itself. if (! ip_before_insn) --ip; - +#endif state->frames[pos].type = frame_native; +#ifdef HAVE_GETIPINFO state->frames[pos].ip = (void *) ip; +#else + state->frames[pos].ip = (void *) _Unwind_GetIP (context); +#endif state->frames[pos].start_ip = func_addr; } @@ -217,6 +222,12 @@ _Jv_StackTrace::getLineNumberForFrame(_Jv_StackFrame *frame, NameFinder *finder, else offset = (_Unwind_Ptr) ip - (_Unwind_Ptr) info.base; +#ifndef HAVE_GETIPINFO + // The unwinder gives us the return address. In order to get the right + // line number for the stack trace, roll it back a little. + offset -= 1; +#endif + finder->lookup (binaryName, (jlong) offset); *sourceFileName = finder->getSourceFile(); *lineNum = finder->getLineNum(); diff --git a/libjava/testsuite/Makefile.in b/libjava/testsuite/Makefile.in index 485b8eaa9a1..f419d3ced36 100644 --- a/libjava/testsuite/Makefile.in +++ b/libjava/testsuite/Makefile.in @@ -50,9 +50,11 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/lib-link.m4 \ $(top_srcdir)/../config/lib-prefix.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/mingwld.m4 $(top_srcdir)/pkg.m4 \ - $(top_srcdir)/shlibpath.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/../config/tls.m4 \ + $(top_srcdir)/../config/unwind_ipinfo.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/mingwld.m4 \ + $(top_srcdir)/pkg.m4 $(top_srcdir)/shlibpath.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) CONFIG_HEADER = $(top_builddir)/include/config.h \ |