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: 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


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