This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: jni and static libgcj and friends?
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Martin Kahlert <martin dot kahlert at infineon dot com>
- Cc: java at gcc dot gnu dot org, aoliva at redhat dot com
- Date: Tue, 26 Feb 2002 09:42:01 -0500 (EST)
- Subject: Re: jni and static libgcj and friends?
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