On 23/03/2013 00:57, Kai Tietz wrote: > 2013/3/23 Dave Korn <dave.korn.cyg...@gmail.com>: >> On 23/03/2013 00:24, Kai Tietz wrote: >>> 2013/3/23 Dave Korn <dave.korn.cyg...@gmail.com>: >>>> On 23/03/2013 00:16, Kai Tietz wrote: >>>> >>>>> welcome, too. It would be even better if we could rethink actual the >>>>> need of loading java-library within libgcc's cygwin's/mingw's crtbegin >>>>> at all. I am actual not that sure, if we need this at all. >>>> Somebody has to register the default classes at startup, or attempts to >>>> classload them will fail.
>>> Right, but shouldn't that be done by libjava-DLL itself on loading >>> (and deregistration on unloading)? I see no good point to add this >>> into a different dll? But well, I might miss here an important point. >> Well, libgcc is always there, and libjava doesn't have any specific hooks >> where we could add startup code, which is why all targets do it by default in >> libgcc/crtstuff.c along with the C++ default ctor stuff. > Hmm, we have DllMain. it is enough for native Windows. And cygwin has > same feature via DECLARE_CYGWIN_DLL( DllMain ); AFAIK. Well, yes we do, but why not just do it the same way every other target does it? Also, DllMain is very risky to do anything complex in. Without having some strong guarantees about how the default java class registration code might or might not behave, I don't want to call it from DllMain. (You've read http://www.microsoft.com/whdc/driver/kernel/DLL_bestprac.mspx?) cheers, DaveK