kaffe-0.9.0 with glibc2

Michael Poole poole+ at andrew.cmu.edu
Thu May 15 16:40:12 PDT 1997


	Here is a patch for the new version of Kaffe to make it compile
and run under Linux with GNU libc 2 ('aka libc 6') due to glibc providing 
a wrapper or different exposures of kernel functionality. Previous
versions also needed similar patches, although I didn't submit them (sorry
-- 0.8.4 also had a problem using the dynamic libraries that I couldn't
figure out, but which appears to have gone away in 0.9.0).

	Running 'make test' on it causes passes on all tests except
TestFloatDoubleLong and ExecTest, which were ignored.  On my machine
(Pentium 66, 32 MB RAM), executing even a simple program takes several
seconds to run since JIT compiling all the base classes at runtime takes
around 3300 ms (according to 'kaffe -verbosejit').

	Two ways to approach this would be caching JIT-compiled classes
somewhere, and lazy/optional JIT compilation.  The former would be harder
to both manage and code; the latter is truer to the idea of JIT
compilation.
	A simple approach would be to JIT compile a method whenever it was
first used; a more complicated approach could use some heuristic to 
determine whether or not a method has been called enough to justify JIT
compiling it.  I would favor the first (simpler) approach; the second one
won't work unless both the JIT compiler and interpreter are included in
the VM, and has the heuristic's overhead.
	Of course, some applications might prefer JIT to happen entirely
at load-time; it would probably be a good idea (and relatively not hard to
do) to add a new command-line option to the interpreter to control this.

	If I have enough time between project deadlines and moving in the
next week or two, I'll try to hack out some patches for this.

--- kaffe-0.9.0/config/alpha/linux/jit-md.h.glibc2	Thu May 15 17:46:44 1997
+++ kaffe-0.9.0/config/alpha/linux/jit-md.h	Thu May 15 17:47:19 1997
@@ -23,11 +23,13 @@
 /**/
 #include <signal.h>
 
+#if !(__GLIBC__ >= 2)
 #if defined(HAVE_ASM_SIGNAL_H)
 #include <asm/signal.h>
 #endif
 #if defined(HAVE_ASM_SIGCONTEXT_H)
 #include <asm/sigcontext.h>
+#endif
 #endif
 
 /* Function prototype for signal handlers */
--- kaffe-0.9.0/config/i386/linux/jit-md.h.glibc2	Wed Apr 16 04:11:05 1997
+++ kaffe-0.9.0/config/i386/linux/jit-md.h	Thu May 15 17:46:31 1997
@@ -21,9 +21,11 @@
 /**/
 /* Extra exception handling information. */
 /**/
+#if !(__GLIBC__ >= 2)
 #include <asm/signal.h>
 #if defined(HAVE_ASM_SIGCONTEXT_H)
 #include <asm/sigcontext.h>
+#endif
 #endif
 
 /* Function prototype for signal handlers */
--- kaffe-0.9.0/config/sparc/linux/jit-md.h.glibc2	Wed Apr 16 04:11:04 1997
+++ kaffe-0.9.0/config/sparc/linux/jit-md.h	Thu May 15 17:49:48 1997
@@ -21,7 +21,9 @@
 /**/
 /* Extra exception handling information. */
 /**/
+#if !(__GLIBC__ >= 2)
 #include <asm/sigcontext.h>
+#endif
 
 /* Function prototype for signal handlers */
 #define	EXCEPTIONPROTO							\



More information about the kaffe mailing list