This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: ATTN Windows Users: RFC - GCJ/MinGW and Thread-Safe Exception Handling


Ranjit Mathew wrote:
> Hi,
> 
>   We have a hack in GCJ for MinGW that fools the MinGW 
> runtime into thinking that thread-safe exception handling is 
> to be used and causes a leak of about 24 bytes of EH context 
> per thread as a side-effect.
 ...

> This has worked all this while except that it is now causing 
> multiple definition errors from the linker while creating 
> tools like gappletviewer, etc. since these symbols are 
> already defined in libmingw32 (don't ask me why we haven't 
> faced this issue before - I'm flummoxed myself). In other 
> words, it just cannot continue to remain in its current form.
> 
> I am of the personal opinion that this hack should be removed 
> and therefore will be proposing a patch shortly that removes 
> this hack and adds the equivalent of "-mthreads" to the linking step.
> 

Would this not work?

(1) Put this into a object file of its own and add it to link spec as a
'startup' object so it 
overrides the static libmingw.a library version. 

int _CRT_MT = 1;


(2) Remove this completely and link against the equivalent one in
mthr_stub.o (libmingw.a)

extern "C" int
__mingwthr_key_dtor (DWORD, void (*) (void *))
{
  // FIXME: for now we do nothing; this causes a memory leak of
  //        approximately 24 bytes per thread created.
  return 0;
}


I don't know why I'm suggesting this. I have never liked the foolery in
win32.cc and wopuld be glad to see it removed.

Danny


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]