This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Clean up detection of SJLJ exceptions in target libraries
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, "libstdc++" <libstdc++ at gcc dot gnu dot org>, Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Wed, 13 May 2015 00:55:31 -0700
- Subject: Re: [patch] Clean up detection of SJLJ exceptions in target libraries
- Authentication-results: sourceware.org; auth=none
- References: <1440100 dot 16fMh0Bpp2 at polaris>
On Tue, May 12, 2015 at 9:42 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> 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 <ebotcazou@adacore.com>
>
> 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__.
The libobjc parts are ok.
Thanks,
Andrew Pinski
>
> 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