Skip to main content

Cross-Compiling PhoneME MIDP on Linux i386 for ARM

5 replies [Last post]
loopiez
Offline
Joined: 2010-03-03

While building midp we get the following ROMizer-related error:

... generating /home/milen/phoneME/phoneme_feature/build-output/midp/ROMImage.cpp
/home/milen/phoneME/phoneme_feature/build-output/cldc/linux_arm/dist/bin/romgen -romconfig /home/milen/phoneME/phoneme_feature/build-output/midp/generated/rom_configs.lst +GenerateROMStructs +EnableROMCompilation +EnableAllROMOptimizations -cp /home/milen/phoneME/phoneme_feature/build-output/midp/classes.zip -romize =HeapCapacity1096M -romincludepath /home/milen/phoneME/phoneme_feature/build-output/cldc/linux_arm/dist/lib -romincludepath /home/milen/phoneME/phoneme_feature/midp/build/linux_fb_gcc/../../build/common/config

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

Starting free heap = 1107496 KB
Loading classes...Done! in 3.372 seconds
... reading system property: microedition.encoding
Fatal signal SIGSEGV: errno=0; code=1; addr=(nil)
[Dumping all threads]
Current thread = 0x40001000

[Thread: 0x40001000 *** 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
[10] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[11] EntryFrame
[12] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[13] EntryFrame
[14] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[15] EntryFrame
[16] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[17] EntryFrame
[18] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[19] EntryFrame
[20] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[21] EntryFrame
[22] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[23] EntryFrame
[24] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[25] EntryFrame
[26] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[27] EntryFrame
[28] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[29] EntryFrame
[30] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[31] EntryFrame
[32] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[33] EntryFrame
[34] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[35] EntryFrame
[36] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[37] EntryFrame
[38] com/sun/cldchi/jvm/JVM.createSysImage bci=0
[39] EntryFrame
]

[Finished dumping all threads]
make: *** [/home/milen/phoneME/phoneme_feature/build-output/midp/ROMImage.cpp] Fehler 1

This occurs even with a heap capacity >> 1 GB. We've tried both setting USE_DEBUG_ROMGEN=true and
USE_DEBUG_ROMGEN_SYMBOLS=true as well as turning off ENABLE_CODE_OPTIMIZER, ENABLE_INTERNAL_CODE_OPTIMIZER and ENABLE_TRAMPOLINE, but without any effect. We tried gcc-4.2.4 and gcc-4.4.1 for cross-compiling and gcc-4.3.1 and gcc-4.1.3 for creating build-time tools like romgen, loopgen, preverify, etc. Any further help, hints or suggestions would be highly appreciated!

Thanks in advance!

Reply viewing options

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

Hi, loopiez,

Are you building pure CLDC/MIDP or there are any additional JSR's? What are the CLDC and MIDP set of build flags that you are using? Can you please run romgen under gdb and list the stack track of the failure here?

Thank you,
Pavel

loopiez
Offline
Joined: 2010-03-03

Hi Pavel!

First I would like to thank you for your quick reply!

We build _pure_ CLDC/MIDP (no additional JSRs) with the following environemnt and commands:

CLDC:

make -C $PME_HOME/cldc/build/linux_arm \
GNU_TOOLS_DIR=$GNU_TOOLS_DIR \
JDK_DIR=$JDK_DIR \
ENABLE_PCSL=true \
PCSL_OUTPUT_DIR=$Output/pcsl \
JVMWorkSpace=$PME_HOME_ABS/cldc \
JVMBuildSpace=$Output/cldc \
TOOLS_DIR=$PME_HOME/tools \
TOOLS_OUTPUT_DIR=$Output/tools \
ENABLE_COMPILATION_WARNINGS=true \
USE_DEBUG_ROMGEN=true \
USE_DEBUG_ROMGEN_SYMBOLS=true

MIDP:

make -C $PME_HOME/midp/build/linux_fb_gcc \
GNU_TOOLS_DIR=$GNU_TOOLS_DIR \
JDK_DIR=$JDK_DIR \
PCSL_OUTPUT_DIR=$Output/pcsl \
CLDC_DIST_DIR=$Output/cldc/linux_arm/dist \
TOOLS_DIR=$PME_HOME_ABS/tools \
TOOLS_OUTPUT_DIR=$Output/tools \
TARGET_CPU=arm \
MIDP_OUTPUT_DIR=$Output/midp \
USE_DEBUG_ROMGEN=true \
USE_DEBUG_ROMGEN_SYMBOLS=true \
ENABLE_CODE_OPTIMIZER=false

As I stated in my first posting, we tried different combinations of USE_DEBUG_ROMGEN, USE_DEBUG_ROMGEN_SYMBOLS, ENABLE_CODE_OPTIMIZER, etc.

Please, can you provide us with additional information about obtaining the stack track within gdb? We are mainly java developers here.

Thx!

pavelp
Offline
Joined: 2006-09-29

Hi Loopiez,

To get the stack trace you shoud build romgen with USE_DEBUG_ROMGEN=true and
USE_DEBUG_ROMGEN_SYMBOLS=true as I guess you did and follow the steps:

1. run on you host platform: gdb -args /home/milen/phoneME/phoneme_feature/build-output/cldc/linux_arm/dist/bin/romgen -romconfig /home/milen/phoneME/phoneme_feature/build-output/midp/generated/rom_configs.lst +GenerateROMStructs +EnableROMCompilation +EnableAllROMOptimizations -cp /home/milen/phoneME/phoneme_feature/build-output/midp/classes.zip -romize =HeapCapacity1096M -romincludepath /home/milen/phoneME/phoneme_feature/build-output/cldc/linux_arm/dist/lib -romincludepath /home/milen/phoneME/phoneme_feature/midp/build/linux_fb_gcc/../../build/common/config
(or whatever romgen command line appears in your build)
2. execute command and wait until it crashes: > run
3. execute: > where
4. list the output here

Regards,
Pavel

loopiez
Offline
Joined: 2010-03-03

Hi Pavel!

Here is the stack trace:

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) where
#0 0x00000000 in ?? ()
#1 0x080b590a in JVMCompilerState::allocate (size=2284, _traps_ptr=0x823574c)
at /home/milen/phoneME/phoneme_feature/cldc/src/vm/share/compiler/CompilerState.hpp:76
#2 0x080b5ef8 in JVMCompiler::try_to_compile (method=0xbfffe888, active_bci=-1, compiled_code_factor=15,
_traps_ptr=0x823574c) at /home/milen/phoneME/phoneme_feature/cldc/src/vm/share/compiler/Compiler.cpp:420
#3 0x080a553d in JVMCompiler::compile (method=0xbfffe888, active_bci=-1, _traps_ptr=0x823574c)
at /home/milen/phoneME/phoneme_feature/cldc/src/vm/share/compiler/Compiler.cpp:485
#4 0x0812792b in JVMMethod::compile (this=0xbfffe888, active_bci=-1, resume=0, _traps_ptr=0x823574c)
at /home/milen/phoneME/phoneme_feature/cldc/src/vm/share/handles/Method.cpp:143
#5 0x08127c10 in JVMROMOptimizer::precompile_methods (this=0xbfffeeb4, _traps_ptr=0x823574c)
at /home/milen/phoneME/phoneme_feature/cldc/src/vm/share/ROM/ROMOptimizer.cpp:3619
#6 0x081296d9 in JVMROMOptimizer::optimize (this=0xbfffeeb4, log_stream=0xbfffee98, _traps_ptr=0x823574c)
at /home/milen/phoneME/phoneme_feature/cldc/src/vm/share/ROM/ROMOptimizer.cpp:241
#7 0x08129870 in JVMSourceROMWriter::execute0 (this=0xbfffee78, _traps_ptr=0x823574c)
at /home/milen/phoneME/phoneme_feature/cldc/src/vm/share/ROM/SourceROMWriter.cpp:138
#8 0x08129a61 in JVMSourceROMWriter::execute (this=0xbfffee78, _traps_ptr=0x823574c)
at /home/milen/phoneME/phoneme_feature/cldc/src/vm/share/ROM/SourceROMWriter.cpp:93
#9 0x080d0dc9 in Java_com_sun_cldchi_jvm_JVM_createSysImage (_traps_ptr=0x823574c)
at /home/milen/phoneME/phoneme_feature/cldc/src/vm/share/natives/Natives.cpp:577
#10 0x081491d1 in invoke_native_entry (entry_point=0x80d0d9b "U\211åVS\201ì \001", return_value_type=T_VOID, num_args=0,
ap=0xbffff050 "\004", r1=@0xbffff028, r2=@0xbffff024)
at /home/milen/phoneME/phoneme_feature/cldc/src/vm/cpu/c/Interpreter_c.cpp:1227
#11 0x0814f140 in shared_call_vm_internal (entry_point=0x80d0d9b "U\211åVS\201ì \001",
return_point=0x8152c41 "U\211åS\203ì\024¡LW#\b\211Ãè¦4òÿ\215\004\003\213", return_value_type=T_VOID, num_args=0)
at /home/milen/phoneME/phoneme_feature/cldc/src/vm/cpu/c/Interpreter_c.cpp:1374
#12 0x08150b02 in bc_impl_fast_invokenative ()
at /home/milen/phoneME/phoneme_feature/cldc/src/vm/cpu/c/Interpreter_c.cpp:4025
#13 0x081521ad in Interpret () at /home/milen/phoneME/phoneme_feature/cldc/src/vm/cpu/c/Interpreter_c.cpp:4519
#14 0x08152210 in primordial_to_current_thread ()
at /home/milen/phoneME/phoneme_feature/cldc/src/vm/cpu/c/Interpreter_c.cpp:4536
#15 0x080ec63d in JVM::run () at /home/milen/phoneME/phoneme_feature/cldc/src/vm/share/runtime/JVM.cpp:259
#16 0x08127488 in JVM::start () at /home/milen/phoneME/phoneme_feature/cldc/src/vm/share/runtime/JVM.cpp:470
#17 0x08127526 in executeVM () at /home/milen/phoneME/phoneme_feature/cldc/src/vm/os/linux/JVM_linux.cpp:46
#18 0x081275ab in JVM_Start (classpath=0x0, main_class=0x0, argc=0, argv=0xbffff23c)
at /home/milen/phoneME/phoneme_feature/cldc/src/vm/os/linux/JVM_linux.cpp:56
#19 0x0804d87d in main (argc=0, argv=0xbffff23c)
at /home/milen/phoneME/phoneme_feature/cldc/src/vm/os/linux/Main_linux.cpp:106

Thanks and best regards,
Milen

pavelp
Offline
Joined: 2006-09-29

Hi Milen,

Can you please try to build debug target for CLDC and pass USE_DEBUG=true build flag for other components. Does it work for you?

Regards,
Pavel