Skip to main content

CLDC romgen linking error - ARM (phoneme feature MR3)

1 reply [Last post]
ole00
Offline
Joined: 2008-10-14

Hi,

I'm trying to build hotspot build for ARM and during the ROMGEN linking phase i got tons of errors like this:

linking ROM generator: ../../romgen/app/romgen.exe
HotRoutines1.obj:HotRoutines1.cpp:(.text+0x11): undefined reference to `__old_generation_end'
HotRoutines1.obj:HotRoutines1.cpp:(.text+0x1b): undefined reference to `_jvm_fast_globals'
HotRoutines1.obj:HotRoutines1.cpp:(.text+0x43): undefined reference to `_jvm_fast_globals'
HotRoutines1.obj:HotRoutines1.cpp:(.text+0x49): undefined reference to `_jvm_fast_globals'
HotRoutines1.obj:HotRoutines1.cpp:(.text+0x73): undefined reference to `_jvm_fast_globals'
HotRoutines1.obj:HotRoutines1.cpp:(.text+0x11d): undefined reference to `_jvm_fast_globals'
HotRoutines1.obj:HotRoutines1.cpp:(.text+0x123): more undefined references to `_jvm_fast_globals' follow
_MergedSrc001.obj:_MergedSrc001.cpp:(.text+0x7d24): undefined reference to `__kni_parameter_base'
_MergedSrc001.obj:_MergedSrc001.cpp:(.text+0x7d4c): undefined reference to `__kni_parameter_base'
_MergedSrc001.obj:_MergedSrc001.cpp:(.text+0x82b1): undefined reference to `_jvm_fast_globals'
_MergedSrc001.obj:_MergedSrc001.cpp:(.text+0x8382): undefined reference to `_jvm_fast_globals'
...
...
_MergedSrc002.obj:_MergedSrc002.cpp:(.text$_ZN18JVMBinaryAssembler23get_current_stack_limitEN12JVMAssembler8RegisterENS0
_9ConditionE[JVMBinaryAssembler::get_current_stack_limit(JVMAssembler::Register, JVMAssembler::Condition)]+0xc): undefined reference to `__current_stack_limit'
_MergedSrc002.obj:_MergedSrc002.cpp:(.text$_ZN18JVMBinaryAssembler23get_current_stack_limitEN12JVMAssembler8RegisterENS0
_9ConditionE[JVMBinaryAssembler::get_current_stack_limit(JVMAssembler::Register, JVMAssembler::Condition)]+0x16): undefined reference to `_gp_base_label'

etc.

Does anyone knows what went wrong ? In which .obj file these missing symbols should be stored ?
I have already built an interpreted version which works fine. Loopgen phase of the hotspot configuration also finished successfuly.

My configuration looks like that:

MakeDepsMain_win32_gcc = CygwinPlatform

host_os = cygwin
host_arch = i386
os_family = win32
compiler = gcc
arch = c
pcsl_arch = cygwin_i386

ifndef ENABLE_THUMB_VM
export ENABLE_THUMB_VM := false
export ENABLE_THUMB_VM__BY := nds_arm_hotspot.cfg
endif

ifndef ENABLE_SOFT_FLOAT
export ENABLE_SOFT_FLOAT := true
export ENABLE_SOFT_FLOAT__BY := nds_arm_hotspot.cfg
endif

ifndef ENABLE_INTERPRETATION_LOG
export ENABLE_INTERPRETATION_LOG := false
export ENABLE_INTERPRETATION_LOG__BY := nds_arm_hotspot.cfg
endif

# profile is not supported yet (no fetch_top_frame)
export ENABLE_PROFILER := false
export ENABLE_PROFILER__BY := nds_arm_hotspot.cfg

ROM_GEN_ARG_APPEND += +EnableAOTSymbolTable

ifndef MERGE_SOURCE_FILES
MERGE_SOURCE_FILES = true
endif

ifndef SOURCE_MERGER_SIZE
SOURCE_MERGER_SIZE = 35
endif

SOCKET_SWITCH = true

ifeq ($(IsLoopGen),true)
# LoopGen: an .exe that runs on the HOST. It has
# an ARM assembler loop generator and will generate the ARM
# assembler loop.
os_family = win32
arch = arm
compiler = gcc

export MSW_FIRST_FOR_DOUBLE := true
export MSW_FIRST_FOR_DOUBLE__BY := nds_arm_hotspot.cfg

CPP_DEF_FLAGS = -DARM=1 -DCROSS_GENERATOR=1 -DREDEF_STDINT -DXXXEVC_ASM_QUIRK=1
endif

ifeq ($(IsRomGen),true)
# RomGem: an .exe that runs on the HOST. It has
# an i386 assembler loop. It runs on the HOST to
# generate the (machine independent) ROM.cpp file.
os_family = win32
arch = i386
compiler = gcc

LOOP_GEN_ARG = +GenerateGNUCode +GenerateAssemblyCode

export ENABLE_C_INTERPRETER := true
export ENABLE_C_INTERPRETER__BY := nds_arm_hotspot.cfg
export ENABLE_INTERPRETER_GENERATOR := false
export ENABLE_INTERPRETER_GENERATOR__BY:= nds_arm_hotspot.cfg
carch = arm
iarch = c
CPP_DEF_FLAGS += -DARM -DREDEF_STDINT -DCROSS_GENERATOR=1

endif

#when compiling JVM for target device use theese settings
ifeq ($(IsTarget),true)
os_family = nds
compiler = arm-gcc
//arch = arm
pcsl_arch = nds_arm
target_arch = nds

OBJ_SUFFIX_arm-gcc = .o
EXE_SUFFIX_arm-gcc = .elf
LIB_SUFFIX_arm-gcc = .a

ALT_COMPILER = arm-gcc
ALT_PLATFORM = arm-gcc

LOOP_GEN_FLAGS = +GenerateGNUCode

CPP_DEF_FLAGS_nds = -DLINUX -DARM -DARM9 -I `$(call fixcygpath,$(CYGPREFIX)$(DEVKITPRO)/libnds/include)`
NDS_LIBS = -lfat -lnds9
LINK_FLAGS_nds = -s -specs=ds_arm9.specs -mno-fpu -L `$(call fixcygpath,$(CYGPREFIX)$(DEVKITPRO)/libnds/lib)` $(NDS_LIBS)

# MakeDepsMain_$(os_family)_$(compiler)
MakeDepsMain_nds_arm-gcc = NdsPlatform
# MakeDepsOpts_$(os_family)
MakeDepsOpts_nds = -resolveVpath true

# We never generate the interpreter loop or ROM image on the target.
ifndef ENABLE_INTERPRETER_GENERATOR
export ENABLE_INTERPRETER_GENERATOR := false
export ENABLE_INTERPRETER_GENERATOR__BY := nds_arm_hotspot.cfg
endif
ifndef ENABLE_ROM_GENERATOR
export ENABLE_ROM_GENERATOR := false
export ENABLE_ROM_GENERATOR__BY := nds_arm_hotspot.cfg
endif

endif

Any information will be appreciated. Thanks.
Ole

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ole00
Offline
Joined: 2008-10-14

Found it.

The problem is that in my environemt (cygwin) "gcc" export symbols with leading underscore and "as" exports the symbols without it. In my case Loopgen generated the Interpreter_arm.s without leading underscores, "as" compiled it without the underscores as well, but "gcc" compiled code contained the same symbols with the leading undescores - so the linker could not match the symbols. Fortunately loopgen has an option to generate underscores in asm symbols. This feature can be enabled by adding "+AddExternCUnderscore" to the LOOP_GEN_ARG.

Example:
LOOP_GEN_ARG = +GenerateGNUCode +GenerateAssemblyCode +AddExternCUnderscore

Ole