Static executables
Andrew Haley
aph@redhat.com
Tue Jan 31 13:38:00 GMT 2006
Andrzej Bialecki writes:
> David Daney wrote:
> > Tom Tromey wrote:
> >> It would be helpful if someone wrote a page for the gcc wiki about
> >> static linking.
> >
> > Like this:?
> >
> > http://gcc.gnu.org/wiki/Statically%20linking%20libgcj
> >
>
> # this depends on ncurses, but we're not linking now
> gcj -c Toolkit.c -fjni -findirect-dispatch -o Toolkit.o
>
> gcj -c charva.jar -fjni -findirect-dispatch -o charva.o
This looks wrong. The "Statically linking libgcj" page doesn't
recommend indirect dispatch, and it won't work. If you want to link
statically you must use the C++ ABI, not indirect dispatch.
As for JNI, as far as I'm aware it requires dynamic loading.
Andrew.
More information about the Java
mailing list