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: Converting a JAR into a gcj-statically-linked SO


Matthijs van de Water wrote:
> On Jan 7, 2008 2:42 PM, Andrew Haley <aph@redhat.com> wrote:
>   
>> You don't seem to be linking your shared library statically against
>> libgcj.  You must use the -static-libgcj option.
>>     
> Changing my compile line into
> $ gcj -o libmynative.so -shared -fPIC native_lib.cc MyJavaLib.o
> -lstdc++ -shared-libgcc -static-libgcj
>   

That won't work.  The static libgcj (libgcj.a) is not compiled with
-fPIC, so it cannot be used in a shared object.

David Daney.


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