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: gcj on OpenBSD


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


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