[Patch] Allow DW2 Unwind info for cygwin/mingw32 targets

Danny Smith dannysmith@clear.net.nz
Mon Jun 11 10:13:00 GMT 2007



> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org 
> [mailto:gcc-patches-owner@gcc.gnu.org] On Behalf Of Danny Smith
> Sent: Wednesday, 30 May 2007 11:04 p.m.

The proposed patch affects only mingw32 and cygwin targets.  With this
patch, the default EH unwind model remains SJLJ.
I have received no negative comment either on or off list. 
Unless I receive any objections, I will commit this after 48 hours. 
Danny
\> 
> 
> Hello 
> 
> The attached patch enable Dwarf2 exception handling on 
> windows32 targets
> on trunk. It is virtually the same patch that I submitted a few years
> ago,
> 
> http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01989.html
> 
> and again a year later, but using some new features of gcc.
> 
> 
> It adds crtbegin.o and crtend.o as startfile/endfiles based 
> on crtstuff
> code, but separated out for now to allow easier specialization for a
> system that does not have .init/.fini sections and that needs special
> care when resolving weak symbols from dll's
> 
> __register and __deregister_frame_info are invoked indirectly via a
> ctor/dtor pair. The ctor/dtor references live in crtend to 
> make them the
> first ctor, last dtor invoked. The ctor/dtor sections are given a very
> high priority, to avoid C++ init_priority conflicts. The 
> actual calls to
> the unwind-dw2-fde.o functions are done in crtbegin so that we can
> resolve the references in libgcc.a. The references to these functions
> are weak, but we need to handle the vague linkage differently 
> if/when we
> use a shared libgcc_s.dll 
> 
> DWARF2_UNWIND_INFO is defined to 1 in cygming.h iff configured with
> --disable-sjlj-exceptions. However, the default is to define
> DWARF2_UNWIND_INFO as 0, as before. 
> 
> The patch also enables the use of .jcr section to register 
> Java classes.
> binutuls support for .jcr section was added in
> http://sources.redhat.com/ml/binutils/2004-11/msg00249.html
> 
> The patch fixes the old sjlj performance isssue:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14563
>  
> The .jcr part is relevant to:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18459
> 
> The w32-unwind.h  file was contributed by Pascal Obry.  It is used to
> define
> a fallback mechanism to handle OS exceptions and signals on mingw32.
> 
> This patch produces no regressions wih mingw32 or cygwin in C, C++,
> objc, fortran, ada. I haven't built libgcj for awhile because I only
> have 512MB of physical memory. Also libjava really does need 
> to be built
> as a dll to be useable. 
> 
> The patch affects mingw32 and cygwin targets.   
> 
> Danny  
> 
> 
> ChangeLog/libgcc
> 
> 2007-05-30  Danny Smith  <dannysmith@users.sourceforge.net>
> 
> 	* config.host(*-cygwin* |*-mingw* ): Add crtbegin.o, crtend.o to
> 	extra_parts. Add config/i386/t-cygming to tmake_file. 
> 	* config/i386/t-cygming: New file with rules for crtbegin.o,
> crtend.o.
> 
> 
> ChangeLog/gcc
> 
> 2007-05-30  Danny Smith  <dannysmith@users.sourceforge.net>
> 
> 	* config/i386/cygming.h (DWARF_FRAME_REGNUM): Define.
> 	(DWARF2_UNWIND_INFO): Override default if configured with
> 	SJLJ EH disabled.
> 	* config/i386/cygwin.h (STARTFILE_SPEC): Add crtbegin.o.
> 	(ENDFILE_SPEC): Add crtend.o.
> 	* config/i386/mingw32.h (STARTFILE_SEC): Add crtbegin.o.
> 	(ENDFILE_SPEC): Add crtend.o.
> 	(TARGET_USE_JCR_SECTION): Define.
> 	(MD_UNWIND_SUPPORT): Define for 32-bit target.
> 
> 	* config/i386/cygming-crtbegin.c: New file.
> 	* config/i386/cygming-crtend.c: New file.
> 
> 
> 2007-05-30  Pascal Obry Pascal Obry  <obry@adacore.com>
> 
> 	* config/i386/w32-unwind.h: New file.
> 
> 



More information about the Gcc-patches mailing list