jni and static libgcj and friends?
Jeff Sturm
jsturm@one-point.com
Tue Feb 26 07:00:00 GMT 2002
On Tue, 26 Feb 2002, Martin Kahlert wrote:
> 2. My (C/Fortran) main application uses JNI in order to call a large
> add on written purely in Java. This Java part should become a shared
> lib by the above mentioned compiler. The goal is to get a standalone
> libapp.so, which does not depend on libgcj.so and friends but has all
> the support stuff included.
OK. You're trying to link non-PIC code into a shared library. Alexandre
is right; this won't work (or at least has ugly ramifications).
> I thought that possibly libgcj is created without -fPIC
libgcj.a is always built without -fPIC, whether or not you
--enable-shared. You may have noticed that libtool compiles each source
twice, once with PIC, once without.
In theory you could build libgcj with -prefer-pic and get what you want...
I tried this and it didn't seem to work.
Alexandre, I Cc'ed you in case you have any other ideas.
Jeff
More information about the Java
mailing list