This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libstdc++: add _GLIBCXX_ macro prefix in

On 30/07/14 23:36 +0800, Zifei Tong wrote:
On Wed, Jul 30, 2014 at 11:25 PM, Jonathan Wakely <> wrote:
On 30/07/14 22:42 +0800, Zifei Tong wrote:


I found an issue that the __cxa_thread_atexit_impl() function never called
__cxa_thread_atexit() even with newest glibc which have

It turns out that the code tried to use macro
not _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL which is defined in
(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.

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

Thanks again for the report and patch.

commit ecaf491ba1a82e858b8a0654efeee74e55c74c05
Author: Jonathan Wakely <>
Date:   Fri Aug 1 19:53:58 2014 +0100

    2014-08-01  Zifei Tong  <>
    	* libsupc++/ (HAVE___CXA_THREAD_ATEXIT_IMPL): Add
    	_GLIBCXX_ prefix to macro.

diff --git a/libstdc++-v3/libsupc++/ b/libstdc++-v3/libsupc++/
index db20200..dff08e9 100644
--- a/libstdc++-v3/libsupc++/
+++ b/libstdc++-v3/libsupc++/
@@ -26,7 +26,7 @@
 #include <new>
 #include "bits/gthr.h"
 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);
 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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]