This is the mail archive of the
java-discuss@sources.redhat.com
mailing list for the Java project.
static linking
- To: java-discuss at sources dot redhat dot com
- Subject: static linking
- From: Jeff Sturm <jeff dot sturm at appnet dot com>
- Date: Tue, 05 Dec 2000 19:17:55 -0500
- Organization: Commerce One
- Reply-To: jeff dot sturm at commerceone dot com
I think it was Tom who said static linking might be broken now. Turns out he's
right. :\
I see two problems:
1) libsupc++ doesn't get linked by gcj
This seems like an oversight. Since libgcj.so is linked against libsupc++,
normal (shared) linking just happens to work. I "fixed" it by adding supc++ to
libgcj.spec. I'll see if I can cobble together a patch.
2) classes loaded dynamically (via Class.forName) don't get linked
I don't see any good solution. I got around it by linking the following dummy
class into my executable, but YMMV:
class Dummy {
java.security.cert.Certificate dummy1;
gnu.gcj.protocol.file.Handler dummy2;
gnu.gcj.protocol.http.Handler dummy3;
gnu.gcj.protocol.jar.Handler dummy4;
}
BTW I haven't noticed any ICEs yet with today's compiler. Nice work!
--
Jeff Sturm
jeff.sturm@commerceone.com