diff options
Diffstat (limited to 'gcc48-__cxa_atexit.patch')
-rw-r--r-- | gcc48-__cxa_atexit.patch | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/gcc48-__cxa_atexit.patch b/gcc48-__cxa_atexit.patch index 0023ced..fd1ce9b 100644 --- a/gcc48-__cxa_atexit.patch +++ b/gcc48-__cxa_atexit.patch @@ -105,50 +105,3 @@ # This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h if test x$enable_sjlj_exceptions = xyes; then tmake_eh_file="i386/t-sjlj-eh" ---- origsrc/gcc-4.8.3/libstdc++-v3/libsupc++/atexit_thread.cc 2013-07-27 21:33:01.000000000 -0500 -+++ src/gcc-4.8.3/libstdc++-v3/libsupc++/atexit_thread.cc 2014-08-07 11:02:26.614465800 -0500 -@@ -25,6 +25,10 @@ - #include <cstdlib> - #include <new> - #include "bits/gthr.h" -+#if defined(_WIN32) || defined(__CYGWIN__) -+#define WIN32_LEAN_AND_MEAN -+#include <windows.h> -+#endif - - #if HAVE___CXA_THREAD_ATEXIT_IMPL - -@@ -47,6 +51,9 @@ namespace { - void (*destructor)(void *); - void *object; - elt *next; -+#if defined(_WIN32) || defined(__CYGWIN__) -+ HMODULE dll; -+#endif - }; - - // Keep a per-thread list of cleanups in gthread_key storage. -@@ -62,6 +69,10 @@ namespace { - { - elt *old_e = e; - e->destructor (e->object); -+#if defined(_WIN32) || defined(__CYGWIN__) -+ if (e->dll) -+ FreeLibrary (e->dll); -+#endif - e = e->next; - delete (old_e); - } -@@ -133,6 +144,12 @@ __cxxabiv1::__cxa_thread_atexit (void (* - new_elt->destructor = dtor; - new_elt->object = obj; - new_elt->next = first; -+#if defined(_WIN32) || defined(__CYGWIN__) -+ /* Increment DLL count. This blocks dlclose from unloading the DLL -+ before the thread-local dtors have been called. */ -+ GetModuleHandleExW (GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, -+ (LPCWSTR) dtor, &new_elt->dll); -+#endif - - if (__gthread_active_p ()) - __gthread_setspecific (key, new_elt); |