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]

Re: static linking


>>>>> "Jeff" == Jeff Sturm <jeff.sturm@appnet.com> writes:

Jeff> At least the following four classes should always be present,
Jeff> and are not referenced explicitly:
Jeff> [ ... ]

Thanks.  Could you try this patch?
I tried it but I'm seeing an odd regression.  I get a segv in the utf8
comparison function.  I know I've seen this before but I don't recall
what it means and I don't want to track it down right now.

It seemed to make sense to put this stuff in FirstThread since that
class is already used for bootstrapping.

2000-12-08  Tom Tromey  <tromey@redhat.com>

	* gnu/gcj/runtime/FirstThread.java (Kcert, Kfile, Khttp, Kjar):
	New static final fields.

Tom

Index: gnu/gcj/runtime/FirstThread.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/gnu/gcj/runtime/FirstThread.java,v
retrieving revision 1.5
diff -u -r1.5 FirstThread.java
--- FirstThread.java	2000/08/26 19:25:13	1.5
+++ FirstThread.java	2000/12/10 02:27:53
@@ -1,6 +1,6 @@
 // FirstThread.java - Implementation of very first thread.
 
-/* Copyright (C) 1998, 1999  Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -74,4 +74,13 @@
   private Class klass;
   private String klass_name;
   private Object args;
+
+  // If the user links statically then we need to ensure that these
+  // classes are linked in.  Otherwise bootstrapping fails.  These
+  // classes are only referred to via Class.forName(), so we add an
+  // explicit mention of them here.
+  static final Class Kcert = java.security.cert.Certificate.class;
+  static final Class Kfile = gnu.gcj.protocol.file.Handler.class;
+  static final Class Khttp = gnu.gcj.protocol.http.Handler.class;
+  static final Class Kjar  = gnu.gcj.protocol.jar.Handler.class;
 }

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