When working on some program I'd run into situation
where g++ insists on cxa_atexit code generation (that
is, I had to use a specific build of g++). First I
thought to patch up my code only, but then my program
would crash before even reaching dllmain. So I
patched dllcrt1.c and added cxa.c file (borrowed from
stlport project here on SF, with minor modifications;
it is essentially identical to all other cxa_atexit
implementations) to the libmingw32.
I made no modifications to crt1.c as I'm not building
any executables with my dll's (its a JNI project), so
I can't test it.
P.S. MSDN says it's ok to initialize mutex objects in