This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: gij with gcc 2.95.2 (was: Re: internal error - SP mismatch)
- To: James CE Johnson <jcej at tragus dot org>
- Subject: Re: gij with gcc 2.95.2 (was: Re: internal error - SP mismatch)
- From: Matt Welsh <mdw at cs dot berkeley dot edu>
- Date: Fri, 24 Mar 2000 15:00:47 -0800
- cc: java-discuss at sourceware dot cygnus dot com
- Reply-To: Matt Welsh <mdw at cs dot berkeley dot edu>
> But now, I'm embarrased to say, I can't seem to figure out how to use the dar
> ned
> thing:
>
> [jcej@node04 T3]$ gcj -shared -c -o HelloWorld.so HelloWorld.java
This is a problem with gcc and gcj. Use of "-c" actually causes gcj
to build a STATIC object file, even though you used "-shared". Try
removing the "-c" and see if it works.
Arguably this is a bug, but it appears in much older versions of gcc
as well, so I don't know what the right fix is.
Also, I think you need to have the directory where 'HelloWorld.so'
is located on your LD_LIBRARY_PATH. This is silly, of course, and we had
some discussion earlier on what the right mechanism should be.
I just tried this myself and it segfaults for some reason.
Your example above will work if you just do:
gcj -C Hello.java
gij Hello
But, in this case gij will actually be interpreting the bytecodes for
Hello.class rather than loading the compiled Hello.so shared object.
gij *does* support loading shared objects, but I don't know why it's
crashing here.
Also be sure you compiled libgcj with the --enable-interpreter=yes option
to "configure".
Matt