This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Logging + static linking
- From: Andrew Haley <aph at redhat dot com>
- To: Mark Anderson <mark at panonet dot net>
- Cc: java at gcc dot gnu dot org
- Date: Wed, 3 Nov 2004 11:56:08 +0000
- Subject: Logging + static linking
- References: <200411031103.11595.mark@panonet.net>
Mark Anderson writes:
> I am trying to create a statically linked executable that makes use
> of java.util.logging, however, I cannot seem to get it to produce
> any logging output.
This probably won't work, because there is no reference to the logger
support classes that the linker can see. The linker removes from the
object file every class that is not directly reachable from the
program.
You can try to figure out exactly what classes are required and emit
static references to them or link against libgcj with --whole-archive.
I don't recommend either of these routes.
Perhaps you can put the libgcj.jar in your runtime classpath and
interpret the support classes. I don't know if that will work. But I
haven't been able to make it work with static linkage whatever I
tried. I think the problem is with the stack trace infrastructure.
Andrew.