This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: Static linking with JNI-Libs possible?
- From: "Erik Poupaert" <erik dot poupaert at chello dot be>
- To: "Clemens Eisserer" <linuxhippy at web dot de>
- Cc: <java at gcc dot gnu dot org>
- Date: Wed, 16 Apr 2003 14:25:46 +0200
- Subject: RE: Static linking with JNI-Libs possible?
>>>>> Does that mean I can link the library which is wraped (e.g. libXm.a)
the
>>>>> c-part of the bindings (swt.so) and the java part into one axecutable,
>>>>> the only thing I have to do is to compile the .a-Files with the
options
>>>>> --whole-archive and -export-dynamic?
The --whole-archive only needs to surround the c-part. For the java part
it's not needed.
>>>> gcj -O2 libXm.a swt-native.a swt-java.a MyApp.java --main=MyApp -o
Test1
>>>> --whole-archive --export-dynamic
I use simple expressions that Ant resolves through variable substitution.
Fully resolved, such expression looks more like:
gcj -O2 -Xlinker --start-group libXm.a -Wl,--whole-archive
swt-native.a -Wl,--no-whole-archive swt-java.a -Xlinker --end-group
MyApp.java --main=MyApp -o Test1 -export-dynamic
>>>>> In fact I dont want to use SWT, its for another library....
It should still apply -- mutatis mutandis.
Furthermore, I guess the --whole-archive option is not needed when you use
CNI, because CNI symbols are not resolved dynamically through ltdl, but are
resolved using the C++ ABI instead (is this correct?).