[cfe-dev] [PATCH] [PR9593] Rework -fno-use-cxa-atexit not to invoke local dtors unconditionally.

NAKAMURA Takumi geek4civic at gmail.com
Wed Jan 11 08:25:38 PST 2012

-fno-use-cxa-atexit is by default on cygming, due to unavailability of
 clang/lib/CodeGen/CGDeclCXX.cpp     |   93 ++++++++++++++++++++++++++---------
 clang/lib/CodeGen/CodeGenFunction.h |   10 ++--
 2 files changed, 76 insertions(+), 27 deletions(-)

(Excuse me to resend this, due to my mistake)

This patch can let selfhosting clang built on cygwin (maybe, on mingw).

This breaks 3 tests, to modify semantics of -fno-use-cxa-atexit.

Clang :: CodeGenCXX/arm.cpp
Clang :: CodeGenCXX/cxx-apple-kext.cpp
Clang :: CodeGenCXX/global-dtor-no-atexit.cpp

I wonder how I could tweak on my patch without breaking anything.

FYI, on cygwin-g++-4.4,

 - atexit(__tcf_xxx) are emitted on both global objects and static
local (guarded) objects.

on x86_64-centos5-linux-g++-4.4 -fno-use-cxa-atexit,

 - atexit(__tcf_xxx) are emitted on static local objects.
 - .dtors sections are emitted on global objects.

on ToT clang,

 - .dtors are emmitted on both objects, it might be dubious.

Please give me a better way, thank you in advance.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-PR9593-Rework-fno-use-cxa-atexit-not-to-invoke-l.patch.txt
Type: text/x-patch
Size: 6977 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120112/a9825b06/attachment.bin>

More information about the cfe-dev mailing list