summaryrefslogtreecommitdiffstats
path: root/0017-__cxa-atexit-for-Cygwin.patch
blob: e119f1fa2195c9c528f8bbc4f91e62397e2cfd9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From 2de5743add75ae90442e9ff47061a67ff65e76d1 Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10walls@gmail.com>
Date: Thu, 30 Oct 2014 17:15:02 +0800
Subject: [PATCH 17/21] __cxa-atexit for Cygwin

---
 libgcc/config/i386/cygming-crtbegin.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libgcc/config/i386/cygming-crtbegin.c b/libgcc/config/i386/cygming-crtbegin.c
index 87928e5..90904cd 100644
--- a/libgcc/config/i386/cygming-crtbegin.c
+++ b/libgcc/config/i386/cygming-crtbegin.c
@@ -183,7 +183,11 @@ __gcc_register_frame (void)
   /* If we use the __cxa_atexit method to register C++ dtors
      at object construction,  also use atexit to register eh frame
      info cleanup.  */
+#ifdef __CYGWIN__
+  __cxa_atexit(__gcc_deregister_frame, NULL, (void *)&__dso_handle);
+#else
   atexit(__gcc_deregister_frame);
+#endif /* __CYGWIN__ */
 #endif /* DEFAULT_USE_CXA_ATEXIT */
 }
 
-- 
2.4.5