From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path:
Received: (qmail 100831 invoked by alias); 12 May 2015 16:45:32 -0000
Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id:
List-Subscribe:
List-Archive:
List-Post:
List-Help: ,
Sender: java-patches-owner@gcc.gnu.org
Received: (qmail 100796 invoked by uid 89); 12 May 2015 16:45:31 -0000
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_50,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2
X-Spam-User: qpsmtpd, 3 recipients
X-HELO: smtp.eu.adacore.com
Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 12 May 2015 16:45:27 +0000
Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 454882851380; Tue, 12 May 2015 18:45:22 +0200 (CEST)
Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OXpblhDLZej3; Tue, 12 May 2015 18:45:22 +0200 (CEST)
Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id BAE44285134E; Tue, 12 May 2015 18:45:21 +0200 (CEST)
From: Eric Botcazou
To: gcc-patches@gcc.gnu.org
Cc: libstdc++@gcc.gnu.org, java-patches@gcc.gnu.org
Subject: [patch] Clean up detection of SJLJ exceptions in target libraries
Date: Tue, 12 May 2015 16:45:00 -0000
Message-ID: <1440100.16fMh0Bpp2@polaris>
User-Agent: KMail/4.7.2 (Linux/3.1.10-1.29-desktop; KDE/4.7.2; x86_64; ; )
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="nextPart3761427.DhqMAM6DDF"
Content-Transfer-Encoding: 7Bit
X-SW-Source: 2015-q2/txt/msg00009.txt.bz2
--nextPart3761427.DhqMAM6DDF
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Content-length: 2810
Hi,
6 target libraries in the tree detect whether they are being compiled by a
compiler configured for setjmp/longjmp exceptions: libada, libgcc, libgo,
libjava, libobjc and libstdc++. They can be divided into 3 categories:
1) libada only checks the preprocessor macro __USING_SJLJ_EXCEPTIONS__,
2) libgcc and libgo both check the preprocessor macro and implement a
configure check that defines another macro (LIBGCC_SJLJ_EXCEPTIONS and
LIBGO_SJLJ_EXCEPTIONS resp) so they'd better agree.
3) libjava, libobjc and libstdc++ implement a configure check that defines a
macro (SJLJ_EXCEPTIONS, SJLJ_EXCEPTIONS and _GLIBCXX_SJLJ_EXCEPTIONS resp).
The attached patch gets rid of the library-specific macros and replaces them
with __USING_SJLJ_EXCEPTIONS__. Moreover, it adds a config/sjlj.m4 fragment
that defines GCC_CHECK_SJLJ_EXCEPTIONS for libraries that need to detect the
exception model in the configure phase (libgcc and libjava only).
Tested on x86_64-suse-linux with --enable-sjlj-exceptions. The results are
not clean (except for objc and obj-c++) but sufficient to see that exceptions
still work after the patch. OK for the mainline?
2015-05-12 Eric Botcazou
config/
* sjlj.m4: New file.
libgcc/
* 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.
libgo/
* configure.ac: Remove manual SJLJ check.
* config.h.in: Regenerate.
* configure: Likewise.
* runtime/go-unwind.c: Replace LIBGO_SJLJ_EXCEPTIONS by
__USING_SJLJ_EXCEPTIONS__.
libjava/
* 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.
libobjc/
* configure.ac: Remove manual SJLJ check.
* config.h.in: Regenerate.
* configure: Likewise.
* exception.c: Replace SJLJ_EXCEPTIONS by __USING_SJLJ_EXCEPTIONS__.
libstdc++-v3/
* 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.
--
Eric Botcazou
--nextPart3761427.DhqMAM6DDF
Content-Disposition: attachment; filename="sjlj_libs.diff"
Content-Transfer-Encoding: 7Bit
Content-Type: text/x-patch; charset="utf-8"; name="sjlj_libs.diff"
Content-length: 30022
Index: config/sjlj.m4
===================================================================
--- config/sjlj.m4 (revision 0)
+++ config/sjlj.m4 (revision 0)
@@ -0,0 +1,12 @@
+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])])])
Index: libgcc/config.host
===================================================================
--- libgcc/config.host (revision 222673)
+++ libgcc/config.host (working copy)
@@ -498,7 +498,7 @@ hppa*64*-*-linux*)
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"
@@ -509,7 +509,7 @@ hppa*-*-linux*)
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"
@@ -520,7 +520,7 @@ hppa[12]*-*-hpux10*)
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"
@@ -533,7 +533,7 @@ hppa*64*-*-hpux11*)
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"
@@ -634,7 +634,7 @@ i[34567]86-*-cygwin*)
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"
@@ -653,7 +653,7 @@ x86_64-*-cygwin*)
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"
@@ -681,7 +681,7 @@ i[34567]86-*-mingw*)
;;
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"
@@ -705,7 +705,7 @@ x86_64-*-mingw*)
;;
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"
@@ -798,9 +798,9 @@ m68k-*-linux*) # Motorola m68k's runni
# 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
Index: libgcc/configure.ac
===================================================================
--- libgcc/configure.ac (revision 222673)
+++ libgcc/configure.ac (working copy)
@@ -10,6 +10,7 @@ sinclude(../config/picflag.m4)
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])
@@ -230,59 +231,8 @@ AC_SUBST(fixed_point)
# 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],
@@ -291,9 +241,9 @@ AC_ARG_ENABLE([explicit-exception-frame-
[
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
Index: libgo/runtime/go-unwind.c
===================================================================
--- libgo/runtime/go-unwind.c (revision 222673)
+++ libgo/runtime/go-unwind.c (working copy)
@@ -141,7 +141,7 @@ __go_check_defer (_Bool *frame)
hdr = (struct _Unwind_Exception *) g->exception;
-#ifdef LIBGO_SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
_Unwind_SjLj_Resume_or_Rethrow (hdr);
#else
#if defined(_LIBUNWIND_STD_ABI)
Index: libgo/configure.ac
===================================================================
--- libgo/configure.ac (revision 222673)
+++ libgo/configure.ac (working copy)
@@ -473,56 +473,6 @@ AC_C_BIGENDIAN
GCC_CHECK_UNWIND_GETIPINFO
-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],
-[libgo_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"
-libgo_cv_lib_sjlj_exceptions=unknown
-AS_IF([ac_fn_c_try_compile],
- [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
- libgo_cv_lib_sjlj_exceptions=yes
- elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
- libgo_cv_lib_sjlj_exceptions=no
- fi])
-CFLAGS=$CFLAGS_hold
-rm -f conftest*
-])
-
-if test "$enable_sjlj_exceptions" = "auto"; then
- enable_sjlj_exceptions=$libgo_cv_lib_sjlj_exceptions
-fi
-
-case $enable_sjlj_exceptions in
-yes)
- AC_DEFINE(LIBGO_SJLJ_EXCEPTIONS, 1,
- [Define if the C++ compiler is configured for setjmp/longjmp exceptions.])
- ;;
-no)
- ;;
-*)
- AC_MSG_ERROR([unable to detect exception model])
- ;;
-esac
-
AC_CHECK_HEADERS(sched.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/reboot.h netinet/icmp6.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h)
AC_CHECK_HEADERS([linux/filter.h linux/if_addr.h linux/if_ether.h linux/if_tun.h linux/netlink.h linux/rtnetlink.h], [], [],
Index: libjava/configure.ac
===================================================================
--- libjava/configure.ac (revision 222673)
+++ libjava/configure.ac (working copy)
@@ -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
Index: libjava/stacktrace.cc
===================================================================
--- libjava/stacktrace.cc (revision 222673)
+++ libjava/stacktrace.cc (working copy)
@@ -325,7 +325,7 @@ _Jv_StackTrace::GetStackTraceElements (_
{
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 (_
list->add (element);
}
-#else /* SJLJ_EXCEPTIONS && !WIN32 */
+#else /* __USING_SJLJ_EXCEPTIONS__ && !WIN32 */
//JvSynchronized (ncodeMap);
UpdateNCodeMap ();
@@ -412,7 +412,7 @@ _Jv_StackTrace::GetStackTraceElements (_
}
finder->close();
-#endif /* SJLJ_EXCEPTIONS && !WIN32 */
+#endif /* __USING_SJLJ_EXCEPTIONS__ && !WIN32 */
JArray
--enable-sjlj-exceptions
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.
--enable-version-specific-runtime-libs
Specify that run-time libraries should be installed in the
compiler-specific subdirectory (i.e.,
${libdir}/gcc-lib/${target_alias}/${gcc_version})
Index: libstdc++-v3/doc/html/manual/appendix_porting.html
===================================================================
--- libstdc++-v3/doc/html/manual/appendix_porting.html (revision 222673)
+++ libstdc++-v3/doc/html/manual/appendix_porting.html (working copy)
@@ -162,7 +162,6 @@ in the build directory starts the build
GLIBCXX_ENABLE_DEBUG_FLAGS
GLIBCXX_ENABLE_LONG_LONG
GLIBCXX_ENABLE_PCH
- GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
GLIBCXX_ENABLE_SYMVERS
GLIBCXX_ENABLE_THREADS
Index: libstdc++-v3/libsupc++/eh_personality.cc
===================================================================
--- libstdc++-v3/libsupc++/eh_personality.cc (revision 222673)
+++ libstdc++-v3/libsupc++/eh_personality.cc (working copy)
@@ -327,16 +327,16 @@ namespace __cxxabiv1
// 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"
@@ -455,7 +455,7 @@ PERSONALITY_FUNCTION (int version,
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
@@ -508,7 +508,7 @@ PERSONALITY_FUNCTION (int version,
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
@@ -789,7 +789,7 @@ __cxa_call_unexpected (void *exc_obj_in)
}
#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,
Index: libstdc++-v3/libsupc++/eh_throw.cc
===================================================================
--- libstdc++-v3/libsupc++/eh_throw.cc (revision 222673)
+++ libstdc++-v3/libsupc++/eh_throw.cc (working copy)
@@ -76,7 +76,7 @@ __cxxabiv1::__cxa_throw (void *obj, std:
__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);
@@ -109,7 +109,7 @@ __cxxabiv1::__cxa_rethrow ()
header->exceptionType);
}
-#ifdef _GLIBCXX_SJLJ_EXCEPTIONS
+#ifdef __USING_SJLJ_EXCEPTIONS__
_Unwind_SjLj_Resume_or_Rethrow (&header->unwindHeader);
#else
#if defined(_LIBUNWIND_STD_ABI)
Index: libstdc++-v3/libsupc++/eh_ptr.cc
===================================================================
--- libstdc++-v3/libsupc++/eh_ptr.cc (revision 222673)
+++ libstdc++-v3/libsupc++/eh_ptr.cc (working copy)
@@ -248,7 +248,7 @@ std::rethrow_exception(std::exception_pt
__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);
Index: libstdc++-v3/acinclude.m4
===================================================================
--- libstdc++-v3/acinclude.m4 (revision 222673)
+++ libstdc++-v3/acinclude.m4 (working copy)
@@ -3129,79 +3129,6 @@ EOF
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
dnl --enable-libstdcxx-visibility enables attempt to use visibility attributes.
--nextPart3761427.DhqMAM6DDF--