This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] libstdc++: add _GLIBCXX_ macro prefix in atexit_thread.cc
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Zifei Tong <zifeitong at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, libstdc++ <libstdc++ at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>, Siddhesh Poyarekar <siddhesh at redhat dot com>
- Date: Fri, 1 Aug 2014 20:46:38 +0100
- Subject: Re: [PATCH] libstdc++: add _GLIBCXX_ macro prefix in atexit_thread.cc
- Authentication-results: sourceware.org; auth=none
- References: <1406731356-24159-1-git-send-email-zifeitong at gmail dot com> <20140730152518 dot GD2361 at redhat dot com> <CAJ7wx-EymvXyaYaxnEg9uLEEeEjAfXSFZGentyyENmRS7Fb9Sw at mail dot gmail dot com>
On 30/07/14 23:36 +0800, Zifei Tong wrote:
On Wed, Jul 30, 2014 at 11:25 PM, Jonathan Wakely <jwakely@redhat.com> wrote:
On 30/07/14 22:42 +0800, Zifei Tong wrote:
Hi,
I found an issue that the __cxa_thread_atexit_impl() function never called
by
__cxa_thread_atexit() even with newest glibc which have
__cxa_thread_atexit_impl
implemented.
It turns out that the code tried to use macro
HAVE___CXA_THREAD_ATEXIT_IMPL, but
not _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL which is defined in
bits/c++config.h
(generated from autoconf scripts).
This patch adds the missing macro prefix.
The patch is correct, thanks very much.
Do you have commit access?
I don't think so, this is my first patch to gcc :)
If not I can do it for you.
Thanks!
I've committed the attached patch to trunk, I'll apply it to the 4.8
and 4.9 branches soon too.
Tested x86_64-linux, with both glibc 2.11 and 2.18 so with and without
__cxa_thread_atexit_impl.
Thanks again for the report and patch.
commit ecaf491ba1a82e858b8a0654efeee74e55c74c05
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Aug 1 19:53:58 2014 +0100
2014-08-01 Zifei Tong <zifeitong@gmail.com>
* libsupc++/atexit_thread.cc (HAVE___CXA_THREAD_ATEXIT_IMPL): Add
_GLIBCXX_ prefix to macro.
diff --git a/libstdc++-v3/libsupc++/atexit_thread.cc b/libstdc++-v3/libsupc++/atexit_thread.cc
index db20200..dff08e9 100644
--- a/libstdc++-v3/libsupc++/atexit_thread.cc
+++ b/libstdc++-v3/libsupc++/atexit_thread.cc
@@ -26,7 +26,7 @@
#include <new>
#include "bits/gthr.h"
-#if HAVE___CXA_THREAD_ATEXIT_IMPL
+#if _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL
extern "C" int __cxa_thread_atexit_impl (void (*func) (void *),
void *arg, void *d);
@@ -38,7 +38,7 @@ __cxxabiv1::__cxa_thread_atexit (void (*dtor)(void *),
return __cxa_thread_atexit_impl (dtor, obj, dso_handle);
}
-#else /* HAVE___CXA_THREAD_ATEXIT_IMPL */
+#else /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
namespace {
// One element in a singly-linked stack of cleanups.
@@ -142,4 +142,4 @@ __cxxabiv1::__cxa_thread_atexit (void (*dtor)(void *), void *obj, void */*dso_ha
return 0;
}
-#endif /* HAVE___CXA_THREAD_ATEXIT_IMPL */
+#endif /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */