[PATCH] Defaulting to -fno-use-cxa-atexit on Windows

John McCall rjmccall at apple.com
Mon Mar 11 17:55:22 PDT 2013

On Mar 11, 2013, at 5:30 PM, Aaron Ballman <aaron at aaronballman.com> wrote:
> When building for Windows, using cxa-atexit causes link errors.  We
> already set this flag to false for Cygywin, MinGW and hexagon targets.
> This patch also sets it to false for Windows targets.

Cygwin, MinGW, and hexagon targets are Itanium ABI targets;  they're
just Itanium ABI targets that don't provide __cxa_atexit (although I've
never understood why not).  So the flag is still meaningful for them.
It's meaningless for MS ABI targets.

Rather than papering over the problem, I would like someone to
investigate what the right code to emit is for MS ABI targets.  Specifically,
will the destructor get executed correctly if we just register it with LLVM
as a global destructor?


More information about the cfe-commits mailing list