[clang] [Clang] [Driver] use __cxa_atexit by default on Cygwin. (PR #135701)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 14 17:26:54 PDT 2025


================
@@ -7230,7 +7230,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   // -fuse-cxa-atexit is default.
   if (!Args.hasFlag(
           options::OPT_fuse_cxa_atexit, options::OPT_fno_use_cxa_atexit,
-          !RawTriple.isOSAIX() && !RawTriple.isOSWindows() &&
+          !RawTriple.isOSAIX() &&
+              (!RawTriple.isOSWindows() ||
+               RawTriple.isWindowsCygwinEnvironment()) &&
----------------
jeremyd2019 wrote:

mingw-w64 also has `__cxa_atexit` - should this be
```suggestion
               RawTriple.isOSCygMing()) &&
```
?  Or is there a good reason not to use `__cxa_atexit` on mingw-w64?

https://github.com/llvm/llvm-project/pull/135701


More information about the cfe-commits mailing list