Skip to main content

CLDC ARM build error

9 replies [Last post]
digidealer
Offline
Joined: 2004-03-24
Points: 0

Hello fellow phoneMe-ers,

I'm building CLDC for ARM target using GCC 4.2.2 toolchain and getting the following build error (see below). Can anyone shed some light on this error for me please?

Thanks,

- digi

../../loopgen/app/loopgen -generate +GenerateDebugAssembly +GenerateGNUCode
Generating debug assembly code: ... Interpreter_arm.s

#
# VM Error, assertion failure
#
# Error ID: /phoneme/src/feature-mr2-rel-b23/cldc/src/vm/cpu/arm/TemplateTable_arm.cpp, 351
#
# assert(lsw(l) == 0 || msw(l) == 0, "small floating point number")
#
make[1]: *** [Interpreter_arm.s] Trace/breakpoint trap
make[1]: *** Deleting file `Interpreter_arm.s'
make[1]: Leaving directory `/phoneme/src/feature-mr2-rel-b23/build/cldc/linux_arm/target/debug'
make: *** [_debug] Error 2

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
skyslee2005
Offline
Joined: 2008-08-12
Points: 0

a another problem is occur!!
when i build midp i get this error:

... building SkinRomizationTool
... /home/lee/MB3/outputfb/midp/bin/arm/SkinRomizationTool.jar
... romizing skin
/home/lee/MB3/midp/build/linux_fb_gcc/../../src/highlevelui/lcdlf/lfjava/resource/skin/screen.image_wash.png
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/j2sdk1.4.2_18/jre/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1437)
at java.awt.Toolkit.(Toolkit.java:1458)
at java.awt.Rectangle.(Rectangle.java:93)
at javax.imageio.ImageReader.getSourceRegion(ImageReader.java:2504)
at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1315)
at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1579)
at javax.imageio.ImageIO.read(ImageIO.java:1384)
at javax.imageio.ImageIO.read(ImageIO.java:1270)
at com.sun.midp.skinromization.SkinRomizer.romizeImage(SkinRomizationTool.java:1652)
at com.sun.midp.skinromization.SkinRomizer.romizeImages(SkinRomizationTool.java:1609)
at com.sun.midp.skinromization.SkinRomizer.romize(SkinRomizationTool.java:1366)
at com.sun.midp.skinromization.SkinRomizationTool.main(SkinRomizationTool.java:112)
make[2]: *** [/home/lee/MB3/outputfb/midp/classes.zip] 错误 1
make[2]: Leaving directory `/home/lee/MB3/midp/build/linux_fb_gcc'
make[1]: *** [build_classes] 错误 2

what is libXp.so.6, and how can i get it??

danila
Offline
Joined: 2006-09-25
Points: 0

Please check if the skin romizer is run in the headless mode.
The make rule for skin romizer is defined in the makefile
midp/src/highlevelui/lcdlf/lfjava/lib.gmk:

define romize_skin
@echo " ... romizing skin"
@$(INT_ROMIZE_SKIN) \
-xml $(SUBSYSTEM_CONFIGURATION_MERGED_FILE) \
-imagedir `$(call fixcygpath, $(SUBSYSTEM_LCDLF_SKIN_RESOURCES_DIR))` \
-outbin `$(call fixcygpath, $(SUBSYSTEM_LCDLF_GENERATED_SKIN_BIN_FILE))` \
-outc `$(call fixcygpath, $(GENERATED_DIR)/lfj_image_rom.c)`
endef

Remove the @ starting the second line and you will see the command line for skin romizer. It should contain -Djava.awt.headless=true flag.

skyslee2005
Offline
Joined: 2008-08-12
Points: 0

thanks for your reply!!
I have instilled libXp.so.6 for this issue(yum install libXp.so.6),and it is worked!!
Now I can see the start screen and menu,but i can't operate it because my board have not keyboard(there is only touch screen),i don't know how can i use touch screen!!!

anzero
Offline
Joined: 2007-10-10
Points: 0

Hello digidealer

You'd better use GCC 3.3.x toolchain.
I guessed because of stdc++ version mismatching

skyslee2005
Offline
Joined: 2008-08-12
Points: 0

I have get the same problem,and i use gcc 3.3.2 cross-toolchains!!

when I change "const jlong l = *(jlong *)&arg;" to "const jlong l = double_bits(arg);" as danlia said, i got the aother error:

... NativesTable.cpp
../../romgen/app/romgen -cp /home/lee/MB3/outputfb/cldc/classes.zip +GenerateGNUCode =HeapCapacity16M -romconfig /home/lee/MB3/cldc/src/vm/cldctest_rom.cfg -romincludepath /home/lee/MB3/cldc/src/vm +RewriteROMConstantPool +EnableAllROMOptimizations -romize

If romizer fails, increase your heap size.
E.g., =HeapCapacity80M

Starting free heap = 13045 KB
Loading classes...Done! in 0.37 seconds
... reading system property: microedition.encoding
Fatal signal SIGSEGV: errno=0; code=1; addr=0x80000
[Dumping all threads]
Current thread = 0x112000

[Thread: 0x112000 *** CURRENT ***]
Stack Trace (id=0) [
[ 0] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[ 1] EntryFrame
[ 2] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[ 3] EntryFrame
[ 4] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[ 5] EntryFrame
[ 6] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[ 7] EntryFrame
[ 8] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[ 9] EntryFrame
]

[Finished dumping all threads]
make[2]: *** [../generated/ROMImage.cpp] 错误 1
make[2]: Leaving directory `/home/lee/MB3/outputfb/cldc/linux_arm/target/debug'
make[1]: *** [_debug] 错误 2

danila
Offline
Joined: 2006-09-25
Points: 0

Try to increase the heap size in romgen command line and see if it fixes the crash.
Make sure you are using debug version of romgen - the VM should be built
with USE_DEBUG_ROMGEN=true and USE_DEBUG_ROMGEN_SYMBOLS=true.
Debug romgen is typically more verbose in case of crash.
Run the romgen utility under gdb using the same command line as in your message, get the stack trace at the point of crash and post it here.

skyslee2005
Offline
Joined: 2008-08-12
Points: 0

thanks for your help, danila !!!

the problem had sloved when use USE_DEBUG_ROMGEN=true and USE_DEBUG_ROMGEN_SYMBOLS=true

digidealer
Offline
Joined: 2004-03-24
Points: 0

I had to comment out the line 351 in .../cldc/src/vm/cpu/arm/TemplateTable_arm.cpp in order to build CLDC:

>>> GUARANTEE(lsw(l) == 0 || msw(l) == 0, "small floating point number");

Does anyone know if it's going to cause me trouble (run-time errors or something) down the road?

Thanks,

danila
Offline
Joined: 2006-09-25
Points: 0

It can cause VM interpreter to execute some dconst_* bytecode incorrectly.
Probably the assertion failed, since the following code in bc_dconst::generate()
const jlong l = *(jlong *)&arg;
conflicts with the strict-aliasing optimization of the compiler.
Try to replace this line with:
const jlong l = double_bits(arg);