Skip to main content

How to Build and Run Squawk

55 replies [Last post]
qawsed123
Offline
Joined: 2009-10-21

Hello,

I have tried to build and run the squawk like that link:

https://squawk.dev.java.net/source/browse/*checkout*/squawk/trunk/doc/Ho...

At the second step: "2. Build the ROM image", when I put this command:

java -jar build.jar -prod -o2 -mac rom j2me translator graphics

The console return:

build failed: 'j2me' module is not a jar/zip file and does not have a target defined for it

How I can resolve it?

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
derek_white
Offline
Joined: 2006-09-08

At this point squawk is trying to look up the "squawk_select" using dlsym(). It tried both the strings "squawk_select" and "_squawk_select" and dlsym failed.

It's probably the case that the linux dynamic linker decorates the function name in a different way than Solaris/Mac/Windows does.

You can try looking at the squawk executable and seeing what names are there (using dissassembler, or simply "strings squawk"). If you see that a different naming convention is used, you can fix com.sun.cldc.jna.NativeLibrary.getFunction0() to supply the correct function name.

Another possibility is that squawk didn't get built correctly for native builds. In that case the squawk executable won't have any version of squawk_select.

qawsed123
Offline
Joined: 2009-10-21

Hello,

With "strings squawk" there isn't any "squawk_select" in lines.
¿How I can see that a different naming convention is used? ¿Why no method in vmcore calls squawk_select?

I think I'm not able to build correctly the squawk native for Linux x86.

Thanks.

PD: I had to include limits.h in os_posix.c to solve problems with _sysconf. Also changed SIN_LEN in "struct sockaddr_in" to "-1,", delete the reference to libsocket.so in gcccompiler and put a reference for -lpthread.

Message was edited by: qawsed123

qawsed123
Offline
Joined: 2009-10-21

false, no squawk_select in strings squawk.

Message was edited by: qawsed123

qawsed123
Offline
Joined: 2009-10-21

edit. No squawk_select int strings squawk.

Message was edited by: qawsed123

derek_white
Offline
Joined: 2006-09-08

Just to double-check:

In build.properties, the line:
PLATFORM_TYPE=NATIVE

should NOT be commented out, and the other variations should be commented out. is this true?

Actually could you post the result of building the VM with teh verbose flag? E.g.:

d -prod -mac -o2 -verbose rom -metadata cldc imp debugger

Thanks...

qawsed123
Offline
Joined: 2009-10-21

Hello derek.

In build.properties the property "NATIVE" isn't commented out. This is the result of the build:

[b]./d.sh -prod -mac -o2 -verbose rom -metadata cldc imp debugger [/b]
Launcher: Found tools.jar in /usr/lib/jvm/jdk1.5.0_21/lib/tools.jar, by popping up a level from jre.
Builder.JDK: Looking for JDK in /usr/lib/jvm/jdk1.5.0_21, popped up a level from jre
Launcher: Found tools.jar in /usr/lib/jvm/jdk1.5.0_21/lib/tools.jar, by popping up a level from jre.
For vm2c tools.jar=/usr/lib/jvm/jdk1.5.0_21/lib/tools.jar
[build properties updated]
[build properties updated]
[build properties updated]
PLATFORM_TYPE=NATIVE
[build properties updated]
os=Linux-i386
java.home=/usr/lib/jvm/jdk1.5.0_21
java.vm.version=1.5.0_21-b01
C compiler=gcc
Builder properties:
RTSJ1.0=false
EMULATOR_LAUNCHER=false
SMARTMONITORS=true
NATIVE_VERIFICATION_ONLY=true
JAVA_SE=false
CLDC1.1=true
ASSERTIONS_ENABLED=false
SUITE_VERIFIER=false
GC=com.sun.squawk.Lisp2GenerationalCollector
PLATFORM_TYPE=NATIVE
J2ME.HEAP_TRACE=false
JDK1.0=false
KERNEL_SQUAWK=false
DEBUG_CODE_ENABLED=true
MACROIZE=true
ENABLE_SDA_DEBUGGER=true
FLASH_MEMORY=false
SQUAWK_64=false
FAST_INVOKEINTERFACE=true
INCLUDE_EXECUTECIO_PARMS=false
TRACING_ENABLED=false
REAL_TIME_MINI=true
VM2C=true
TRUSTED=false
PLATFORM_TYPE_DELEGATING=false
REVERSE_PARAMETERS=true
ENABLE_DYNAMIC_CLASSLOADING=true
WRITE_BARRIER=true
RESOURCE.CONNECTION=false
AUTOGEN_JNA_NATIVES=false
J2ME.STATS=true
OLD_IIC_MESSAGES=false
FULL_SLOT_CLEARING_ANALYSIS=false
REUSEABLE_MESSAGES=false
PLATFORM_TYPE_BARE_METAL=false
TYPEMAP=false
TRUST_SLOT_CLEARING=true
REAL_TIME_PROTO=true
VERIFY_SIGNATURES=false
EXCLUDE=false
PLATFORM_TYPE_SOCKET=false
NATIVE_GC_ONLY=true
FINALIZATION=false
VERBOSE_EXCEPTIONS=false
BUFFERCHANNELINPUT=false
NATIVE_VERIFICATION=true
SQUAWK=true
REAL_TIME=true
LISP2_BITMAP=true
FLOATS=true
CHECK_SLOT_CLEARING=false
[running rom...]
description: processes a collection of modules to produce the bootstrap suite and Squawk VM executable
arg[0]: -metadata
arg[1]: cldc
arg[2]: imp
arg[3]: debugger
[running romize...]
description: processes a number of classes to produce a .suite file
arg[0]: -o:squawk
arg[1]: -arch:X86
arg[2]: -endian:little
arg[3]: -cp:cldc/j2meclasses:imp/j2meclasses:debugger/j2meclasses
arg[4]: -metadata
arg[5]: -jars
arg[6]: cldc/resources
arg[7]: cldc/j2meclasses
arg[8]: imp/resources
arg[9]: imp/j2meclasses
arg[10]: debugger/j2meclasses
[exec com.sun.squawk.Romizer.main("-o:squawk", "-arch:X86", "-endian:little", "-cp:cldc/j2meclasses:imp/j2meclasses:debugger/j2meclasses", "-metadata", "-jars", "cldc/resources", "cldc/j2meclasses", "imp/resources", "imp/j2meclasses", "debugger/j2meclasses" ...]
Loaded suite stripping settings from squawk.library.properties
Skipping resource file: .svn/all-wcprops
Skipping resource file: .svn/entries
Skipping resource file: META-INF/.svn/all-wcprops
Skipping resource file: META-INF/.svn/text-base/MANIFEST.MF.svn-base
Skipping resource file: META-INF/.svn/prop-base/MANIFEST.MF.svn-base
Skipping resource file: META-INF/.svn/entries
Skipping resource file: .svn/all-wcprops
Skipping resource file: .svn/entries
Skipping resource file: META-INF/.svn/all-wcprops
Skipping resource file: META-INF/.svn/text-base/MANIFEST.MF.svn-base
Skipping resource file: META-INF/.svn/prop-base/MANIFEST.MF.svn-base
Skipping resource file: META-INF/.svn/entries
excluding: com.sun.squawk.compiler.*
excluding: com.sun.squawk.os.*
excluding: com.sun.squawk.BytecodeTracer
excluding: com.sun.squawk.Lisp2Collector*
excluding: com.sun.squawk.CheneyCollector*
excluding: com.sun.squawk.io.j2me.channel.*
excluding: com.sun.squawk.io.j2me.spotsuite.*
excluding: com.sun.cldc.io.connections.HttpConnection
excluding: com.sun.squawk.ClassTunnel
[translating suite squawk [closed: false, parent: null] ...]
Romizer processed 657 classes and generated these files:
/home/victor/plan_b/squawk-native/squawk-native/squawk.sym
/home/victor/plan_b/squawk-native/squawk-native/squawk.suite
/home/victor/plan_b/squawk-native/squawk-native/squawk.suite.metadata
/home/victor/plan_b/squawk-native/squawk-native/squawk_classes.jar
/home/victor/plan_b/squawk-native/squawk-native/vmcore/src/vm/rom.h
/home/victor/plan_b/squawk-native/squawk-native/squawk.suite.api
[exec 'gcc -o /tmp/sizeofpointer3130618203617168116 /tmp/sizeofpointer3130618203617168116.c' ...]
EXEC result =====> 0
[exec '/tmp/sizeofpointer3130618203617168116' ...]
EXEC result =====> 4
[compiling floating point sources in vmcore/src/vm/fp ...]
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/k_tan.o vmcore/src/vm/fp/k_tan.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/s_fabs.o vmcore/src/vm/fp/s_fabs.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/s_floor.o vmcore/src/vm/fp/s_floor.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/k_cos.o vmcore/src/vm/fp/k_cos.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/k_rem_pio2.o vmcore/src/vm/fp/k_rem_pio2.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/w_sqrt.o vmcore/src/vm/fp/w_sqrt.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/s_scalbn.o vmcore/src/vm/fp/s_scalbn.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/e_sqrt.o vmcore/src/vm/fp/e_sqrt.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/s_cos.o vmcore/src/vm/fp/s_cos.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/s_tan.o vmcore/src/vm/fp/s_tan.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/s_sin.o vmcore/src/vm/fp/s_sin.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/s_copysign.o vmcore/src/vm/fp/s_copysign.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/k_sin.o vmcore/src/vm/fp/k_sin.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/s_ceil.o vmcore/src/vm/fp/s_ceil.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/e_rem_pio2.o vmcore/src/vm/fp/e_rem_pio2.c' ...]
EXEC result =====> 0
[exec 'gcc -c -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/fp_bytecodes.o vmcore/src/vm/fp/fp_bytecodes.c' ...]
EXEC result =====> 0
[compiling native verification sources in vmcore/src/vm/util ...]
[exec 'gcc -c -O2 -ffunction-sections -fdata-sections -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/sha.o vmcore/src/vm/util/sha.c' ...]
EXEC result =====> 0
[compiling 'vmcore/src/vm/squawk.c' ...]
[exec 'gcc -c -O2 -ffunction-sections -fdata-sections -DMACROIZE -DNATIVE_VERIFICATION=true -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -DPLATFORM_TYPE_NATIVE=1 -I/usr/lib/jvm/jdk1.5.0_21/include -I/usr/lib/jvm/jdk1.5.0_21/include/linux -Ivmcore/src/vm -Ivmcore/src/vm/fp -Ivmcore/src/rts/gcc -o vmcore/build/squawk.o vmcore/src/vm/squawk.c' ...]
EXEC result =====> 0
[linking 'squawk' ...]
[exec 'gcc --gc-sections -o squawk vmcore/build/k_tan.o vmcore/build/s_fabs.o vmcore/build/s_floor.o vmcore/build/k_cos.o vmcore/build/k_rem_pio2.o vmcore/build/w_sqrt.o vmcore/build/s_scalbn.o vmcore/build/e_sqrt.o vmcore/build/s_cos.o vmcore/build/s_tan.o vmcore/build/s_sin.o vmcore/build/s_copysign.o vmcore/build/k_sin.o vmcore/build/s_ceil.o vmcore/build/e_rem_pio2.o vmcore/build/fp_bytecodes.o vmcore/build/sha.o vmcore/build/squawk.o -ldl -lm -lnsl -lpthread' ...]
EXEC result =====> 0
[running squawk.jar...]
description: (re)builds squawk.jar (the classes required by the embedded JVM in Squawk)
[running 'jar cf squawk.jar @hosted-support/squawk.jar.filelist' ...]
[exec 'jar cf squawk.jar @hosted-support/squawk.jar.filelist' ...]
EXEC result =====> 0
Total time: 27s

Thanks for all.

derek_white
Offline
Joined: 2006-09-08

OK, that looks pretty good.

Here's another approach:

In vmcore/src/vm/io_native.c, there's a built-in symbol table "DL_TABLE_SIZE" and "dltable". You can try adding an entry for squawk_select to the end of that table.

I'm guessing that squawk_select is simply not being exported due to some linker options we're using on linux, but this will work around that.

qawsed123
Offline
Joined: 2009-10-21

Hello Derek,

I put these:
[b]
#define DL_TABLE_SIZE 11[/b]

static dlentry dltable[DL_TABLE_SIZE] = {
{"sysFD_SIZE", &sysFD_SIZE},
{"sysSIZEOFSTAT", &sysSIZEOFSTAT},
{"sysFD_CLR", &sysFD_CLR},
{"sysFD_SET", &sysFD_SET},
{"sysFD_ISSET", &sysFD_ISSET},
{"com_sun_squawk_platform_posix_callouts_Libc_stat_layout", (void*)&com_sun_squawk_platform_posix_callouts_Libc_stat_layout},
{"_com_sun_squawk_platform_posix_natives_SocketImpl_sockaddr_inImpl_layout", (void*)&_com_sun_squawk_platform_posix_natives_SocketImpl_sockaddr_inImpl_layout},
{"testIntStar1", &testIntStar1},
{"testIntStar2", &testIntStar2},
[b] {"squawk_select",&squawk_select},
{"cancel_squawk_select",&cancel_squawk_select},
[/b]

In appearance it builds correctly. When I do ./squawk show this:

[b]Uncaught exception in Thread.run():
on thread com.sun.squawk.imp.MIDletMainWrapper - main
java.lang.IllegalArgumentException: MIDlet-1 property must exist in META-INF/MANIFEST.MF
at java.lang.Throwable.(bci=16)
at java.lang.Throwable.(bci=5)
at java.lang.Exception.(bci=6)
at java.lang.RuntimeException.(bci=6)
at java.lang.IllegalArgumentException.(bci=6)
at com.sun.squawk.imp.MIDletMainWrapper.main(bci=103)
in virtual method #97 of com.sun.squawk.Klass(bci=25)
at com.sun.squawk.Isolate.run(bci=411)
at java.lang.Thread.run(bci=17)
in virtual method #47 of com.sun.squawk.VMThread(bci=42)
in static method #3 of com.sun.squawk.VM(bci=6)

--------------------------------------------------------------------
GCs: 0 full, 0 partial
** VM stopped: exit code = 1 **[/b]

So I try to pass HelloWorld or TestEcho and shows this:

java.lang.RuntimeException: Can't find native symbol _stat. OS Error: ./squawk: undefined symbol: _stat
at java.lang.Throwable.(bci=16)
at java.lang.Throwable.(bci=5)
at java.lang.Exception.(bci=6)
at java.lang.RuntimeException.(bci=6)
in virtual method #13 of com.sun.cldc.jna.NativeLibrary(bci=118)
in virtual method #13 of com.sun.cldc.jna.NativeLibrary(bci=81)
at com.sun.cldc.jna.NativeLibrary.getFunction(bci=6)
at com.sun.squawk.platform.posix.natives.LibCImpl.(bci=23)
at com.sun.squawk.platform.posix.linux.natives.LibCImpl.(bci=5)
in virtual method #11 of com.sun.squawk.Klass(bci=53)
at java.lang.Class.newInstance(bci=89)
at com.sun.cldc.jna.Native.loadLibrary(bci=59)
at com.sun.squawk.platform.posix.natives.LibC.(bci=27)
in virtual method #111 of com.sun.squawk.Klass(bci=49)
in virtual method #108 of com.sun.squawk.Klass(bci=328)
in virtual method #36 of com.sun.squawk.Isolate(bci=13)
in static method #4 of com.sun.squawk.VM(bci=11)
at com.sun.squawk.platform.posix.GCFFileImpl.(bci=10)
in virtual method #11 of com.sun.squawk.Klass(bci=53)
in static method #1 of com.sun.squawk.platform.Platform(bci=40)
in static method #4 of com.sun.squawk.platform.Platform(bci=10)
in static method #3 of com.sun.squawk.io.j2me.file.Protocol(bci=6)
in virtual method #43 of com.sun.squawk.io.j2me.file.Protocol(bci=9)
in virtual method #45 of com.sun.squawk.io.j2me.file.Protocol(bci=20)
at com.sun.squawk.io.j2me.file.Protocol.openInputStream(bci=8)
at com.sun.squawk.io.ConnectionBaseAdapter.openDataInputStream(bci=8)
at javax.microedition.io.Connector.openDataInputStream(bci=38)
in static method #4 of com.sun.squawk.ObjectMemoryLoader(bci=54)
in static method #3 of com.sun.squawk.Suite(bci=16)
in static method #4 of com.sun.squawk.Suite(bci=6)
in virtual method #45 of com.sun.squawk.Isolate(bci=28)
at com.sun.squawk.Isolate.(bci=132)
at com.sun.squawk.Isolate.(bci=16)
at com.sun.squawk.JavaApplicationManager.main(bci=138)
in virtual method #97 of com.sun.squawk.Klass(bci=25)
at com.sun.squawk.Isolate.run(bci=411)
at java.lang.Thread.run(bci=17)
in virtual method #47 of com.sun.squawk.VMThread(bci=42)
in static method #3 of com.sun.squawk.VM(bci=6)
Error constructing Isolate based on suite: file://tests/HelloWorld/HelloWorld.suite and classpath: null
java.lang.Error: ExceptionInInitializer: com.sun.squawk.platform.posix.natives.LibC:java.lang.RuntimeException: Can't find native symbol _stat. OS Error: ./squawk: undefined symbol: _stat

In io_native, in "dltable", there is:

{com_sun_squawk_platform_posix_callouts_Libc_stat_layout, (void*)&com_sun_squawk_platform_posix_callouts_Libc_stat_layout}

And both methods ("stat" and "fstat") are in that path. Do I have to add more symbols in the "dltable" ?

Thanks

derek_white
Offline
Joined: 2006-09-08

Take a look at your sys/stat.h file. I looked at http://linux.die.net/include/sys/stat.h.

It seems that stat may be a macro that maps to stat64 or xstat in various cases.

This really needs more thought, but as long as you're updating the dltable, you could create a squawk_stat function which called stat. Then add the pair {"stat", &squawk_stat} to the dltable.

qawsed123
Offline
Joined: 2009-10-21

I tried something similar yesterday (add a pair {"stat",&stat} and the same for fstat), and the result was the same that today. I decided to not post because I wasn't convinced with that solution. Also because squawk builds but ./squawk shows:

[b]...
Error constructing Isolate based on suite: file://tests/HelloWorld/HelloWorld.suite and classpath: null
java.lang.Error: ExceptionInInitializer: com.sun.squawk.platform.posix.natives.LibC:java.lang.ArrayIndexOutOfBoundsException: on [int of length 118 with index 118 [/b]

Viewing LibC.java, there are 118 index with an association with constants of stat.h...

Being honestly since some posts ago my little knowledgments are finished. This post could be an eternal stack of questions about my next error after the previous error and your answer... I'm absolutely lost with the most part of vmcore & cldc-native code and I feel I'm abusing your confidence.

¿How far do you think I'm to build and run successfully the squawk-native for linux x86 at this rate?

Thanks.

glegris
Offline
Joined: 2003-07-15

I sent a patch for inclusion a year ago: http://forums.java.net/jive/thread.jspa?threadID=64862&tstart=15

It may help you to solve your problem.

-- Guillaume

qawsed123
Offline
Joined: 2009-10-21

Hello, wow!

I did the same steps than you until face up both LibCImpl modifies.
With your code squawk builds and no errors of symbols, but when I tried to pass a Hello test:

[b]Error constructing Isolate based on suite: file://tests/HelloWorld/HelloWorld.suite and classpath: null
java.lang.Error: invalid hash for parent (memory:bootstrap): expected 10113586, received 10134360[/b]

It seems a difference between hash memory and parent.getHash.
In ObjectMemoryLoader.java in cldc/src/com/sun/squawk/

I suppose it returns bad hash and finally when loadParent(int hash, String uri) compare both and fails throw the Error.

Thanks.

qawsed123
Offline
Joined: 2009-10-21

Hello,

any hints?

Regards.

derek_white
Offline
Joined: 2006-09-08

This usually means that you need to do a clean rebuild of your application.

qawsed123
Offline
Joined: 2009-10-21

Hello derek,

I suppose that finally I have build correctly squawk native for Linux:

[b]Running: com.sun.squawk.Test[/b]
allocate size: 4046660, klass: [java.lang.Object, arrayLength: 1011663
bytes free: 1620540 in alloc space, 4046648 in total
x39 count = 1
VMThread.extendStack() failed!
x40 recursion level = 114664
x42 printStackTrace - this should be a java.lang.NullPointerException
java.lang.NullPointerException
at java.lang.Throwable.(bci=16)
at java.lang.Exception.(bci=5)
at java.lang.RuntimeException.(bci=5)
at java.lang.NullPointerException.(bci=5)
in static method #11 of com.sun.squawk.VM(bci=6)
at com.sun.squawk.Test$FOO.toString(bci=5)
at com.sun.squawk.Test$FOO$1.run(bci=21)
in virtual method #10 of com.sun.squawk.Test$FOO(bci=15)
in static method #44 of com.sun.squawk.Test(bci=25)
at com.sun.squawk.Test.runXTests(bci=121)
at com.sun.squawk.Test.main(bci=59)
in virtual method #97 of com.sun.squawk.Klass(bci=25)
at com.sun.squawk.Isolate.run(bci=411)
at java.lang.Thread.run(bci=17)
in virtual method #47 of com.sun.squawk.VMThread(bci=42)
in static method #3 of com.sun.squawk.VM(bci=6)
Date: Sat Jun 12 09:18:14 PST 2010
Empty loop timings per 16000000 = 1565ms
Empty loop timings(2) per 16000000 = 1565ms
Empty simple call per 1000000 = 123ms
Empty long call per 1000000 = 131ms
Empty exception calls per 1000000 = 150ms
random time test (531441 empty loop iterations)... 70ms
Finished tests

--------------------------------------------------------------------
GCs: 15 full, 16 partial
** VM stopped: exit code = 12345 **

Also I suppose that "my application" is one of the multiple tests that native-branch includes in /tests folder.
I don't know how I can do a clean rebuild of my application beyond the instructions of readme.txt in folder tests of trunk branch.

I'm trying to run the HelloWolrd test (included in trunk version) on native version doing these steps:

export JAVA_HOME=/usr/lib/jvm/jdk1.5.0_21
export LD_LIBRARY_PATH=/usr/lib/jvm/jdk1.5.0_21/jre/lib/i386/server/:/usr/lib/jvm/jdk1.5.0_21/jre/lib/i386:$LD_LIBRARY_PATH
export PATH=$PATH:/usr/lib/jvm/jdk1.5.0_21/bin

./d.sh clean
./bld.sh
./d.sh copyphoneme
./d.sh
./d.sh -prod -mac -o2 -verbose rom -metadata cldc imp debugger
./d.sh user-suite tests/HelloWorld
./squawk -suite:tests/HelloWorld/HelloWorld

Error constructing Isolate based on suite: file://tests/HelloWorld/HelloWorld.suite and classpath: null
java.lang.Error: invalid hash for parent (memory:bootstrap): expected 10113586, received 10450833

I don't know other way to build & run a test. Is there any tutorial apart from readme.txt in other java me subforum or squawk forum?

I like to run something similar to "helloworld".

Thanks

Message was edited by: qawsed123

derek_white
Offline
Joined: 2006-09-08

That's great. As far as rebuilding your application, you can use the "user-clean" builder target. e.g:

./d.sh user-clean tests/HelloWorld

BTW, to see all of teh build targets you can use:
> d.sh -help

qawsed123
Offline
Joined: 2009-10-21

Hello,

Yes I had other troubles, but finally Linux squawk-native was builded. Obviously not as well as I would hehehe. When I try to run the squawk it shows this:

[b]./squawk
do_throw on service stack:
class: java.lang.RuntimeException
detail message: Can't find native symbol _squawk_select. OS Error: ./squawk: undefined symbol: _squawk_select
fatalInterpreterError interpreter state -- vmcore/src/vm/switch.c:482
opcode: 0xe1
iparm: 0x0
ip: 0xb6518487. Is in code range 0xb64e4000 .. 0xb754e000
stack: 0xb754e008. Is NOT in RAM range 0xb6d4e000 .. 0xb754e000
current stack is service stack
sp: 0xb7553f0c. Is in current stack range 0xb754e01c .. 0xb7554000
fp: 0xb7553f18. Is in current stack range 0xb754e01c .. 0xb7554000

--------------------------------------------------------------------
GCs: 0 full, 0 partial
** VM stopped: exit code = -1 **
[/b]

The "_squawk_select" function is in io_native.c file. Apart from this, in line 482 of switch.c.spp there is the do_throw function of this case:

case OPC_THROW: iparmNone();
do_throw(); break;

that throws the exception (bytecodes.c.spp -> function do_throw()).

As you cans see, then VM says that RAM is not in range.

What's the issue?

Thanks.

eric_arseneau
Offline
Joined: 2004-07-15

No idea, this is a Derek question to answer and he is on vacation until Thursday. Sorry.

qawsed123
Offline
Joined: 2009-10-21

Hello,

I can't find the solution.

If I build the squawk with the original libjvm.so (the path that "./d.sh jvmenv" shows) happens this:

[b]/opt/OSELAS.Toolchain-1.99.3/arm-1136jfs-linux-gnueabi/gcc-4.3.2-glibc-2.8-binutils-2.19-kernel-2.6.27-sanitized/lib/gcc/arm-1136jfs-linux-gnueabi/4.3.2/../../../../arm-1136jfs-linux-gnueabi/bin/ld: skipping incompatible /usr/lib/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/i386/server/libjvm.so when searching for -ljvm
/opt/OSELAS.Toolchain-1.99.3/arm-1136jfs-linux-gnueabi/gcc-4.3.2-glibc-2.8-binutils-2.19-kernel-2.6.27-sanitized/lib/gcc/arm-1136jfs-linux-gnueabi/4.3.2/../../../../arm-1136jfs-linux-gnueabi/bin/ld: cannot find -ljvm
collect2: ld returned 1 exit status[/b]

[cross compiler doesn't accept this library]

If I use a modified libjvm.so for ARM (for example the libjvm.so that jamvm-1.5.3 contains) I can build the squawk "well", but when I put it into the target platform, it asks me about libjvm.so.

This time not exactly about libjvm.so but other libraries that that libjvm.so (modified) uses. When I put the LD_LIBRARY_PATH and BOOTCLASSPATH correct into the target platform (busybox SO) and try to run the squawk, this happens:
[b]
Alloced heap size 0xffff8
Allocated mark bits - size is 8192
Exception occurred while VM initialising.
java/lang/NoClassDefFoundError: jamvm/java/lang/VMClassLoaderData[/b]

A java class into squawk_classes.jar (i think) not found the path of jamvm (because there is no jamvm installed in the target platform... only are the libraries).

Eric, you told me:

[b]If you are getting a libjvm.so request on your target, not desktop, then I can only assume something is wrong.[/b]

So, Should I never be asked about libjvm.so in the target platform? Is an issue that would be resolved into the host platform?

Because the shell is trying to say me "please, install jamvm, install jamvm, install jamvm...", but I shouldn't need it, because I'm running the build squawk (I supose a bad build squawk).

Thanks.

Message was edited by: qawsed123

eric_arseneau
Offline
Joined: 2004-07-15

I asked earlier which branch you are using and I dont think I got an answer. That will help.

If you are using trunk, and you are using our default Linux startup, then you will need libjvm. You can go into the startup part of Squawk and see where it asks for it. But I think you should look at native branch before you do that.

The native branch removes the needs for libjvm.

We used to cheat on desktop with Squawk, we use the platform java to provide file and networking access. This has been removed and implemented via os calls in the native branch.

qawsed123
Offline
Joined: 2009-10-21

Oh I'm sorry. I'm an idiot.. I'm using trunk version! I didn't see your question!

Ok, ok, I will try with native branch.

Thanks for all !

PD: The difference between the trunk version and the native branch is only the use of the libvjm?

eric_arseneau
Offline
Joined: 2004-07-15

There are other changes, you will likely run into other problems.

So dont throw away what you have just yet until you get further with native branch.

Derek is working on integrating native back into trunk.

qawsed123
Offline
Joined: 2009-10-21

Hello,

Yes I had other troubles, but finally Linux squawk-native was builded. Obviously not as well as I would hehehe. When I try to run the squawk it shows this:

[b]./squawk
do_throw on service stack:
class: java.lang.RuntimeException
detail message: Can't find native symbol _squawk_select. OS Error: ./squawk: undefined symbol: _squawk_select
fatalInterpreterError interpreter state -- vmcore/src/vm/switch.c:482
opcode: 0xe1
iparm: 0x0
ip: 0xb6518487. Is in code range 0xb64e4000 .. 0xb754e000
stack: 0xb754e008. Is NOT in RAM range 0xb6d4e000 .. 0xb754e000
current stack is service stack
sp: 0xb7553f0c. Is in current stack range 0xb754e01c .. 0xb7554000
fp: 0xb7553f18. Is in current stack range 0xb754e01c .. 0xb7554000

--------------------------------------------------------------------
GCs: 0 full, 0 partial
** VM stopped: exit code = -1 **
[/b]

The "_squawk_select" function is in io_native.c file. Apart from this, in line 482 of switch.c.spp there is the do_throw function of this case:

case OPC_THROW: iparmNone();
do_throw(); break;

that throws the exception (bytecodes.c.spp -> function do_throw()).

As you cans see, then VM says that RAM is not in range.

What's the issue?

Thanks.

qawsed123
Offline
Joined: 2009-10-21

Hi!

Something happens with my classpath (isn't it?). No test works and I have no idea why.

/squawk -suite:tests/HelloWorld/HelloWorld
[b]Error constructing Isolate based on suite: file://tests/HelloWorld/HelloWorld.suite and classpath: null
java.lang.Error: IO error while loading suite from 'file://tests/HelloWorld/HelloWorld.suite': java.io.IOException: Channel Exception: //tests/HelloWorld/HelloWorld.suite[/b]

Bye

eric_arseneau
Offline
Joined: 2004-07-15

What command did you use to create the suite?

Was there a a HelloWorld.suite in the tests/HelloWorld directory?

qawsed123
Offline
Joined: 2009-10-21

./d.sh jvmenv
./d.sh copyphoneme
./d.sh
./d.sh -prod -mac -O2 rom -metadata cldc imp
./squawk -suite:tests/HelloWorld/HelloWorld

And no... there isn't any HelloWorld.suite in the folder, but with the same squawk folder two days ago I passed the test :S (I used the same commands for create the suite... almost I think so).

Thanks.

eric_arseneau
Offline
Joined: 2004-07-15

Ok, so you never build the child suite that you identify with -suite:

The running of other projects really is not well done at moment with Squawk, I have an idea to work on fixing it, will see if I can get it done in next day or so.

But, Derek did add some commands to help here, that SHOULD work, I just dont know how to use them

d user-suite tests/HelloWorldMain

Or the one I added, do the following
d.sh -plugins:tests -prod -mac -O2 rom -metadata cldc imp HelloWorldMain

Which will build a squawk.suite with cldc, imp and HelloWorldMain, so that you can then do./squawk tests.HelloWorldMain

The magic sauce for the -plugins: option is to specify a file directly, or a directory that contains a file named builder.properties, or a directory that contains directories that contain a builder.properties files, which will add commands/targets to the builder.

Did not test either of these, but they should work. I recommend the last option.

qawsed123
Offline
Joined: 2009-10-21

I have some doubts about my cross-compiler and the -pliguin:option.

As this link says:

http://wiki.java.net/bin/view/Mobileandembedded/SquawkBuildOptions

[b]The build-options primarily affect the C compilation of the system, except for the first two listed. Here is a list of commonly used build-options:
[/b]

So, if my intention is compile with:

arm-1136jfs-linux-gnueabi-gcc

My intention was to put the cflag

-comp:arm1136jfs

And create a modfied java file inside compiler folder (squawk/builder/src/...and so on) called arm1136jfs. This file will contains my crosscompiler linker line, -l libraries, path and so on.

In the other post you said me that I shouldn't modigy the builder-commands.jar and that compile for my host platform with this toolchain should be able only modifying the build.properties file.

Looking the build properties options insede the build properties file of the proper squawk for Linux I don't see any option reference to cross compiler.

As a note mention below, I looked the squawk spot builder options and there, and is quite clear that there are more options. Are these options compatible in both build.propertires?

Can accept this line "gcc" build compiler and linker options (for example all these options of this link http://linuxreviews.org/man/gcc/ ) ?

[b]d.sh -plugins:tests -prod -mac -O2 rom -metadata cldc imp HelloWorldMain[/b]

Do I lost the Norh?

Thanks

qawsed123
Offline
Joined: 2009-10-21

nothing

Message was edited by: qawsed123

bardubitzki
Offline
Joined: 2003-11-02

I have a similar setup: Ubuntu 9.10 on a 64 bit machine, but use SUN's jdk.

However, setting JAVA_HOME to the top-level of the JDK didn't make any difference, same error message:

bardu@bardu-laptop:~/JavaME/squawk$ ./d.sh
Launcher: Found tools.jar in /usr/lib/jvm/jdk1.6.0_14/lib/tools.jar, by popping up a level from jre.
Builder.JDK: Looking for JDK in /usr/lib/jvm/jdk1.6.0_14, popped up a level from jre
Launcher: Found tools.jar in /usr/lib/jvm/jdk1.6.0_14/lib/tools.jar, by popping up a level from jre.
For vm2c tools.jar=/usr/lib/jvm/jdk1.6.0_14/lib/tools.jar
[building cldc...]
[building debugger...]
[building translator...]
[building hosted-support...]
[running squawk.jar...]
build failed: IO error during Process.exec(jar cf squawk.jar @hosted-support/squawk.jar.filelist)
caused by: java.io.IOException: Cannot run program "jar": java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:431)
at com.sun.squawk.builder.Build.exec(Build.java:2411)
at com.sun.squawk.builder.Build.exec(Build.java:2393)
at com.sun.squawk.builder.Build$6.run(Build.java:792)
at com.sun.squawk.builder.Build.run(Build.java:1021)
at com.sun.squawk.builder.Build.run(Build.java:1026)
at com.sun.squawk.builder.Build.run(Build.java:1002)
at com.sun.squawk.builder.Build.runCommand(Build.java:977)
at com.sun.squawk.builder.Build.mainProgrammatic(Build.java:1515)
at com.sun.squawk.builder.Build.main(Build.java:1479)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.squawk.builder.launcher.Launcher.main(Launcher.java:58)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
... 16 more

Any more ideas?

derek_white
Offline
Joined: 2006-09-08

I don't have an ubuntu handy, and at this hour my advice is not worth much, but is "jar" on your path at all? Can you execute jar from the same command line?

bardubitzki
Offline
Joined: 2003-11-02

You are right it is late, however I can execute jar.

bardubitzki
Offline
Joined: 2003-11-02

Forget my previous post.

If one uses the Sun JDK one needs to

[b]export PATH=$PATH:/usr/lib/jvm/jdk1.6.0_17/bin[/b]

or add it the end of the user home .bashrc.

However, now I'm running into the next exception:

Launcher: Found tools.jar in /usr/lib/jvm/jdk1.6.0_17/lib/tools.jar, by popping up a level from jre.
Builder.JDK: Looking for JDK in /usr/lib/jvm/jdk1.6.0_17, popped up a level from jre
Launcher: Found tools.jar in /usr/lib/jvm/jdk1.6.0_17/lib/tools.jar, by popping up a level from jre.
For vm2c tools.jar=/usr/lib/jvm/jdk1.6.0_17/lib/tools.jar
[building cldc...]
[building debugger...]
[building translator...]
[building hosted-support...]
[running squawk.jar...]
[building debugger-proxy...]
[building imp...]
[building javatest-device...]
[building mapper...]
[building romizer...]
[building ssl...]
[building vm2c...]
vm2c/preprocessed/com/sun/squawk/vm2c/InconvertibleNodeException.java:35: cannot find symbol
symbol : class Tree
location: class com.sun.squawk.vm2c.InconvertibleNodeException
public final Tree node;
^
vm2c/preprocessed/com/sun/squawk/vm2c/InconvertibleNodeException.java:36: cannot find symbol
symbol : class Tree
location: class com.sun.squawk.vm2c.InconvertibleNodeException
public InconvertibleNodeException(Tree node, String message) {
^
vm2c/preprocessed/com/sun/squawk/vm2c/AnnotationParser.java:28: cannot find symbol
.
.
.
100 errors
4 warnings
build failed: javamake compilation failed

Any ideas?

eric_arseneau
Offline
Joined: 2004-07-15

I just made a change to the source tree where there should no longer be a dependency on the version of the javac compiler you have. vm2c includes its own copy of it now. Actually, it had its own before, but it got removed, and now its back but for a different reason. Before it existed because we extended the compiler to pull "annotations" out of comments. We no longer do that, but we still need it. Reason is that there are different versions of the javac classes for Java 5, Java 6, Open JDK and the the other Java's.

Try doing a fresh pull and let me know if the problem goes away. The problems should show up in compiling the vm2c module.

qawsed123
Offline
Joined: 2009-10-21

I obtain the same errors with squawk-native. This time is not a question to change Tag() for getTag().

What is a fresh pull?

It comes for using openjdk6 over jdk6 ?

Thanks.

qawsed123
Offline
Joined: 2009-10-21

Hello,

Finally I've use a downgraded version of JDK; jdk5 v 21 and d.sh works without errors (I did it with jdk6 of sun before but showed the same errors).

Bye.

qawsed123
Offline
Joined: 2009-10-21

Hello,

I have new news. Steps:

- Modify Linux_X86.java for use the Arm1136Compiler class.
- Create a similar GccCompiler file called Arm1136Compiler.
-> inside replace "-m32" option for "" (ARM is only 32 bits and not support this flag).
-> replace "gcc" for "arm-1136jfs-linux-gnueabi-gcc"
- Just in case, in build.java I put a new case in intention to force with "-comp:cross-compiler_name" option the cross-compiler compilation.

After these, I do a ./bld.sh for do builder-commands.jar again and then try to build the squawk.

This is the result:

[b]./d.sh -prod -mac -o2 rom -metadata cldc imp[/b]
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
Platform: Linux-i386
[running rom...]
SUITEMETADATA:squawk.suite.suitemetadata
[running romize...]
Loaded suite stripping settings from squawk.library.properties
excluding: com.sun.squawk.compiler.*
excluding: com.sun.squawk.os.*
excluding: com.sun.squawk.BytecodeTracer
excluding: com.sun.squawk.CheneyCollector*
excluding: com.sun.squawk.Lisp2Collector*
excluding: com.sun.cldc.io.connections.HttpConnection
excluding: com.sun.squawk.ClassTunnel
[translating suite squawk [closed: false, parent: null] ...]
### Excluding compile: com.sun.squawk.Method::getParameterTypes
### Excluding compile: com.sun.squawk.SymbolParser::getSignatureTypeAt
[Including resource: META-INF/MANIFEST.MF]
[Including resource: META-INF/MANIFEST.MF]
### Excluding compile: com.sun.squawk.SymbolParser::stripMethods
/home/victor/pfc_eclipse/squawk/vmcore/src/vm/rom.h is already up to date
Romizer processed 444 classes and generated these files:
/home/victor/pfc_eclipse/squawk/squawk.sym
/home/victor/pfc_eclipse/squawk/squawk.suite
/home/victor/pfc_eclipse/squawk/squawk.suite.metadata
/home/victor/pfc_eclipse/squawk/squawk_classes.jar
/home/victor/pfc_eclipse/squawk/squawk_java5.jar
/home/victor/pfc_eclipse/squawk/squawk.suite.api
[b]/tmp/sizeofpointer607651746273772864: /tmp/sizeofpointer607651746273772864:cannot execute the binary file [/b]
[preprocessing with forced JAVA5SYNTAX for vm2c]
[running runvm2c...]
[compiling floating point sources in vmcore/src/vm/fp ...]
[compiling native verification sources in vmcore/src/vm/util ...]
[compiling 'vmcore/src/vm/squawk.c' ...]
[b]vmcore/src/vm/squawk.c:36:16: error: os.c: No such file or directory [/b]
vmcore/src/vm/squawk.c:177: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'MAX_UJLONG'
In file included from vmcore/src/vm/squawk.c:195:
vmcore/src/vm/globals.h:69: error: expected specifier-qualifier-list before 'jclass'
vmcore/src/vm/globals.h:134: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
vmcore/src/vm/globals.h:142: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
vmcore/src/vm/globals.h: In function 'initializeGlobals':
vmcore/src/vm/globals.h:278: error: 'Globals' has no member named '_pendingMonitors'
In file included from vmcore/src/vm/squawk.c:222:
vmcore/src/vm/util.h: At top level:
vmcore/src/vm/util.h:256: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'slll'
vmcore/src/vm/util.h:257: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sral'
vmcore/src/vm/util.h:258: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'srll'
vmcore/src/vm/util.h:265: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'i2l'
vmcore/src/vm/util.h:266: error: expected ')' before 'l'
In file included from vmcore/src/vm/squawk.c:529:
vmcore/src/vm/bytecodes.c: In function 'getClassState':
vmcore/src/vm/bytecodes.c:91: error: 'Globals' has no member named '_cachedClassAccesses'
vmcore/src/vm/bytecodes.c:93: error: 'Globals' has no member named '_cachedClass'
vmcore/src/vm/bytecodes.c:94: error: 'Globals' has no member named '_cachedClassHits'
vmcore/src/vm/bytecodes.c:95: error: 'Globals' has no member named '_cachedClassState'
vmcore/src/vm/bytecodes.c: In function 'invalidateClassStateCache':
vmcore/src/vm/bytecodes.c:127: error: 'Globals' has no member named '_cachedClass'
vmcore/src/vm/bytecodes.c:128: error: 'Globals' has no member named '_cachedClass'
In file included from vmcore/src/vm/cio.c:71,
from vmcore/src/vm/squawk.c:547:
vmcore/src/vm/io.c: In function 'jni_assume':
vmcore/src/vm/io.c:52: error: 'JNI_env' undeclared (first use in this function)
vmcore/src/vm/io.c:52: error: (Each undeclared identifier is reported only once
vmcore/src/vm/io.c:52: error: for each function it appears in.)
vmcore/src/vm/io.c: In function 'jni_check':
vmcore/src/vm/io.c:67: error: 'JNI_env' undeclared (first use in this function)
vmcore/src/vm/io.c: In function 'createJVMString':
vmcore/src/vm/io.c:83: error: 'JNI_env' undeclared (first use in this function)
vmcore/src/vm/io.c: In function 'createJVMByteArray':
vmcore/src/vm/io.c:110: error: 'JNI_env' undeclared (first use in this function)
vmcore/src/vm/io.c: In function 'createJVMCharArray':
vmcore/src/vm/io.c:129: error: 'JNI_env' undeclared (first use in this function)
vmcore/src/vm/io.c: In function 'createJVMIntArray':
vmcore/src/vm/io.c:148: error: 'JNI_env' undeclared (first use in this function)
vmcore/src/vm/io.c: In function 'updateFromJVMByteArray':
vmcore/src/vm/io.c:196: error: 'JNI_env' undeclared (first use in this function)
vmcore/src/vm/io.c: In function 'CIO_initialize':
vmcore/src/vm/io.c:226: error: 'JNI_env' undeclared (first use in this function)
vmcore/src/vm/io.c:268: error: 'jvm' undeclared (first use in this function)
vmcore/src/vm/io.c:272: error: 'Globals' has no member named '_channelIO_clazz'
vmcore/src/vm/io.c:273: error: 'Globals' has no member named '_channelIO_clazz'
vmcore/src/vm/io.c:275: error: 'Globals' has no member named '_channelIO_execute'
vmcore/src/vm/io.c:275: error: 'Globals' has no member named '_channelIO_clazz'
vmcore/src/vm/io.c:276: error: 'Globals' has no member named '_channelIO_execute'
vmcore/src/vm/io.c: In function 'ioExecute':
vmcore/src/vm/io.c:339: error: 'JNI_env' undeclared (first use in this function)
vmcore/src/vm/io.c:345: error: 'Globals' has no member named '_channelIO_clazz'
vmcore/src/vm/io.c:345: error: 'Globals' has no member named '_channelIO_execute'
vmcore/src/vm/squawk.c: In function 'printCacheStats':
vmcore/src/vm/squawk.c:722: error: 'Globals' has no member named '_cachedClassAccesses'
vmcore/src/vm/squawk.c:723: error: 'Globals' has no member named '_pendingMonitorAccesses'
vmcore/src/vm/squawk.c:725: error: 'Globals' has no member named '_pendingMonitorAccesses'
vmcore/src/vm/squawk.c:730: error: 'Globals' has no member named '_cachedClassHits'
vmcore/src/vm/squawk.c:730: error: 'Globals' has no member named '_cachedClassAccesses'
vmcore/src/vm/squawk.c:731: error: 'Globals' has no member named '_pendingMonitorHits'
vmcore/src/vm/squawk.c:731: error: 'Globals' has no member named '_pendingMonitorAccesses'
vmcore/src/vm/squawk.c:736: error: 'Globals' has no member named '_cachedClassHits'
vmcore/src/vm/squawk.c:736: error: 'Globals' has no member named '_cachedClassAccesses'
vmcore/src/vm/squawk.c:737: error: 'Globals' has no member named '_pendingMonitorHits'
vmcore/src/vm/squawk.c:737: error: 'Globals' has no member named '_pendingMonitorAccesses'
vmcore/src/vm/squawk.c: In function 'processArgs':
vmcore/src/vm/squawk.c:1234: error: 'Globals' has no member named '_notrap'
vmcore/src/vm/squawk.c:1291: error: 'Globals' has no member named '_notrap'
In file included from vmcore/src/vm/squawk.c:1531:
vmcore/src/vm/switch.c: In function 'Squawk_continue':
vmcore/src/vm/switch.c:470: error: 'Globals' has no member named '_pendingMonitorStackPointer'
vmcore/src/vm/switch.c:470: error: 'Globals' has no member named '_pendingMonitors'
vmcore/src/vm/switch.c:470: error: 'Globals' has no member named '_pendingMonitorStackPointer'
vmcore/src/vm/switch.c:472: error: 'Globals' has no member named '_pendingMonitorAccesses'
vmcore/src/vm/switch.c:472: error: 'Globals' has no member named '_pendingMonitorStackPointer'
vmcore/src/vm/switch.c:472: error: 'Globals' has no member named '_pendingMonitors'
vmcore/src/vm/switch.c:472: error: 'Globals' has no member named '_pendingMonitorStackPointer'
vmcore/src/vm/switch.c:472: error: 'Globals' has no member named '_pendingMonitors'
vmcore/src/vm/switch.c:472: error: 'Globals' has no member named '_pendingMonitorStackPointer'
vmcore/src/vm/switch.c:472: error: 'Globals' has no member named '_pendingMonitorHits'
vmcore/src/vm/switch.c:474: error: 'Globals' has no member named '_pendingMonitorStackPointer'
vmcore/src/vm/switch.c:474: error: 'Globals' has no member named '_pendingMonitors'
vmcore/src/vm/switch.c:474: error: 'Globals' has no member named '_pendingMonitorStackPointer'
vmcore/src/vm/switch.c:476: error: 'Globals' has no member named '_pendingMonitorAccesses'
vmcore/src/vm/switch.c:476: error: 'Globals' has no member named '_pendingMonitorStackPointer'
vmcore/src/vm/switch.c:476: error: 'Globals' has no member named '_pendingMonitors'
vmcore/src/vm/switch.c:476: error: 'Globals' has no member named '_pendingMonitorStackPointer'
vmcore/src/vm/switch.c:476: error: 'Globals' has no member named '_pendingMonitors'
vmcore/src/vm/switch.c:476: error: 'Globals' has no member named '_pendingMonitorStackPointer'
vmcore/src/vm/switch.c:476: error: 'Globals' has no member named '_pendingMonitorHits'
vmcore/src/vm/squawk.c:1541: error: 'Globals' has no member named '_cachedClass'
vmcore/src/vm/squawk.c:1541: error: 'Globals' has no member named '_cachedClass'
vmcore/src/vm/squawk.c:1541: error: 'Globals' has no member named '_cachedClassState'
vmcore/src/vm/squawk.c:1541: error: 'Globals' has no member named '_cachedClassState'
vmcore/src/vm/squawk.c:1541: error: 'Globals' has no member named '_cachedClass'
vmcore/src/vm/squawk.c:1541: error: 'Globals' has no member named '_cachedClassState'
vmcore/src/vm/squawk.c:1541: error: 'Globals' has no member named '_pendingMonitorStackPointer'
vmcore/src/vm/squawk.c:1541: error: 'Globals' has no member named '_pendingMonitors'
vmcore/src/vm/squawk.c:1541: error: 'Globals' has no member named '_pendingMonitorStackPointer'
vmcore/src/vm/squawk.c:1541: error: 'Globals' has no member named '_pendingMonitors'
vmcore/src/vm/squawk.c:1541: error: 'Globals' has no member named '_pendingMonitorStackPointer'
vmcore/src/vm/squawk.c:1541: error: 'Globals' has no member named '_pendingMonitorStackPointer'
vmcore/src/vm/squawk.c:1541: error: 'Globals' has no member named '_pendingMonitors'
build failed: Process.exec(arm-1136jfs-linux-gnueabi-gcc -c -O2 -DMACROIZE -DNATIVE_VERIFICATION=true -ffunction-sections -fdata-sections -D_GNU_SOURCE -DSQUAWK_64=false -ffloat-store -DPLATFORM_BIG_ENDIAN=false -DPLATFORM_UNALIGNED_LOADS=true -DWRITE_BARRIER -DLISP2_BITMAP -I/usr/lib/jvm/java-1.6.0-openjdk-1.6.0/include -I/usr/lib/jvm/java-1.6.0-openjdk-1.6.0/include/linux -Ivmcore/src/vm/fp -Ivmcore/src/rts/arm-1136jfs-linux-gnueabi-gcc -I/opt/OSELAS.Toolchain-1.99.3/arm-1136jfs-linux-gnueabi/gcc-4.3.2-glibc-2.8-binutils-2.19-kernel-2.6.27-sanitized/bin -o vmcore/build/squawk.o vmcore/src/vm/squawk.c) returned 1

In fact, last line contains this:

[b]-Ivmcore/src/rts/arm-1136jfs-linux-gnueabi-gcc[/b]

And obviously no folder exists in that path... And I think that's the reason of the error, because there isn't any os.c specific to my cross compiler.

Any idea?

Thanks

Message was edited by: qawsed123

qawsed123
Offline
Joined: 2009-10-21

mmm... one solution will be create the folder and put inside the gcc files:
- os.c
- os_devices.c
- os_devices.h

I already try with this option and those errors don't exist , but I don't know if it's correct.

./d.sh -prod -mac -o2 rom -metadata cldc imp
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
Platform: Linux-i386
[running rom...]
SUITEMETADATA:squawk.suite.suitemetadata
[running romize...]
Loaded suite stripping settings from squawk.library.properties
excluding: com.sun.squawk.compiler.*
excluding: com.sun.squawk.os.*
excluding: com.sun.squawk.BytecodeTracer
excluding: com.sun.squawk.CheneyCollector*
excluding: com.sun.squawk.Lisp2Collector*
excluding: com.sun.cldc.io.connections.HttpConnection
excluding: com.sun.squawk.ClassTunnel
[translating suite squawk [closed: false, parent: null] ...]
### Excluding compile: com.sun.squawk.Method::getParameterTypes
### Excluding compile: com.sun.squawk.SymbolParser::getSignatureTypeAt
[Including resource: META-INF/MANIFEST.MF]
[Including resource: META-INF/MANIFEST.MF]
### Excluding compile: com.sun.squawk.SymbolParser::stripMethods
/home/victor/pfc_eclipse/squawk/vmcore/src/vm/rom.h is already up to date
Romizer processed 444 classes and generated these files:
/home/victor/pfc_eclipse/squawk/squawk.sym
/home/victor/pfc_eclipse/squawk/squawk.suite
/home/victor/pfc_eclipse/squawk/squawk.suite.metadata
/home/victor/pfc_eclipse/squawk/squawk_classes.jar
/home/victor/pfc_eclipse/squawk/squawk_java5.jar
/home/victor/pfc_eclipse/squawk/squawk.suite.api
/tmp/sizeofpointer6971300685494728577: /tmp/sizeofpointer6971300685494728577: no se puede ejecutar el fichero binario
[preprocessing with forced JAVA5SYNTAX for vm2c]
[running runvm2c...]
[compiling floating point sources in vmcore/src/vm/fp ...]
[compiling native verification sources in vmcore/src/vm/util ...]
[compiling 'vmcore/src/vm/squawk.c' ...]
[linking 'squawk' ...]
/opt/OSELAS.Toolchain-1.99.3/arm-1136jfs-linux-gnueabi/gcc-4.3.2-glibc-2.8-binutils-2.19-kernel-2.6.27-sanitized/lib/gcc/arm-1136jfs-linux-gnueabi/4.3.2/../../../../arm-1136jfs-linux-gnueabi/bin/ld: skipping incompatible /usr/lib/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/i386/server/libjvm.so when searching for -ljvm
/opt/OSELAS.Toolchain-1.99.3/arm-1136jfs-linux-gnueabi/gcc-4.3.2-glibc-2.8-binutils-2.19-kernel-2.6.27-sanitized/lib/gcc/arm-1136jfs-linux-gnueabi/4.3.2/../../../../arm-1136jfs-linux-gnueabi/bin/ld: cannot find -ljvm
collect2: ld returned 1 exit status
build failed: Process.exec(arm-1136jfs-linux-gnueabi-gcc --gc-sections -o squawk vmcore/build/k_tan.o vmcore/build/s_fabs.o vmcore/build/s_floor.o vmcore/build/k_cos.o vmcore/build/k_rem_pio2.o vmcore/build/w_sqrt.o vmcore/build/s_scalbn.o vmcore/build/e_sqrt.o vmcore/build/s_cos.o vmcore/build/s_tan.o vmcore/build/s_sin.o vmcore/build/s_copysign.o vmcore/build/k_sin.o vmcore/build/s_ceil.o vmcore/build/e_rem_pio2.o vmcore/build/fp_bytecodes.o vmcore/build/sha.o vmcore/build/squawk.o -ldl -lm -L/usr/lib/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/i386/server -L/usr/lib/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/i386 -ljvm) returned 1

Bye!

qawsed123
Offline
Joined: 2009-10-21

What happens with libjvm.so and ARM (arm cross compiler or simply arm architecture) ?
I'm "goggling" a lot and lots of people have similar problems (Some people with x86 vs x86_64 when try to build some applications. Others with proper gcc but resolving it with -mcpu, -march options). But in my case, with an arm cross compiler I don't know how progress.

Thanks for read me, seriously.

eric_arseneau
Offline
Joined: 2004-07-15

So how far did you get, I got confused somewhere along the way.

If you are getting a libjvm.so request on your target, not desktop, then I can only assume something is wrong.

You will need to add a new compiler/target option for your new board/environment. Not sure how to do that myself at the moment.

qawsed123
Offline
Joined: 2009-10-21

That message appeared in the Linux i386 shell (host shell). My intention is create the suite with cross compiler toolchains and then run the squawk.suite and pass tests in the target platform.

Yesterday I download an ARM compatible libjvm.so and put in the openjdk-1.6 folder, then copy the path and put it in the cross-compiler line linker. Nothing crash or fail... Squawk builds "correctly" (in appearance) but until next week I won't be able to pass the squaw.suite into the target platform (arm-linux).

In the other hand I'm trying to do this without modify any java code. I create a builder.override file with new builder commands. When the shell do the builder it detects the file (for example):

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Using build override file: build.override <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

but nothing special occurs. If I would add builder options for my target platform and toolchain (like propertires.template of squawk for sunspot, isn't it?) in a build.override file what type of options accept the squawk?

Are correct?

GNU_TOOLCHAIN_BIN_PATH
GNU_TOOLCHAIN_LIB_PATH
GNU_TOOLCHAIN_GCC_LIB_PATH
GNU_TOOLCHAIN_INCLUDE_PATH

ARM_ELF_GCC
ARM_ELF_LD
ARM_ELF_AS
ARM_ELD_OBJCOPY

and so on (these are some options of the properties.template of the spot squawk)

Thanks!

qawsed123
Offline
Joined: 2009-10-21

Oh, I'm sorry! This is my build squawk:

victor@linux-2vjb:~/pfc_eclipse/squawk> ./build.sh
------------------------------------
./D.SH JVMENV
------------------------------------
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
Platform: Linux-i386
[running jvmenv...]

To configure the environment for Squawk, try the following command under bash:

export LD_LIBRARY_PATH=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/i386/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/i386:$LD_LIBRARY_PATH

or in csh/tcsh

setenv LD_LIBRARY_PATH /usr/lib/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/i386/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/i386:$LD_LIBRARY_PATH

Total time: 0s
------------------------------------
./D.SH COPYPHONEME
------------------------------------
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
Platform: Linux-i386
[running copyphoneme...]
Total time: 0s
------------------------------------
./D.SH
------------------------------------
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
Platform: Linux-i386
[running copyphoneme...]
[building cldc...]
[building debugger...]
[building translator...]
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
[building hosted-support...]
Note: ./hosted-support/preprocessed/com/sun/squawk/vm/GUIOutputChannel.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
[running squawk.jar...]
[building debugger-proxy...]
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
[building imp...]
[building javatest-device...]
[building mapper...]
[building romizer...]
[building ssl...]
[building vm2c...]
./vm2c/preprocessed/com/sun/squawk/vm2c/Main.java:30: warning: sun.misc.URLClassPath is Sun proprietary API and may be removed in a future release
import sun.misc.URLClassPath;
^
./vm2c/preprocessed/com/sun/squawk/vm2c/Main.java:156: warning: sun.misc.URLClassPath is Sun proprietary API and may be removed in a future release
URLClassPath sourcePath = new URLClassPath(URLClassPath.pathToURLs(sourcePathArg));
^
./vm2c/preprocessed/com/sun/squawk/vm2c/Main.java:156: warning: sun.misc.URLClassPath is Sun proprietary API and may be removed in a future release
URLClassPath sourcePath = new URLClassPath(URLClassPath.pathToURLs(sourcePathArg));
^
./vm2c/preprocessed/com/sun/squawk/vm2c/Main.java:156: warning: sun.misc.URLClassPath is Sun proprietary API and may be removed in a future release
URLClassPath sourcePath = new URLClassPath(URLClassPath.pathToURLs(sourcePathArg));
^
4 warnings
Total time: 9s
------------------------------------
./D.SH -PROD -MAC -o2 ROM CLDC
------------------------------------
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
Platform: Linux-i386
[running rom...]
[running romize...]
Loaded suite stripping settings from squawk.library.properties
excluding: com.sun.squawk.compiler.*
excluding: com.sun.squawk.os.*
excluding: com.sun.squawk.BytecodeTracer
excluding: com.sun.squawk.CheneyCollector*
excluding: com.sun.squawk.Lisp2Collector*
excluding: com.sun.cldc.io.connections.HttpConnection
excluding: com.sun.squawk.ClassTunnel
[translating suite squawk [closed: false, parent: null] ...]
### Excluding compile: com.sun.squawk.Method::getParameterTypes
### Excluding compile: com.sun.squawk.SymbolParser::getSignatureTypeAt
[Including resource: META-INF/MANIFEST.MF]
### Excluding compile: com.sun.squawk.SymbolParser::stripMethods
/home/victor/pfc_eclipse/squawk/vmcore/src/vm/rom.h is already up to date
Romizer processed 384 classes and generated these files:
/home/victor/pfc_eclipse/squawk/squawk.sym
/home/victor/pfc_eclipse/squawk/squawk.suite
/home/victor/pfc_eclipse/squawk/squawk_classes.jar
/home/victor/pfc_eclipse/squawk/squawk_java5.jar
/home/victor/pfc_eclipse/squawk/squawk.suite.api
[preprocessing with forced JAVA5SYNTAX for vm2c]
[running runvm2c...]
[compiling floating point sources in vmcore/src/vm/fp ...]
[compiling native verification sources in vmcore/src/vm/util ...]
[compiling 'vmcore/src/vm/squawk.c' ...]
[linking 'squawk' ...]
[running squawk.jar...]
Total time: 22s
------------------------------------
./D.SH COM.SUN.SQUAWK.TEST
------------------------------------
Running: com.sun.squawk.Test
x39 count = 1
x40 recursion level = 114664
x42 printStackTrace - this should be a java.lang.NullPointerException
java.lang.NullPointerException
at java.lang.Throwable.(bci=16)
at java.lang.Exception.(bci=5)
at java.lang.RuntimeException.(bci=5)
at java.lang.NullPointerException.(bci=5)
in static method #11 of com.sun.squawk.VM(bci=6)
at com.sun.squawk.Test$FOO.toString(bci=5)
at com.sun.squawk.Test$FOO$1.run(bci=21)
in virtual method #10 of com.sun.squawk.Test$FOO(bci=15)
in static method #44 of com.sun.squawk.Test(bci=25)
at com.sun.squawk.Test.runXTests(bci=121)
at com.sun.squawk.Test.main(bci=59)
in virtual method #95 of com.sun.squawk.Klass(bci=32)
at com.sun.squawk.Isolate.run(bci=414)
at java.lang.Thread.run(bci=17)
in virtual method #47 of com.sun.squawk.VMThread(bci=42)
in static method #3 of com.sun.squawk.VM(bci=6)
Date: Fri Mar 12 09:43:37 PST 2010
Empty loop timings per 16000000 = 1054ms
Empty loop timings(2) per 16000000 = 1028ms
Empty simple call per 1000000 = 80ms
Empty long call per 1000000 = 87ms
Empty exception calls per 1000000 = 103ms
random time test (9663597 empty loop iterations)... 812ms
Finished tests

--------------------------------------------------------------------
Hits - Class:99.99% Monitor:98.10% Exit:100.00% New:91.78%
GCs: 15 full, 16 partial
** VM stopped: exit code = 12345 **

Is everything correct? I did a script with some echos for do easy the comprenhension.

Thanks.

qawsed123
Offline
Joined: 2009-10-21

Well, doing the Helloworld test I have had the metadata error:
[b]
/d.sh user-suite tests/HelloWorld
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
Platform: Linux-i386
[running user-suite...]
[compiling user project at tests/HelloWorld...]
linking user project at tests/HelloWorld
filePathelements=pathelement=/home/victor/squawk;pathelement=/home/victor/squawk/tests/HelloWorld
build failed: error invoking public static void com.sun.squawk.Romizer.main(java.lang.String[]) throws java.io.IOException
caused by: java.lang.RuntimeException: com.sun.squawk.util.UnexpectedException: Unable to find metadata suite: file://squawk.suite.metadata:class javax.microedition.io.ConnectionNotFoundException://squawk.suite.metadata;pathelement=/home/victor/squawk;pathelement=/home/victor/squawk/tests/HelloWorld
at com.sun.squawk.Romizer.run(Romizer.java:433)
at com.sun.squawk.Romizer.main(Romizer.java:343)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.sun.squawk.builder.Build.java(Build.java:2557)
at com.sun.squawk.builder.JavaCommand.run(JavaCommand.java:71)
at com.sun.squawk.builder.Build$11.run(Build.java:984)
at com.sun.squawk.builder.Build.run(Build.java:1090)
at com.sun.squawk.builder.Build.runCommand(Build.java:1055)
at com.sun.squawk.builder.Build.mainProgrammatic(Build.java:1632)
at com.sun.squawk.builder.Build.main(Build.java:1589)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.sun.squawk.builder.launcher.Launcher.main(Launcher.java:74)
Caused by: com.sun.squawk.util.UnexpectedException: Unable to find metadata suite: file://squawk.suite.metadata:class javax.microedition.io.ConnectionNotFoundException://squawk.suite.metadata;pathelement=/home/victor/squawk;pathelement=/home/victor/squawk/tests/HelloWorld
at com.sun.squawk.ObjectGraphLoader.loadSuite(ObjectGraphLoader.java:313)
at com.sun.squawk.Romizer.processSuiteArgs(Romizer.java:546)
at com.sun.squawk.Romizer.run(Romizer.java:377)
... 17 more [/b]

So, like a post said, I put these commands:

./d.sh -prod -mac -O2 rom -metadata cldc

And run the test. Now the shell shows this:

[b]
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
Platform: Linux-i386
[running user-suite...]
[compiling user project at tests/HelloWorld...]
linking user project at tests/HelloWorld
[translating suite tests/HelloWorld/HelloWorld [closed: false, parent: squawk] ...]
Translator properties and current values:
translator.help=false
translator.optimizeConstantObjects=true
translator.deadMethodElimination=true
translator.deleteUnusedPrivateConstructors=true
translator.stats=false
translator.verbose=true
translator.deadStringElimination=true
translator.deadClassElimination=true
[Translator: computing closure...IO error while loading: class javax.microedition.midlet.MIDlet
javax.microedition.io.ConnectionNotFoundException: javax/microedition/midlet/MIDlet.class
at com.sun.squawk.io.j2me.classpath.Protocol.openInputStream(Protocol.java:162)
at com.sun.squawk.translator.ci.ClassFileLoader.load(ClassFileLoader.java:139)
at com.sun.squawk.translator.Translator$1.run(Translator.java:684)
at com.sun.squawk.util.ComputationTimer.execute(ComputationTimer.java:125)
at com.sun.squawk.util.ComputationTimer.time(ComputationTimer.java:159)
at com.sun.squawk.translator.Translator.load(Translator.java:682)
at com.sun.squawk.translator.Translator.load(Translator.java:356)
at com.sun.squawk.translator.ci.ConstantPool.getResolvedClass(ConstantPool.java:788)
at com.sun.squawk.translator.ci.ClassFileLoader.loadClassInfo(ClassFileLoader.java:377)
at com.sun.squawk.translator.ci.ClassFileLoader.load(ClassFileLoader.java:205)
at com.sun.squawk.translator.ci.ClassFileLoader.load(ClassFileLoader.java:140)
at com.sun.squawk.translator.Translator$1.run(Translator.java:684)
at com.sun.squawk.util.ComputationTimer.execute(ComputationTimer.java:125)
at com.sun.squawk.util.ComputationTimer.time(ComputationTimer.java:159)
at com.sun.squawk.translator.Translator.load(Translator.java:682)
at com.sun.squawk.translator.Translator.load(Translator.java:356)
at com.sun.squawk.translator.Translator.computeClosure(Translator.java:701)
at com.sun.squawk.translator.Translator.close(Translator.java:428)
at com.sun.squawk.Romizer.translate(Romizer.java:725)
at com.sun.squawk.Romizer.access$000(Romizer.java:44)
at com.sun.squawk.Romizer$1.run(Romizer.java:385)
at com.sun.squawk.util.ComputationTimer.execute(ComputationTimer.java:127)
at com.sun.squawk.util.ComputationTimer.time(ComputationTimer.java:177)
at com.sun.squawk.Romizer.run(Romizer.java:383)
at com.sun.squawk.Romizer.main(Romizer.java:343)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.sun.squawk.builder.Build.java(Build.java:2557)
at com.sun.squawk.builder.JavaCommand.run(JavaCommand.java:71)
at com.sun.squawk.builder.Build$11.run(Build.java:984)
at com.sun.squawk.builder.Build.run(Build.java:1090)
at com.sun.squawk.builder.Build.runCommand(Build.java:1055)
at com.sun.squawk.builder.Build.mainProgrammatic(Build.java:1632)
at com.sun.squawk.builder.Build.main(Build.java:1589)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.sun.squawk.builder.launcher.Launcher.main(Launcher.java:74)
NoClassDefFoundError: javax.microedition.midlet.MIDlet
message: javax.microedition.midlet.MIDlet: javax.microedition.io.ConnectionNotFoundException: javax/microedition/midlet/MIDlet.class
possibly in class: javax.microedition.midlet.MIDlet
build failed: error invoking public static void com.sun.squawk.Romizer.main(java.lang.String[]) throws java.io.IOException
caused by: java.lang.NoClassDefFoundError: javax.microedition.midlet.MIDlet: javax.microedition.io.ConnectionNotFoundException: javax/microedition/midlet/MIDlet.class
at com.sun.squawk.translator.ci.ClassFileLoader.load(ClassFileLoader.java:146)
at com.sun.squawk.translator.Translator$1.run(Translator.java:684)
at com.sun.squawk.util.ComputationTimer.execute(ComputationTimer.java:125)
at com.sun.squawk.util.ComputationTimer.time(ComputationTimer.java:159)
at com.sun.squawk.translator.Translator.load(Translator.java:682)
at com.sun.squawk.translator.Translator.load(Translator.java:356)
at com.sun.squawk.translator.ci.ConstantPool.getResolvedClass(ConstantPool.java:788)
at com.sun.squawk.translator.ci.ClassFileLoader.loadClassInfo(ClassFileLoader.java:377)
at com.sun.squawk.translator.ci.ClassFileLoader.load(ClassFileLoader.java:205)
at com.sun.squawk.translator.ci.ClassFileLoader.load(ClassFileLoader.java:140)
at com.sun.squawk.translator.Translator$1.run(Translator.java:684)
at com.sun.squawk.util.ComputationTimer.execute(ComputationTimer.java:125)
at com.sun.squawk.util.ComputationTimer.time(ComputationTimer.java:159)
at com.sun.squawk.translator.Translator.load(Translator.java:682)
at com.sun.squawk.translator.Translator.load(Translator.java:356)
at com.sun.squawk.translator.Translator.computeClosure(Translator.java:701)
at com.sun.squawk.translator.Translator.close(Translator.java:428)
at com.sun.squawk.Romizer.translate(Romizer.java:725)
at com.sun.squawk.Romizer.access$000(Romizer.java:44)
at com.sun.squawk.Romizer$1.run(Romizer.java:385)
at com.sun.squawk.util.ComputationTimer.execute(ComputationTimer.java:127)
at com.sun.squawk.util.ComputationTimer.time(ComputationTimer.java:177)
at com.sun.squawk.Romizer.run(Romizer.java:383)
at com.sun.squawk.Romizer.main(Romizer.java:343)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.sun.squawk.builder.Build.java(Build.java:2557)
at com.sun.squawk.builder.JavaCommand.run(JavaCommand.java:71)
at com.sun.squawk.builder.Build$11.run(Build.java:984)
at com.sun.squawk.builder.Build.run(Build.java:1090)
at com.sun.squawk.builder.Build.runCommand(Build.java:1055)
at com.sun.squawk.builder.Build.mainProgrammatic(Build.java:1632)
at com.sun.squawk.builder.Build.main(Build.java:1589)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.sun.squawk.builder.launcher.Launcher.main(Launcher.java:74)[/b]

I'm trying to build and run the squawk in a proper Linux (opensuse 11.2).

Thanks in advance.

derek_white
Offline
Joined: 2006-09-08

The MIDlet support is in the "imp" directory, so you need to also build with it:

./d.sh -prod -mac -O2 rom -metadata cldc imp

If you just wanted to run classes with a "main" method you can exclude imp, but it's not an "official" Java ME without a configuration + profile (cldc + imp).

qawsed123
Offline
Joined: 2009-10-21

Thanks derek_white!

I think it works. I run a test midlet:

./squawk -suite:tests/HelloWorld/HelloWorld
[b]
Hello world (from a MIDlet)

--------------------------------------------------------------------
Hits - Class:91.25% Monitor:68.54% Exit:100.00% New:94.23%
GCs: 1 full, 0 partial
** VM stopped: exit code = 0 **[/b]

Isn't it?

Thanks.

derek_white
Offline
Joined: 2006-09-08

Looks great!

qawsed123
Offline
Joined: 2009-10-21

Good! Please, Can you help me or put a stuff references, links, and so on for my other post?

Thanks in advance.

qawsed123
Offline
Joined: 2009-10-21

fail!

Message was edited by: qawsed123

qawsed123
Offline
Joined: 2009-10-21

autoreply...

Now step 3 doesn't work:
[b]
./d.sh[/b]

[b]CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
[running copyphoneme...]
[building cldc...]
[building debugger...]
[building translator...]
[building hosted-support...]
[running squawk.jar...]
build failed: IO error during Process.exec(jar cf squawk.jar @hosted-support/squawk.jar.filelist)
caused by: java.io.IOException: Cannot run program "jar": java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:431)
at com.sun.squawk.builder.Build.exec(Build.java:2619)
at com.sun.squawk.builder.Build.exec(Build.java:2601)
at com.sun.squawk.builder.Build$7.run(Build.java:876)
at com.sun.squawk.builder.Build.run(Build.java:1112)
at com.sun.squawk.builder.Build.run(Build.java:1117)
at com.sun.squawk.builder.Build.run(Build.java:1093)
at com.sun.squawk.builder.Build.runCommand(Build.java:1068)
at com.sun.squawk.builder.Build.mainProgrammatic(Build.java:1648)
at com.sun.squawk.builder.Build.main(Build.java:1605)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.squawk.builder.launcher.Launcher.main(Launcher.java:74)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
... 16 more[/b]

In d.sh I put the route of the jdk1.6.0_17 that's in my user's home.
[b]
JAVA_HOME=/home/victor/jdk1.6.0_17/jre/bin/java[/b]

In console I use this command:
[b]
export $JAVA_HOME=/home/victor/jdk1.6.0_17/jre/[/b]

Also:

[b]export LD_LIBRARY_PATH=/home/victor/jdk1.6.0_17/jre/lib/i386/client:/home/victor/jdk1.6.0_17/jre/lib/i386:$LD_LIBRARY_PATH[/b]

thanks

Message was edited by: qawsed123

derek_white
Offline
Joined: 2006-09-08

Try setting JAVA_HOME to the top-level of your JDK (don't go into jre dir):

export $JAVA_HOME=/home/victor/jdk1.6.0_17

If you peek inside the JDK, you'll see that there's bin/jar, but not jre/bin/jar.

eg:

=>find /usr/jdk/instances/jdk1.6.0/ -name "java"
/usr/jdk/instances/jdk1.6.0/bin/amd64/java
/usr/jdk/instances/jdk1.6.0/bin/java
/usr/jdk/instances/jdk1.6.0/jre/bin/java
/usr/jdk/instances/jdk1.6.0/jre/bin/amd64/java

=>find /usr/jdk/instances/jdk1.6.0/ -name "jar"
/usr/jdk/instances/jdk1.6.0/bin/jar
/usr/jdk/instances/jdk1.6.0/bin/amd64/jar