[kaffe] XScale & JIT

Jari Korva jpkorva at iki.fi
Fri Jan 14 04:12:03 PST 2005


Hi,

I tried to build Kaffe (CVS HEAD) with JIT for my big endian XScale,
but got some errors:

...
armv5b-softfloat-linux-gcc -DHAVE_CONFIG_H -I. -I. -I../../../config
-I../../../include/kaffe -I../../../include -I../../../config
-I../../../config -I../../../kaffe/kaffevm/systems/unix-pthreads
-I../../../include -I../../../kaffe/kaffevm -I../../../kaffe/jvmpi
-I/wrk/arm/kaffe-cvs-head/./kaffe/kaffevm
-I/wrk/arm/kaffe-cvs-head/./kaffe/kaffevm/jit
-I/wrk/arm/kaffe-cvs-head/./kaffe/kaffevm/systems/unix-pthreads
-I../../../replace -I../../../binreloc -I../../../config
-I../../../include -DKAFFE_VMDEBUG -D_REENTRANT -g -O2 -Wchar-subscripts
-Wcomment -Wformat=2 -Wimplicit-function-declaration -Wimplicit-int -Wmain
-Wmissing-braces -Wparentheses -Wsequence-point -Wreturn-type -Wswitch
-Wswitch-default -Wswitch-enum -Wtrigraphs -Wunused-function
-Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value
-Wunknown-pragmas -Wstrict-aliasing -W -Wfloat-equal -Wundef
-Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual
-Wcast-align -Wwrite-strings -Wconversion -Wsign-compare
-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute
-Wpacked -Wredundant-decls -Wnested-externs -Winline -Wlong-long
-Wdisabled-optimization -fsigned-char -pthread -DENABLE_BINRELOC -MT
gc-incremental.lo -MD -MP -MF .deps/gc-incremental.Tpo -c gc-incremental.c
-fPIC -DPIC -o .libs/gc-incremental.o
In file included from ../../../config/arm/linux/jit-md.h:18,
                 from ../../../config/jit-md.h:1,
                 from
/wrk/arm/kaffe-cvs-head/kaffe/kaffevm/jit/stackTrace-impl.h:4,
                 from ../../../kaffe/kaffevm/threadData.h:6,
                 from
../../../kaffe/kaffevm/systems/unix-pthreads/thread-internal.h:25,
                 from
../../../kaffe/kaffevm/systems/unix-pthreads/thread-impl.h:25,
                 from ../../../kaffe/kaffevm/locks.h:16,
                 from gc-incremental.c:22:
../../../config/arm/jit.h:107: warning: packed attribute causes
inefficient alignment for `meth'
../../../config/arm/jit.h:109: warning: packed attribute causes
inefficient alignment for `trampaddr'
In file included from
../../../kaffe/kaffevm/systems/unix-pthreads/thread-impl.h:25,
                 from ../../../kaffe/kaffevm/locks.h:16,
                 from gc-incremental.c:22:
../../../kaffe/kaffevm/systems/unix-pthreads/thread-internal.h:420:
warning: function declaration isn't a prototype
gc-incremental.c: In function `gc_heap_isobject':
gc-incremental.c:244: warning: cast increases required alignment of target
type
gc-incremental.c: In function `KaffeGC_WalkConservative':
gc-incremental.c:339: error: parse error before ')' token
gc-incremental.c:339: error: parse error before ';' token
gc-incremental.c:341: error: parse error before ')' token
gc-incremental.c:343: error: `p' undeclared (first use in this function)
gc-incremental.c:343: error: (Each undeclared identifier is reported only
once
gc-incremental.c:343: error: for each function it appears in.)
gc-incremental.c: At top level:
gc-incremental.c:348: error: parse error before '}' token
gc-incremental.c: In function `gcGetObjectBase':
gc-incremental.c:410: warning: cast increases required alignment of target
type
make[3]: *** [gc-incremental.lo] Error 1
make[3]: Leaving directory
`/wrk/arm/kaffe-cvs-head/kaffe/kaffevm/kaffe-gc'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/wrk/arm/kaffe-cvs-head/kaffe/kaffevm'
make[1]: *** [kaffe-build-order] Error 2
make[1]: Leaving directory `/wrk/arm/kaffe-cvs-head'
make: *** [all-recursive] Error 1


Preprosessor output for line 339 is the following...

  for (mem = ((const int8*)base) + (size & (uintp)-) - sizeof(void*);

... so it seems that that ALIGNMENTOF_VOIDP is not correctly defined
for arm/linux.

I copied the value from config/arm/riscos to config/arm/linux so I was
able to continue. The 2nd problem was:

armv5b-softfloat-linux-gcc -Wchar-subscripts -Wcomment -Wformat=2
-Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces
-Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wswitch-default
-Wswitch-enum -Wtrigraphs -Wunused-function -Wunused-label
-Wunused-parameter -Wunused-variable -Wunused-value -Wunknown-pragmas
-Wstrict-aliasing -W -Wfloat-equal -Wdeclaration-after-statement -Wundef
-Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual
-Wcast-align -Wwrite-strings -Wconversion -Wsign-compare
-Waggregate-return -Wstrict-prototypes -Wold-style-definition
-Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn
-Wmissing-format-attribute -Wpacked -Wredundant-decls -Wnested-externs
-Winvalid-pch -Winline -Wlong-long -Wdisabled-optimization -fsigned-char
-DENABLE_BINRELOC -o .libs/kaffe-bin main.o version.o .libs/kaffe-binS.o
-Wl,--export-dynamic  -pthread ../xprof/.libs/libkaffexprof.so
../kaffevm/.libs/libkaffevm.so
/wrk/arm/kaffe-cvs-head/kaffe/kaffevm/verifier/.libs/libkaffeverifier.so
/wrk/arm/kaffe-cvs-head/kaffe/kaffevm/kaffe-gc/.libs/libkaffegc.so -lm
../../replace/.libs/libreplace.so ../../libltdl/.libs/libltdlc.a -ldl
-Wl,--rpath -Wl,/wrk/arm/test/jre/lib/arm
../kaffevm/.libs/libkaffevm.so: undefined reference to `setEpilogueLabel'
collect2: ld returned 1 exit status
make[3]: *** [kaffe-bin] Error 1
make[3]: Leaving directory `/wrk/arm/kaffe-cvs-head/kaffe/kaffe'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/wrk/arm/kaffe-cvs-head/kaffe'
make[1]: *** [kaffe-build-order] Error 2
make[1]: Leaving directory `/wrk/arm/kaffe-cvs-head'
make: *** [all-recursive] Error 1

... which I fixed by doing a 's/setEpilogueLabel/KaffeJIT_setEpilogue/g'
in config/arm/jit-arm.def.

---

After this everything compiles, but I get this error while trying to run
HelloWorld:

# java -verbosejit -verbose HelloWorld
...
<JIT: java/util/Hashtable$3.iterator()Ljava/util/Iterator; time 11ms
(942ms) @ 0x1fd050>
<JIT: java/util/Hashtable$HashIterator.<init>(Ljava/util/Hashtable;I)V
time 2ms (944ms) @ 0x1fd9f8>
<JIT: java/util/Hashtable$HashIterator.this()V time 2ms (946ms) @
0x200428>
<JIT:
java/util/Collections$SynchronizedIterator.<init>(Ljava/lang/Object;Ljava/util/Iterator;)V
time 2ms (948ms) @ 0x1fdbe8>
<JIT: java/util/Collections$SynchronizedIterator.hasNext()Z time 2ms
(950ms) @ 0x1f5830>
Loading
java/util/ConcurrentModificationException.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
<JIT: java/util/Hashtable$HashIterator.hasNext()Z time 10ms (960ms) @
0x200c08>
<JIT: java/util/Collections$SynchronizedIterator.next()Ljava/lang/Object;
time 3ms (963ms) @ 0x200830>
Loading
java/util/NoSuchElementException.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
<JIT: java/util/Hashtable$HashIterator.next()Ljava/lang/Object; time 13ms
(976ms) @ 0x1ff050>
<JIT: java/util/AbstractMap$BasicMapEntry.getKey()Ljava/lang/Object; time
2ms (978ms) @ 0x1f4960>
<JIT: java/util/AbstractMap$BasicMapEntry.getValue()Ljava/lang/Object;
time 2ms (980ms) @ 0x1f4a20>
<JIT:
gnu/classpath/SystemProperties.getProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
time 1ms (981ms) @ 0x1fd238>
Loading
gnu/java/nio/channels/FileChannelImpl.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
Loading
java/nio/channels/FileChannel.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
Loading
java/nio/channels/spi/AbstractInterruptibleChannel.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
Loading
java/nio/channels/Channel.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
Loading
java/nio/channels/InterruptibleChannel.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
Loading
java/nio/channels/ByteChannel.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
Loading
java/nio/channels/ReadableByteChannel.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
Loading
java/nio/channels/WritableByteChannel.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
Loading
java/nio/channels/GatheringByteChannel.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
Loading
java/nio/channels/ScatteringByteChannel.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
<JIT: java/io/FileDescriptor.<clinit>()V time 93ms (1074ms) @ 0x202438>
<JIT: gnu/java/nio/channels/FileChannelImpl.<clinit>()V time 2ms (1076ms)
@ 0x208418>
Loading java/lang/Runtime.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
<JIT: java/lang/System.loadLibrary(Ljava/lang/String;)V time 18ms (1094ms)
@ 0x1fd808>
Loading kaffe/lang/MemoryAdvice.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
<JIT: java/lang/Runtime.<clinit>()V time 14ms (1108ms) @ 0x20d050>
<JIT: java/lang/Runtime.<init>()V time 1ms (1109ms) @ 0x1fc598>
<JIT: kaffe/lang/MemoryAdvice.<clinit>()V time 2ms (1111ms) @ 0x204438>
<JIT: kaffe/lang/MemoryAdvice.<init>()V time 2ms (1113ms) @ 0x204be8>
<JIT: kaffe/lang/MemoryAdvice.<init>(IIIIII)V time 2ms (1115ms) @
0x20d428>
<JIT: kaffe/lang/MemoryAdvice.this()V time 1ms (1116ms) @ 0x2085a0>
<JIT: kaffe/lang/MemoryAdvice.getInstance()Lkaffe/lang/MemoryAdvice; time
1ms (1117ms) @ 0x1d3270>
<JIT: java/util/Vector.<init>(I)V time 2ms (1119ms) @ 0x1336e8>
<JIT: java/lang/RuntimePermission.<init>(Ljava/lang/String;)V time 1ms
(1120ms) @ 0x1fc678>
<JIT: java/security/BasicPermission.<init>(Ljava/lang/String;)V time 2ms
(1122ms) @ 0x202050>
<JIT: java/security/Permission.<init>(Ljava/lang/String;)V time 2ms
(1124ms) @ 0x2049f8>
<JIT: java/lang/Runtime.getRuntime()Ljava/lang/Runtime; time 1ms (1125ms)
@ 0x1d30f0>
<JIT: java/lang/Class.getClassLoader()Ljava/lang/ClassLoader; time 1ms
(1126ms) @ 0x1fc758>
Loading
java/lang/UnsatisfiedLinkError.class(/wrk/ipaq/u/jko/test/jre/lib/rt.jar)
[compressed]
<JIT:
java/lang/Runtime.loadLibrary(Ljava/lang/String;Ljava/lang/ClassLoader;)V
time 19ms (1145ms) @ 0x215060>
<JIT: java/lang/System.getSecurityManager()Ljava/lang/SecurityManager;
time 1ms (1146ms) @ 0x1d3570>
<JIT: java/lang/StringBuffer.<init>()V time 2ms (1148ms) @ 0x1fc838>
<JIT: java/lang/StringBuffer.<init>(I)V time 2ms (1150ms) @ 0x204de0>
<JIT: java/lang/System.getProperty(Ljava/lang/String;)Ljava/lang/String;
time 3ms (1153ms) @ 0x20dc08>
<JIT:
gnu/classpath/SystemProperties.getProperty(Ljava/lang/String;)Ljava/lang/String;
time 2ms (1155ms) @ 0x1337d8>
<JIT: java/io/File.<clinit>()V time 4ms (1159ms) @ 0x214048>
<JIT: java/lang/String.charAt(I)C time 4ms (1163ms) @ 0x205830>
<JIT: java/lang/String.<init>([C)V time 2ms (1165ms) @ 0x211238>
<JIT: java/lang/String.<init>([CII)V time 3ms (1168ms) @ 0x212058>
<JIT:
java/util/StringTokenizer.<init>(Ljava/lang/String;Ljava/lang/String;)V
time 1ms (1169ms) @ 0x211428>
<JIT:
java/util/StringTokenizer.<init>(Ljava/lang/String;Ljava/lang/String;Z)V
time 2ms (1171ms) @ 0x212428>
<JIT: java/util/StringTokenizer.hasMoreTokens()Z time 3ms (1174ms) @
0x213038>
<JIT: java/lang/String.indexOf(I)I time 1ms (1175ms) @ 0x211618>
<JIT: java/lang/String.indexOf(II)I time 3ms (1178ms) @ 0x212818>
<JIT: java/util/StringTokenizer.nextToken()Ljava/lang/String; time 8ms
(1186ms) @ 0x21c048>
<JIT: java/lang/String.substring(II)Ljava/lang/String; time 4ms (1190ms) @
0x213828>
<JIT: java/lang/String.<init>(II[C)V time 1ms (1191ms) @ 0x2119f8>
<JIT:
java/lang/Runtime.mapLibraryName(Ljava/lang/String;)Ljava/lang/String;
time 2ms (1193ms) @ 0x20d818>
Internal error: caught an unexpected exception.
Please check your CLASSPATH and your installation.
java/lang/NullPointerException
Aborted

Any quick ideas what's wrong?

Cheers,
  Jari




More information about the kaffe mailing list