On Tuesday 16 December 2025 16:54:36 Pali Rohár wrote:
> On Tuesday 16 December 2025 15:05:38 Luca Bacci wrote:
> > > [...] It is calling code outside of __native_startup_state guards.
> > 
> > Yeah, I am now fixing that patch too! Out of curiosity, what is that lock 
> > used for? I can't quite understand
> 
> I'm also not really sure, but from its logic it looks like that it
> prevents duplicate execution by different threads at the same time.
> Similar logic has also code generated by msvc compiler.
> In past I sent some analysis of it into this list.

Here is my message with analysis _how_ the msvc startup process looks
like and how it interacts with native_startup_lock:
https://sourceforge.net/p/mingw-w64/mailman/message/59114780/

It would be nice to demystify _why_ it is needed in this way.
And maybe figure out if it is really needed for binaries compiled and
linked by gcc / clang / gnu ld / llvm. For example I spotted that
SetUnhandledExceptionFilter is not needed and after few changes it can
be removed (already sent changes to the list for that removal).


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to