This is the mail archive of the java-discuss@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

static linking


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]