Re: gcj on OpenBSD

Kurt Miller <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
Andrew Haley wrote:
> Kurt Miller wrote:
> 
>> I've been working on getting gcj up and running on OpenBSD/i386.
>> Currently I'm working on adding gcj to gcc 4.2 port. I'm pretty far
>> along with the work: enabled dwarf2 exceptions, thread model posix, etc.
>> The build completes but gcj-dbtool segfaults and gij too. The segfault
>> occurs when initializing the class loader because engine is null.
>>
>> Could anyone suggest some ideas for diagnosing the root cause of this?
> 
> This happens because class registration hasn't been done.  gcc generates
> a magic section called .jcr, and this is a list of pointers to classes.
> 

...

> I suspect that this mechanism is not working on BSD.

Ahh thanks. Yes we didn't have the _Jv_RegisterClasses hooks in our csu
objects. I added them and I see _Jv_RegisterClasses being called for
gcj-dbtool. However, my libgcj.so doesn't have .init section so
_Jv_RegisterClasses is not being called for it (linked with -nostdlib),
so I still segfault. Hacking -nostdlib out of libtool fixes that for me
and gcj-dbtool doesn't segfault anymore.

I think I may have caused the no .init issue with a patch to ltconfig
for a problem I hit earlier with predep_objects. It looks like
crtbeginS.o may be linked via predep_objects but I removed that. Time
to revert that change and find out...

Thanks for the help, I'm making progress again.

-Kurt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.