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: "Ranjit Mathew" <rmathew4lists at hotmail dot com>
- To: "Clemens Eisserer" <linuxhippy at web dot de>,<java at gcc dot gnu dot org>
- Date: Wed, 16 Apr 2003 09:54:37 +0530
- Subject: Re: Static linking with JNI-Libs possible?
- References: <3E9C752B.1060702@web.de>
- Reply-to: "Ranjit Mathew" <rmathew at hotmail dot com>
> So is it possible to link everything except of the "other dynamic
> libraries" into one single executable (with static libgcj) ?
> Is this also possible with the mingw32-build?
Yes, Erik has done this before. IIRC, he compiled SWT into a
static library, omitting the calls to System.loadLibrary( ...)
and making sure that all SWT symbols are properly exported
either via an explicit "exports" file or (better) with the
latest MinGW binutils snapshot that allows EXEs to export
symbols (binutils-2.13.90-20030111):
http://prdownloads.sourceforge.net/mingw/binutils-2.13.90-20030111-1.tar.gz
Even after this, you *might* have to ask the linker to
search the libraries repeatedly to resolve circular
dependencies by using this with gcj in the final
command to link everything:
-Wl,--start-group <all-swt-libraries-here> -Wl,--end-group
Erik is the guru of this voodoo here, so if I've
missed out something he should be able to point it out.
Ranjit.