This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch PR libstdc++/51135]: Fix [4.7 Regression] SIGSEGV during exception cleanup on win32
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 8 Dec 2011 20:22:37 +0000
- Subject: Re: [patch PR libstdc++/51135]: Fix [4.7 Regression] SIGSEGV during exception cleanup on win32
- References: <CAEwic4ZXvBzKem-iXvEagvZP4eU=9thsyXbubQQwyeaeUM3pFQ@mail.gmail.com>
On Dec 8, 2011 7:16 PM, "Kai Tietz" wrote:
>
> ? ? ? ?* unwind-cxx.h (__cxa_exception): Use for member
> ? ? ? ?exceptionDestructor the _GLIBCXX_DESTRUCTOR_CALLCONVENTION macro.
I think "Use the _GLIBCXX_DESTRUCTOR_CALLCONVENTION macro for the
exceptionDestructor member" would make more sense.
However ...
> Index: gcc/libstdc++-v3/libsupc++/cxxabi.h
> ===================================================================
> --- gcc.orig/libstdc++-v3/libsupc++/cxxabi.h
> +++ gcc/libstdc++-v3/libsupc++/cxxabi.h
> @@ -51,6 +51,16 @@
> ?#include <bits/cxxabi_tweaks.h>
> ?#include <bits/cxxabi_forced.h>
>
> +// On 32-bit IA native windows target is the used calling-convention
> +// for class-member-functions of kind __thiscall. ?As destructor is
> +// also of kind class-member-function, we need to specify for this
> +// target proper calling-convention on destructor-function-pointer.
> +#if defined (__MINGW32__) && defined (__i386__)
> +#define _GLIBCXX_DESTRUCTOR_CALLCONVENTION __thiscall
> +#else
> +#define _GLIBCXX_DESTRUCTOR_CALLCONVENTION
> +#endif
Could you define a typedef for void(*)(void*) and adapt that for
mingw32 instead of using the macro everywhere?
#if defined (__MINGW32__) && defined (__i386__)
typedef void (__thiscall *__cxxabi_dtor_type)(void*);
#else
typedef void (*__cxxabi_dtor_type)(void*);
#endif
(That would be my preference, but the maintainers of that code might disagree.)