On Mon Jun 24 09:09:07 2024 +0000, Jacek Caban wrote:
MinGW runtime doesn't seem to have them (or maybe I just didn't find them).
See `__do_global_dtors`. It's registered using `atexit`, which is a static function that, in case of DLLs, executes on `PROCESS_DETACH`. Also, we currently allow exchanging static libraries between MSVC and MinGW targets (so you may build Wine in one mode and use it to build with `winegcc` for the other target). This may get tricky as we extend static libraries, but I think it would be nice to keep if we can. For that, using `__GNUC__` like you do can't work.
Thanks for the pointers! IIUC the static library compatibility issue is only a problem for the msvcrt changes, because winecrt0 objects will never be included in static libraries, right?
I actually didn't really need the C++ constructor support for executables, that was just for some tests I made to check the implementation, so the msvcrt change isn't really needed. I've updated the MR to only include the winecrt0 part.