Kaffe on Linux for System/390

My former employer has graciously allowed me to post the patches I created to make the Kaffe Java environment run on Linux for System/390. I haven't yet produced an s390 binary RPM, so if you want to follow in my footsteps you'll have to build from source. To do so:

  1. Get all the parts you need:
    1. Download the Kaffe 1.0.5 source from Kaffe.Org.
    2. Download the Kaffe 1.0.5 s390 patches from here. Undo the silly name change that GeoCities forced me to make:
      1. mv kaffe-105-s390-diff.gz kaffe-1.0.5-s390.diff.gz
      2. gunzip kaffe-1.0.5-s390.diff.gz
    3. Download the Pizza Java compiler binary JAR file (distributed with Kaffe 1.0b4) from here. This is necessary because there are bugs in the KJC Java compiler (distributed with Kaffe 1.0.5) when running on Linux/390. These bugs have been reported to the KJC authors, and will hopefully be fixed. In the mean time, the javac command has been modified to use Pizza instead of KJC.
    4. Download the IBM Jikes Java compiler s390 binary RPM from Think Blue Linux. Jikes is an excellent, fast Java compiler, and Kaffe will use it for the regression tests (make check) if Jikes is installed before Kaffe.
  2. Install the source and apply the patches:
    1. su unless you're logged in as root.
    2. cd /usr/src
    3. tar -xzvf wherever/kaffe-1.0.5.tar.gz
    4. patch -p0 < wherever/kaffe-1.0.5-s390.diff

      Note: If you get an error applying the "config.guess" patch but all the "config/s390/..." patches applied, you tried to do this starting from the wrong directory. Blow away your source tree and repeat from "cd /usr/src" above.

  3. Install Jikes and Pizza:
    1. rpm -iv --nodeps wherever/jikes-1.11-1.s390.rpm

      The --nodeps flag is necessary because the RPM database on the Marist 2.2.15 "large root filesystem" distribution doesn't reflect what's actually installed. Without --nodeps, rpm will complain that the Standard C++ library (libstdc++) is not installed, although it actually is.

    2. cp wherever/pizza.jar /usr/src/kaffe-1.0.5/libraries/javalib
    3. chmod a+r /usr/src/kaffe-1.0.5/libraries/javalib/pizza.jar
  4. Build and test Kaffe:
    1. cd kaffe-1.0.5
    2. configure --with-threads=unix-jthreads
    3. make
    4. make check

      A number of tests have extremely small limits for certain timeouts and may fail on busy CPUs. When not contending heavily for execution time (e.g. on an idle system), they all pass. These tests are specifically:

      • CLTestJLock.java
      • CatchDeath.java
      • ExceptionInInitializerTest.java
      • GCTest.java
      • Preempt.java
      • ProcessClassInst.java
      • ProcessClassLockTest.java
      • SoInterrupt.java
      • SoTimeout.java
      • TestUnlock.java
      • ThreadInterrupt.java
      • ThreadStop.java
      • UDPTest.java

      The InvTarExcTest.java test is recorded as a failure but in fact passes. This has been reported to the authors.

      On machines that do not have the IEEE floating point feature, three additional tests will fail:

      • DoubleComp.java
      • DoubleNeg.java
      • DoublePrint.java
      This has been reported to the IBM Linux/390 team (see my note to the Linux-390 list for an explanantion of the problem and Ulrich Weigand's response about the reason for the results if you care about the details). The net result is that floating point on non-IEEE machines is known to be deficient and unlikely to be repaired, although the problem actually only appears to affect non-numeric values.

  5. Install kafe:
    1. make install
    2. cp libraries/javalib/pizza.jar /usr/local/share/kaffe

You've now got several commands:


Have fun!

Ross Patterson
RossPatterson@Yahoo.Com

Back to the home page, Jeeves!


1