Skip to main content

BUG NOTE: recent MIDP over CDC build fail, due to "javah -old"

4 replies [Last post]
meng_xx
Offline
Joined: 2005-08-17

hi all,

if you checkout recent CDC src (e.g. b101), the build will fail with "build/linux-x86-generic/make USE_MIDP=true".
the fail log will be error: ... lcdui_game.c .... blah blah ....

the bug is in the file : [phoneme home]/midp/build/common/makefiles/cdc_vm.gmk line 138:

$(AT)$(JDK_DIR)/bin/javah \ //build fail with USE_MIDP=true

in MR2 release, it was like this:

$(AT)$(JDK_DIR)/bin/javah -old \ //original correct way

i think phoneme cdc team is trying to remove the -old option, which is no more supported by latest javah tool.
it is a good move, however, they didn't test it with USE_MIDP=true yet.

br!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
cjplummer
Offline
Joined: 2006-10-16

What is your full bulid command and platform.

meng_xx
Offline
Joined: 2005-08-17

hi cjplummer,

i am using the latest trunk on ubuntu 8.04. gcc is 4.2.4, jdk is 1.4.2.
my full build cmd is very simple: ~/phoneme/trunk/cdc/build/linux-x86-generic$ make USE_MIDP=true

the build log is:

../share/top.mk:456: Forcing J2ME_CLASSLIB=foundation because USE_MIDP=true requires foundation
MAKEFLAGS = USE_MIDP=true
CVM_HOST = i686-Ubuntu-linux
CVM_TARGET = linux-x86-generic
SHELL = sh -e
HOST_CC = /usr/bin/cc
HOST_CCC = /usr/bin/g++
ZIP = /usr/bin/zip
CVM_JAVA = /usr/tools/i686-Ubuntu-linux/java/jdk1.4.2/bin/java
CVM_JAVAC = /usr/tools/i686-Ubuntu-linux/java/jdk1.4.2/bin/javac
CVM_JAVAH = /usr/tools/i686-Ubuntu-linux/java/jdk1.4.2/bin/javah
CVM_JAR = /usr/tools/i686-Ubuntu-linux/java/jdk1.4.2/bin/jar
TARGET_CC = /usr/bin/cc
TARGET_CCC = /usr/bin/g++
TARGET_AS = /usr/bin/cc
TARGET_LD = /usr/bin/cc
TARGET_AR = /usr/bin/ar
TARGET_RANLIB = /usr/bin/ranlib
LINKFLAGS = -g -Wl,-export-dynamic
LINKLIBS = -lpthread -ldl -lm
ASM_FLAGS = -c -fno-common -march=i686 -traditional
CCCFLAGS = -fno-rtti
CCFLAGS_SPEED = -O4 -c -fno-common -Wall -W -Wno-unused-parameter -Wno-sign-compare -fno-strict-aliasing -fwrapv -march=i686
CCFLAGS_SPACE = -O2 -c -fno-common -Wall -W -Wno-unused-parameter -Wno-sign-compare -fno-strict-aliasing -fwrapv -march=i686
CCFLAGS_LOOP = -O4 -c -fno-common -Wall -W -Wno-unused-parameter -Wno-sign-compare -fno-strict-aliasing -fwrapv -march=i686 -fno-inline
CCFLAGS_FDLIB = -O4 -c -fno-common -Wall -W -Wno-unused-parameter -Wno-sign-compare -fno-strict-aliasing -fwrapv -march=i686 -ffloat-store
JAVAC_OPTIONS = -g:none -J-Xms32m -J-Xmx128m -encoding iso8859-1 -source 1.4 -target 1.4
CVM_DEFINES = -DCVM_TARGET_DEVICE=generic -DCVM_OPTIMIZED -DCVM_DEBUG_STACKTRACES -DNDEBUG -DCVM_CLASSLOADING -DCVM_SERIALIZATION -DCVM_REFLECT -DCVM_DYNAMIC_LINKING -DCVM_DUAL_STACK -DCVM_TIMESTAMPING -DJ2ME_CLASSLIB=foundation -DTARGET_CPU_FAMILY=x86 -D_GNU_SOURCE
host uname = Linux mengxiaoxi 2.6.24-22-generic #1 SMP Mon Nov 24 18:32:42 UTC 2008 i686 GNU/Linux
TARGET_CC version = 4.2.4 i486-linux-gnu
HOST_CC version = 4.2.4 i486-linux-gnu
CVM_JAVA version = java version 1.4.2_18

... ignore correct part ....

/home/guest/phoneme/trunk/midp/build/linux_fb_gcc/../../src/highlevelui/lcdui/reference/native/lcdui_game.c: 在函数‘CNIjavax_microedition_lcdui_game_GameCanvas_setSuppressKeyEvents’中:
/home/guest/phoneme/trunk/midp/build/linux_fb_gcc/../../src/highlevelui/lcdui/reference/native/lcdui_game.c:56: 错误: 提领指向不完全类型的指针
make[1]: *** [/home/guest/phoneme/trunk/cdc/build/linux-x86-generic/midp/midp_linux_fb_gcc/obj/i386/lcdui_game.o] 错误 1
make: *** [/home/guest/phoneme/trunk/cdc/build/linux-x86-generic/midp/midp_linux_fb_gcc/bin/i386/runMidlet] 错误 2

--- sorry for the Chinese output, however you should see similar error when gcc the lcdui_game.c ---
--- end of build log ---

[b]if I simply add "-old" in cdc_vm.gmk, at line 138, after "javah", the compilation is ok. [/b]

however, i have problem when run my generated vm: (maybe i should start a new thread for this issue)

guest@mypc:~/phoneme/trunk/cdc/build/linux-x86-generic$ midp/midp_linux_fb_gcc/bin/i386/listMidlets.sh
TRACE: , Fatal error while initializing security token
java.lang.UnsatisfiedLinkError: com.sun.midp.main.Configuration.getProperty0(Ljava/lang/String;)Ljava/lang/String;
at com.sun.midp.main.Configuration.getProperty(Unknown Source)
at com.sun.midp.i18n.Resource.(Unknown Source)
at java.lang.Class.runStaticInitializers(Unknown Source)
at com.sun.midp.security.PermissionGroup.(Unknown Source)
at com.sun.midp.security.Permissions.(Unknown Source)
at java.lang.Class.runStaticInitializers(Unknown Source)
at com.sun.midp.security.SecurityInitializer.(Unknown Source)
at java.lang.Class.runStaticInitializers(Unknown Source)
at com.sun.midp.main.AbstractMIDletSuiteLoader.(Unknown Source)
at java.lang.Class.runStaticInitializers(Unknown Source)
at java.lang.Class.runStaticInitializers(Unknown Source)
at sun.misc.MIDPLauncher.main(Unknown Source)
at sun.misc.CVM.runMain(Unknown Source)
java.lang.reflect.InvocationTargetException
at sun.misc.MIDPLauncher.main(Unknown Source)
at sun.misc.CVM.runMain(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.runStaticInitializers(Unknown Source)
at com.sun.midp.main.AbstractMIDletSuiteLoader.(Unknown Source)
at java.lang.Class.runStaticInitializers(Unknown Source)
at java.lang.Class.runStaticInitializers(Unknown Source)
... 2 more
Caused by: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: com.sun.midp.main.Configuration.getProperty0(Ljava/lang/String;)Ljava/lang/String;
at com.sun.midp.security.SecurityInitializer.(Unknown Source)
... 6 more

cjplummer
Offline
Joined: 2006-10-16

The -old is there. You probably removed it yourself at some point when you used a newer version of javac that complained about it.

As for the getproperty0 problem, we recently became aware of it and our looking into it. It appears that it goes away when you build with CVM_PRELOAD_LIB=true.

meng_xx
Offline
Joined: 2005-08-17

hooops, -old is there. you are right. that is why i cannot use jdk1.5 and above. sorry for that.

for the 2nd issue, [b]today, i am able to install/list/runMIDlet with latest trunk:[/b]

1 svn update cdc folder for the bugfix of MIDPConfig.java
2 make USE_MIDP=true CVM_PRELOAD_LIB=true //use the 2nd option work around as cjpumper suggested, it will avoid generating libmidp.so and avoid unsatisfied link error.
3 CVM_PRELOAD_LIB=false still has problem, the generated libmidp.so is an empty file on my pc. i am wondering if the midp/build/common/makefiles/Defs.gmk: MIDP_SHARED_LIB_FILES += $(OBJLIB) is wrong... maybe it could be += $(OBJ_FILES) ...

Message was edited by: meng_xx