在 2026-7-5 05:05, Martin Storsjö 写道:
Actually, I think this needs to be reverted, at least parts of it.This causes atexit/global destructors to not be called in regular DLLs (that are linked into the main process EXE) on regular exit (exiting from main, etc).This causes a couple of test failures in the compiler-rt asan testsuite: https://github.com/mstorsjo/ llvm-mingw/actions/runs/28691998891/job/85114629007Some of the failures there are from the asan DLL itself, some come from the LLVM tools themselves. In my builds, I build one large shared libLLVM-<version>.dll, and all the tools link against that (and are fairly small exes). This change caused libLLVM-<version>.dll to no longer run destructors/atexit when the tools exits. This is the cause of one of the test failures in the compiler-rt test run above.So please reconsider this change.Even if the process is in an indeterminate state at this point, I think it's less surprising to run the destructors/atexit functions, than to silently skip them - this has been the defacto behaviour so far.Additionally, MSVC also runs destructors in linked DLLs on process exit.
Which thread model are these DLLs using?I was testing libgomp with win32 thread model and it was deadlocking because of this reason, which is only about the change in mingw-w64-crt/crt/tlsthrd.c.
For the time being, I have reverted this commit; I will try to fix it in libgomp. -- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
