Re: SableVM on ARM fails to run HelloWorld

Chris Develder <[email protected]> Thu, 24 Nov 2005 12:02:02 +0100
Newsgroups gmane.comp.java.vm.sablevm.general
Message-ID <[email protected]>
(See answers inline below)

Grzegorz B. Prokopski wrote:
> Hi Chris,
> 
> +++ Chris Develder [23/11/05 12:11 +0100]:
> 
>>Hi,
>>
>>Being a SableVM newbie, I have trouble in getting a cross-compiled 
>>sablevm to work.
>>
>>I compiled sablevm-1.12:
>>./configure --host=arm-linux 
>>--prefix=/work/cdvelder/xscale/usr/local/sablevm-1.12 
>>--with-threading=direct --with-debugging-features
>>
>>And sablevm-classpath-1.22: (using jikes-1.22)
>>./configure --host=arm-linux 
>>--prefix=/work/cdvelder/xscale/usr/local/sablevm-1.12 --disable-gtk-peer 
>>--disable-qt-peer --enable-debug --with-jikes
> 
> 
> Looks good to me.
> 
> 
>>Upon moving it to the target device, running
>># sablevm HelloWorld
>>produces:
>>java.lang.ClassFormatError
>>   at java.lang.VMClassLoader.nativeDefineClass (VMClassLoader.java)
>>   at java.lang.VMClassLoader.defineClass (VMClassLoader.java:92)
>>   at java.lang.ClassLoader.defineClass (ClassLoader.java:677)
>>   at java.security.SecureClassLoader.defineClass 
>>(SecureClassLoader.java:108)
>>   at java.net.URLClassLoader.findClass (URLClassLoader.java:926)
>>   at java.lang.ClassLoader.loadClass (ClassLoader.java:358)
>>   at java.lang.ClassLoader$1.loadClass (ClassLoader.java:1297)
>>   at java.lang.ClassLoader.loadClass (ClassLoader.java:309)
>>   at java.lang.VirtualMachine.main (VirtualMachine.java:99)
> 
> 
> Usually the first test we do is to make sure it bootstraps properly w/o
> running any user code.  You can do it with something like:
> 
> 	sablevm -Y blah
> 
> This should tell you that class 'blah' couldn't be found.

Yes, I tested it and it produced the expected 
java.lang.ClassNotFoundException

> 
> 
>>The HelloWorld.class was generated using Jikes on my build machine. I 
>>couldn't rebuild it on the target because javac-sablevm is an empty file.
> 
> 
> Weird that is it empty.  But if you have jikes installed on the target
> machine you can always do:
> 
> export BOOTCLASSPATH=/work/cdvelder/xscale/usr/local/sablevm-1.12/share/sablevm-classpath/libclasspath.jar
> and then use 'jikes HelloWorld.java' to compile the source.

[The reason for javac-sablevm being empty was that I configured from a 
subdir of the sablevm source (I made 2 subdirs, one sablevm-native, one 
sablevm-arm to build for both platforms on my build machine. Copying the 
*.tmpl files to both of them solved the empty file issue)]


> 
> Make sure the path you give in --prefix is *identical* on the machine you use
> for cross-compilation and on the device you later copy installed sablevm to.

Yes, I took care of this.

> 
> Also make sure your class files (HelloWorld in your case) are compiled for
> java 1.4 format.  We don't support java 1.5 format just yet.

It doesn't work with .class version 0.48 (which is the version generated 
by jikes-1.22). But the weird thing is that it does work using sablevm 
(ie. a native build) on my amd64-k8 build machine.

Meanwhile, I have also tried sablevm on a 0.46 HelloWorld.class file, 
but this doesn't work either.

I also tried sablevm with a sablevm-classpath compiled using jikes-1.21, 
(for both the sablevm-classpath and HelloWorld; output is still .class 
v0.48 though), without success.
Building sablevm-classpath-1.12 using jikes-1.19 doesn't work because of 
the +Pno-shadow (Error: "no-shadow" is not a recognized flag for 
controlling pedantic warnings.) when making.

Cheers,
Chris

> 
> Let us know of your findings.  There's a few people on this list that used
> SableVM in embedded environments so maybe they can give a better advice.
> 
> Cheers,
> 
> 		Grzegorz B. Prokopski
>