Older blog entries for twisti (starting at number 11)

OpenJDK on ARM

Today I pulled myself together and tried to build IcedTea for ARM again. I had two options: to build it natively on an ARM board or try to cross-compile it. I decided to try the cross-compile approach.

The build did not fully finish, because I don't have ALSA libraries in my cross-build enviroment, so I just took an j2re-image from an x86_64 build and replaced

bin/java

with the cross-compiled one and copied

openjdk/control/build/linux-arm/lib/arm/

into the x86_64 j2re-image.

And it works!!!


$ uname -m
armv5tejl
$ java -version
java version "1.6.0"
IcedTea Runtime Environment (build 1.6.0-b06)
CACAO (build 0.98+svn, JIT mode)

(btw. this output calls 10273 Java methods)

Now I'm testing applications like DaCapo and most benchmarks of DaCapo already pass in small size.

IcedTea on Alpha

After some problems with the architecture define in OpenJDK's build system, today I got the stuff built. At least the ECJ-poured one:


$ uname -m
alpha
$ openjdk-ecj/build/linux-alpha/bin/java -version
java version "1.7.0"
IcedTea Runtime Environment (build 1.7.0-b24)
CACAO (build 0.98+svn, JIT mode)
$ openjdk-ecj/build/linux-alpha/bin/java -cp ~/cacao/ HelloWorld
Hello World!

Let's see if I get the whole stuff built...

undefined reference to `__tls_get_addr'

I had some problems to get IcedTea compiled on our i386, x86_64 and powerpc64 boxes. It turned out to be the -z def linker option and the glibc version used. A little google'ing revealed the fix. Just add the AS_NEEDED directive as shown below:


$ cat /usr/lib64/libc.so 
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf64-powerpc)
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED (
/lib/ld64.so.1 ) )
5 Sep 2007 (updated 23 Jul 2008 at 07:37 UTC) »
HotSpot's verifier not verifying

Yesterday I found the problem why we get a VerifyError when running Eclipse with CACAO-OpenJDK, while HotSpot does not. It's again the MagicAccessorImpl class.

Snippet from sun/reflect/MagicAccessorImpl.java (I overlooked that when debugging the access-check bug):


    The bug fix for 4486457 also necessitated disabling
    verification for this class and all subclasses, as
opposed to just
    SerializationConstructorAccessorImpl and subclasses, to
avoid
    having to indicate to the VM which of these
dynamically-generated
    stub classes were known to be able to pass the verifier. 

Finding these magics is really a pain...

IcedTea completely built and running on PowerPC

Today I finally made it to build a complete j2sdk-image on powerpc. As IcedTea has support for FreeType, I could run my first GUI application:

This is soooo cool and exciting, I hope I can sleep now :-)

OpenJDK on s390

Peter Molnar got OpenJDK running on s390. This is exciting :-)

OpenJDK: Eclipse

No comment.

OpenJDK: Getting closer to a full build

On friday I found the bug why Boehm always crashed with OpenJDK's wrappers. The problem is that the wrappers create a thread which then runs the VM. Boehm doesn't like that. But it can simply be removed:


Index: j2se/src/share/bin/java.c
===================================================================
--- j2se/src/share/bin/java.c   (revision 244)
+++ j2se/src/share/bin/java.c   (working copy)
@@ -367,7 +367,8 @@ main(int argc, char ** argv)
       args.classname = classname;
       args.ifn = ifn;
 
-      return ContinueInNewThread(JavaMain, threadStackSize,
(void*)&args, ret);
+/*       return ContinueInNewThread(JavaMain,
threadStackSize, (void*)&args, ret); */
+      return JavaMain((void*)&args);
     }
 }
 

With that patch we can use OpenJDK's wrappers with CACAO's libjvm:


$ java -version
LOG: [0x30021b70] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x30021b70] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x30021b70] JVM_FindSignal: name=HUP
LOG: [0x30021b70] JVM_RegisterSignal: sig=0, handler=0x2,
IMPLEMENT ME!
LOG: [0x30021b70] JVM_FindSignal: name=INT
LOG: [0x30021b70] JVM_RegisterSignal: sig=0, handler=0x2,
IMPLEMENT ME!
LOG: [0x30021b70] JVM_FindSignal: name=TERM
LOG: [0x30021b70] JVM_RegisterSignal: sig=0, handler=0x2,
IMPLEMENT ME!
LOG: [0x30021b70] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x30021b70] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
openjdk version "1.7.0-internal-fastdebug"
OpenJDK Runtime Environment (build
1.7.0-internal-fastdebug-twisti_29_jul_2007_18_33-b00)
CACAO (build 0.98+svn, JIT mode)

WOOHOO! :-)

That means we can build OpenJDK with its own tools, by providing a CACAO-Sun build to OpenJDK with ALT_HOTSPOT_IMPORT_PATH. Then CACAO's libjvm gets imported and all tools like javac, javah or rmic are called from the currently builing OpenJDK.

With some small patches and the help of IcedTea I get a fully compiled and working j2re-image on my powerpc-linux box!!!

That is _really_ cool!

j2sdk-image is currently failing because of missing annotations support. But the student working on CACAO's annotations support already has a working implementation for OpenJDK and it will be (hopefully) commited tomorrow. That probably means a new blog soon...

Wanna Eclipse on s390?

Peter Molnar, a student of the Vienna University of Technology who is doing his thesis on CACAO, did the undoable. But see for yourself.

Portable OpenJDK

Here is another output of the prop testcase:


$ cacao prop
LOG: [0x30020bd0] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x1008a0f0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x1008aa50, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x1008cc30, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x1008c690, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x10094d20, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x10094a50, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x1008aa50, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x10094870, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100944b0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100942d0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x10046690, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_FindSignal: name=HUP
LOG: [0x30020bd0] JVM_RegisterSignal: sig=0, handler=0x2,
IMPLEMENT ME!
LOG: [0x30020bd0] JVM_FindSignal: name=INT
LOG: [0x30020bd0] JVM_RegisterSignal: sig=0, handler=0x2,
IMPLEMENT ME!
LOG: [0x30020bd0] JVM_FindSignal: name=TERM
LOG: [0x30020bd0] JVM_RegisterSignal: sig=0, handler=0x2,
IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100aaa50, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100acf00, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100ad4b0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100ad3c0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100b03c0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100baa50, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100baa50, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100ba3c0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100ba0f0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100cc960, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100d0c30, IMPLEMENT ME!
#all properties:
#Fri Jun 22 12:30:16 GMT+01:00 2007
java.runtime.name=OpenJDK Runtime Environment
sun.boot.library.path=/home/twisti/cacao/sun/openjdk/jdk/control/build/linux-ppc-fastdebug/lib/ppc/
java.vm.version=0.98+svn
java.vm.vendor=CACAO Team
java.vendor.url=http\://java.sun.com/
path.separator=\:
java.vm.name=CACAO
file.encoding.pkg=sun.io
user.country=US
sun.os.patch.level=unknown
java.vm.specification.name=Java Virtual Machine Specification
user.dir=/home/twisti/cacao/cacao-sun/tests
java.runtime.version=1.7.0-internal-fastdebug-twisti_21_jun_2007_21_30-b00
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
os.arch=ppc
java.io.tmpdir=/tmp
line.separator=\n
java.vm.specification.vendor=Sun Microsystems Inc.
os.name=Linux
sun.jnu.encoding=ANSI_X3.4-1968
java.specification.name=Java Platform API Specification
java.class.version=50.0
os.version=2.6.18-4-powerpc
user.home=/home/twisti
user.timezone=GMT+01\:00
java.awt.printerjob=sun.print.PSPrinterJob
file.encoding=ANSI_X3.4-1968
java.specification.version=1.7
java.class.path=.
user.name=twisti
java.vm.specification.version=1.0
sun.arch.data.model=32
java.home=/home/twisti/tmp/cacao-sun/jre
user.language=en
java.specification.vendor=Sun Microsystems Inc.
java.version=1.7.0-internal-fastdebug
sun.boot.class.path=/home/twisti/cacao/sun/openjdk/jdk/control/build/linux-ppc-fastdebug/classes/
java.boot.class.path=/home/twisti/cacao/sun/openjdk/jdk/control/build/linux-ppc-fastdebug/classes/
java.vendor=Sun Microsystems Inc.
file.separator=/
java.vendor.url.bug=http\://java.sun.com/cgi-bin/bugreport.cgi
sun.io.unicode.encoding=UnicodeBig
sun.cpu.endian=big
sun.desktop=gnome
sun.cpu.isalist=

For those who are saying now: "Hey! That's the same output as the last one with the same unimplemented functions!", look at the output again! (hint: os.arch!!!).

I built the OpenJDK completely with CACAO and free GNU Classpath tools. But the build is not complete, there is still some stuff missing and I need to figure out why it does not work. But it's enough to run a bunch of programs on Java 1.7 on PowerPC (and maybe other architectures, will try that) :-)

I will write down more detailed information about how to build this whole thing here.

2 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!