[PATCH] libstdc++: cxxabi.h: Remove guards around _GLIBCXX_CDTOR_CALLABI

LIU Hao lh_mouse@126.com
Thu Dec 3 15:14:28 GMT 2026


在 2026-12-3 22:49, Jonathan Wakely 写道:
> On Thu, 19 Nov 2026 at 16:46, Zhongteng Gui <dragon-archer@outlook.com> wrote:
>>
>> From eae63474ac78190bb82544bec85c956ab9b6a9e5 Mon Sep 17 00:00:00 2001
>> From: Zhongteng Gui <dragon-archer@outlook.com>
>> Date: Fri, 20 Nov 2026 00:38:51 +0800
>> Subject: [PATCH] libstdc++: cxxabi.h: Remove guards around
>>  _GLIBCXX_CDTOR_CALLABI
>>
>> This is guaranteed to be defined by cxxabi_init_exception.h, which is
>> always included by cxxabi.h.  Besides, __cxa_throw already uses
>> _GLIBCXX_CDTOR_CALLABI unconditionally, so it is safe to do the same for
>> __cxa_atexit and __cxa_thread_atexit.
> 
> LH, you added the #ifdef in cxxabi.h in r11-4812-g7fc0f78c3f43af even
> though you relied on it being always defined in atexit_thread.cc - any
> reason not to make this change here? It looks good to me.

I didn't notice that `_GLIBCXX_CDTOR_CALLABI` is always defined.


In r11-4812-g7fc0f78c3f43af there's

   +// Simplify it a little for this file.
   +#ifndef _GLIBCXX_CDTOR_CALLABI
   +#  define _GLIBCXX_CDTOR_CALLABI
   +#endif

in the beginning of atexit_thread.cc, so it's always define after that.


-- 
Best regards,
LIU Hao
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20261203/fb4d2676/attachment-0001.sig>


More information about the Libstdc++ mailing list