Skip to main content

Error while porting GTk on Phoneme

13 replies [Last post]
anu_1977
Offline
Joined: 2007-06-26

After change in make files in defs_basis_gtk.mk for compile Gtk Native code for porting GTK2.10 .i got Error while Excute CVM. CVM Compile with command line options

Make CVM_DEBUG=true AWT_IMPLEMENTATION=gtk J2ME_CLASSLIB=basis

JDK_HOME=path According to Systems.
i have done some changes in phoneme make files to compile my native code and create awt_objs directory whichs contains .o files for Example:- awt_objs/GToolkit.o. I am getting Error

in some Make files in defs_basis.mk

/****************defs_basis.mk make files changes*******************/
ifneq ($(GRAPHICS_ENV_CLASS),)
SYSTEM_PROPERTIES += "java.awt.graphicsenv=$(GRAPHICS_ENV_CLASS)\n"
endif

AWT_LIB_OBJECTS = $(patsubst %.o,awt_objs/%.o,$(AWT_LIB_OBJS))

JPEG_LIB_NAME = jpeg
JPEG_LIB_OBJECTS = $(patsubst %.o,jpeg_objs/%.o,$(JPEG_LIB_OBJS))

# If romizing then add all objects that would normally be in the shared libraries
# to the CVM.

ifeq ($(ROMIZE_LIBCLASSES), true)
CVM_OBJECTS += $(AWT_LIB_OBJECTS) $(JPEG_LIB_OBJECTS)
LINKLIBS += $(AWT_LIB_LIBS) $(JPEG_LIB_LIBS)
BUILTIN_LIBS += $(AWT_LIB_NAME) $(JPEG_LIB_NAME)
endif

/****************rules_basis.mk make files changes*******************/

# Rule to create AWT objects needed by the AWT library

awt_objs/%.o: %.c
@echo "... $@"
@mkdir -p awt_objs
$(AT)$(CC) $(AWT_CPPFLAGS) $(CFLAGS) -o $@ $<
ifeq ($(GENERATEMAKEFILES), true)
@$(CC) $(CCDEPEND) $(AWT_CPPFLAGS) $(CPPFLAGS) $< 2> /dev/null | \
sed 's!$*\.o!$(dir $@)&!g' > $(@:.o=.d)
endif

# Rule to create JPEG objects needed by the JPEG library

jpeg_objs/%.o: %.c
@echo "... $@"
@mkdir -p jpeg_objs
$(CC_RULE)
ifeq ($(GENERATEMAKEFILES), true)
@$(CC) $(CCDEPEND) $(CPPFLAGS) $< 2> /dev/null | \
sed 's!$*\.o!$(dir $@)&!g' > $(@:.o=.d)
endif

files := $(foreach file, $(wildcard awt_objs/*.d), $(file))
ifneq ($(strip $(files)),)
include $(files)
endif

files := $(foreach file, $(wildcard jpeg_objs/*.d), $(file))
ifneq ($(strip $(files)),)
include $(files)
endif

/*************************Error***************************************************//

05:30:00
make: ../../src/share/basis/demo/IXCDemo/ixcXlets/clientXlet/PlaneClient.java: Timestamp out of range; substituting 1970-01-01 05:30:00
make: ../../src/share/basis/demo/IXCDemo/ixcXlets/serverXlet/PlaneImpl.java: Timestamp out of range; substituting 1970-01-01
05:30:00
make: ../../src/share/basis/demo/IXCDemo/ixcXlets/serverXlet/PlaneImpl.java: Timestamp out of range; substituting 1970-01-01
05:30:00
make: ../../src/share/basis/demo/IXCDemo/ixcXlets/serverXlet/PlaneServer.java: Timestamp out of range; substituting 1970-01-01 05:30:00
make: ../../src/share/basis/demo/IXCDemo/ixcXlets/serverXlet/PlaneServer.java: Timestamp out of range; substituting 1970-01-01 05:30:00
make: ../../src/share/basis/demo/IXCDemo/IXCMain.java: Timestamp out of range; substituting 1970-01-01 05:30:00
make: ../../src/share/basis/demo/IXCDemo/IXCMain.java: Timestamp out of range; substituting 1970-01-01 05:30:00
Compiling demo classes...
... ../../build/linux-x86-generic/./democlasses.jar
... generating jni class headers
... ../../build/linux-x86-generic/./classes.jcc/GenOpcodes.class
Note: ../../src/share/javavm/jcc/util/BufferedPrintStream.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
... ../../src/share/javavm/include/opcodes.list
... ../../build/linux-x86-generic/./classes.jcc/JavaCodeCompact.class
Note: ../../src/share/javavm/jcc/util/LinkerUtil.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
jcc romjava.c files
960 Total Classes
... of which 201 classes have static initializers
(9451/13735 quickening sites)
8742 method blocks
... of which 8742 blocks are writable
... for 860 classes
... of which 2951 have checkinit opcodes in the code
435312 bytes of Java code
1570 catch frames
3895 field blocks
943 inner class attribute entries
9564 constant pool entries
3733 Java strings
make: ../../src/share/basis/native/awt/gtk/ImageRepresentation.c: Timestamp out of range; substituting 1970-01-01 05:30:00
make: ../../src/share/basis/native/awt/gtk/ImageRepresentation.c: Timestamp out of range; substituting 1970-01-01 05:30:00
... awt_objs/ImageRepresentation.o
../../src/share/basis/native/awt/gtk/ImageRepresentation.c:6:42: java_awt_image_ImageObserver.h: No such file or directory
../../src/share/basis/native/awt/gtk/ImageRepresentation.c:22: parse error before "jint"
../../src/share/basis/native/awt/gtk/ImageRepresentation.c:22: warning: no semicolon at end of struct or union
../../src/share/basis/native/awt/gtk/ImageRepresentation.c:34: parse error before "rgbBufferSize"
../../src/share/basis/native/awt/gtk/ImageRepresentation.c:34: warning: data definition has no type or storage class
../../src/share/basis/native/awt/gtk/ImageRepresentation.c:40: parse error before '}' token
../../src/share/basis/native/awt/gtk/ImageRepresentation.c:40: warning: data definition has no type or storage class
make: *** [awt_objs/ImageRepresentation.o] Error

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

anu_1977
Offline
Joined: 2007-06-26

my motive to reduce CVM size less than 2MB including libgtk.so and jar files.like CVM_PRELOAD_LIB=false .reduce size up to 2.6MB.Is similar way any build options .like CVM_PRELOAD_LIB=false.which can reduce CVM size less than 2MB.

cjplummer
Offline
Joined: 2006-10-16

Sorry, but that's not possible unless you start removing classes and methods so you no longer have a CDC compliant stack. You can make it about 200k smaller by removing the JIt with CVM_JIT=false, but that's about it.

Chris

anu_1977
Offline
Joined: 2007-06-26

How i can process EventListener. I am Facing Error while excuting CVM.

[CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/ConnectionBase.java
[CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/DateParser.java
[CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/GeneralBase.java
[CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/j2me/datagram/DatagramObject.java
[CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/j2me/datagram/Protocol.java
[CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/j2me/file/Protocol.java
[CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/j2me/file/ProtocolBase.java
[CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/j2me/file/ProtocolNative.java
[CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/j2me/UniversalOutputStream.java
[CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/ConnectionBaseInterface.java
[CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/i18n/Helper.java
[CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/i18n/StreamReader.java
[CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/i18n/StreamWriter.java
[CJP_JPP] bt.. ../../src/share/classes/sun/net/www/protocol/jar/Handler.java
[CJP_JPP] bt.. ../../src/share/classes/sun/net/www/protocol/jar/JarURLConnection.java
[CJP_JPP] bt.. ../../src/linux/classes/sun/net/www/protocol/jar/JarFileFactory.java
[CJP_JPP] bt.. ../../src/linux/classes/java/lang/UNIXProcess.java
[CJP_JPP] bt done!
[CJP_JPP] Compiling build-time classes...
../../cjp/share/deprecated/classes/com/samsung/cdc/isolate/IsolateEventListener.java:18: cannot resolve symbol
symbol : class EventListener
location: package util
import java.util.EventListener;
^
../../cjp/share/deprecated/classes/com/samsung/cdc/isolate/IsolateEventListener.java:23: cannot resolve symbol
symbol : class EventListener
location: interface com.samsung.cdc.isolate.IsolateEventListener
public interface IsolateEventListener extends EventListener {
^
Note: ../../build/linux-x86-generic/./generated/cjp_jpp_btclasses/java/io/ObjectInputStream.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
2 errors
make: *** [.compile.btclasses] Error 1

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> How i can process EventListener. I am Facing Error while excuting CVM.
>
> [CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/ConnectionBase.java
> [CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/DateParser.java
> [CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/GeneralBase.java
> [CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/j2me/datagram/DatagramObject.java
> [CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/j2me/datagram/Protocol.java
> [CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/j2me/file/Protocol.java
> [CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/j2me/file/ProtocolBase.java
> [CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/j2me/file/ProtocolNative.java
> [CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/j2me/UniversalOutputStream.java
> [CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/io/ConnectionBaseInterface.java
> [CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/i18n/Helper.java
> [CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/i18n/StreamReader.java
> [CJP_JPP] bt.. ../../src/share/classes/com/sun/cdc/i18n/StreamWriter.java
> [CJP_JPP] bt.. ../../src/share/classes/sun/net/www/protocol/jar/Handler.java
> [CJP_JPP] bt.. ../../src/share/classes/sun/net/www/protocol/jar/JarURLConnection.java
> [CJP_JPP] bt.. ../../src/linux/classes/sun/net/www/protocol/jar/JarFileFactory.java
> [CJP_JPP] bt.. ../../src/linux/classes/java/lang/UNIXProcess.java
> [CJP_JPP] bt done!
> [CJP_JPP] Compiling build-time classes...
> ../../cjp/share/deprecated/classes/com/samsung/cdc/isolate/IsolateEventListener.java:18: cannot resolve symbol
> symbol : class EventListener
> location: package util
> import java.util.EventListener;
> ^
> ../../cjp/share/deprecated/classes/com/samsung/cdc/isolate/IsolateEventListener.java:23: cannot resolve symbol
> symbol : class EventListener
> location: interface com.samsung.cdc.isolate.IsolateEventListener
> public interface IsolateEventListener extends EventListener {
> ^
> Note: ../../build/linux-x86-generic/./generated/cjp_jpp_btclasses/java/io/ObjectInputStream.java uses or overrides a deprecated API.
> Note: Recompile with -deprecation for details.
> 2 errors

What is your full make command line that you are using to build?

Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

anu_1977
Offline
Joined: 2007-06-26

Hello Sir

i Successfully Compile GTK Native and classes. I am Getting Error while linking cvm.
Regards
Anurag Gupta

Error:-

Checking for demo classes to compile ...
make: ../../cjp/share/basis/native/awt/gtk/ThreadLocking.h: Timestamp out of range; substituting 1970-01-01 05:30:00
make: ../../cjp/share/basis/native/awt/gtk/KeyCodes.c: Timestamp out of range; substituting 1970-01-01 05:30:00
make: ../../cjp/share/basis/native/awt/gtk/GToolkit.h: Timestamp out of range; substituting 1970-01-01 05:30:00
make: ../../cjp/share/basis/native/awt/gtk/ThreadLocking.c: Timestamp out of range; substituting 1970-01-01 05:30:00
make: ../../cjp/share/basis/native/awt/gtk/GdkGraphicsDevice.h: Timestamp out of range; substituting 1970-01-01 05:30:00
make: ../../cjp/share/basis/native/awt/gtk/GdkGraphicsConfiguration.h: Timestamp out of range; substituting 1970-01-01 05:30:00
make: ../../cjp/share/basis/native/awt/gtk/GdkInterface.h: Timestamp out of range; substituting 1970-01-01 05:30:00
Linking ../../build/linux-x86-generic/./bin/cvm
../../build/linux-x86-generic/./obj/GdkGraphicsEnv.o(.text+0x47): In function `Java_java_awt_GdkGraphicsEnvironment_init':
: undefined reference to `NEW_GLOBAL_REF'
../../build/linux-x86-generic/./obj/GdkGraphicsEnv.o(.text+0x8e): In function `Java_java_awt_GdkGraphicsEnvironment_init':
: undefined reference to `NEW_GLOBAL_REF'
../../build/linux-x86-generic/./obj/GdkGraphicsEnv.o(.text+0xaf): In function `Java_java_awt_GdkGraphicsEnvironment_init':
: undefined reference to `NEW_GLOBAL_REF'
../../build/linux-x86-generic/./obj/GdkGraphicsEnv.o(.text+0x12a): In function `Java_java_awt_GdkGraphicsEnvironment_init':
: undefined reference to `NEW_GLOBAL_REF'
../../build/linux-x86-generic/./obj/GdkGraphicsEnv.o(.text+0x1a5): In function `Java_java_awt_GdkGraphicsEnvironment_init':
: undefined reference to `NEW_GLOBAL_REF'
../../build/linux-x86-generic/./obj/GdkGraphicsEnv.o(.text+0x468): more undefined references to `NEW_GLOBAL_REF' follow
../../build/linux-x86-generic/./obj/libromjava.o(.rodata+0x171f8c): undefined reference to `Java_java_awt_GdkImage_pDrawImage'
../../build/linux-x86-generic/./obj/libromjava.o(.rodata+0x25230c): undefined reference to `Java_sun_awt_image_OffScreenImageSource_sendPixels'
../../build/linux-x86-generic/./obj/libromjava.o(.rodata+0x2c7f4c): undefined reference to `Java_sun_awt_image_JPEGImageDecoder_initIDs'
../../build/linux-x86-generic/./obj/libromjava.o(.rodata+0x2c7f58): undefined reference to `Java_sun_awt_image_JPEGImageDecoder_readImage'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libgthread.so: undefined reference to `g_mutex_init'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libgthread.so: undefined reference to `g_mem_init'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libgthread.so: undefined reference to `g_messages_init'
collect2: ld returned 1 exit status
make: *** [../../build/linux-x86-generic/./bin/cvm] Error 1

cjplummer
Offline
Joined: 2006-10-16

There are no references to NEW_GLOBAL_REF in the phoneME sources, so you must have added them. Look in GdkGraphicsEnv.c. Where did it come from?

If you google for NEW_GLOBAL_REF, you will see that iit is commoly implemented as a macro to choose between debug and non-debug versions of NewGlobalRef. For example, the non-debug version would call (*jnienv)->NewGlobalRef(jnienv, obj).

The Java_ references are for native methods that you have not implemented yet, or are not compilng and linking with the cvm binary.

For the g_ references, this looks like a problem with your libgthread.so library, which possibly you did not build correctly, or maybe there is another library you also need to include when you link.

Chris

anu_1977
Offline
Joined: 2007-06-26

Hello Sir
i have a query about CVM Size ?.when we build with CVM_PRELOAD_LIB=false. the minimum size of binary is 2.9 MB.so is their any command line options which gives binary size of cvm smallest.if yes. How much size will it optimze of cvm binary ?.

anu_1977
Offline
Joined: 2007-06-26

Any command line build options like CVM_PRELOAD_LIB=false. to get minimum binary size of CVM less than 2 MB.?

Regards
Anurag

anu_1977
Offline
Joined: 2007-06-26

I am optimzing the phoneme code for CVM size up to 2MB.So i want remove tools directory form phoneme_advanced_mr 2\ tools which contains (1)checkreports(2)\configurator(3)makefiles etc. So when i optimzed phoneme code for CVM size up to 2MB to remove phoneme_advanced_mr 2\ tools its shows Error. I want compile phoneme_advanced_mr 2 src with only with build and src directory. and make CVM size less than2 MB.I have tried CVM_PRELOAD_LIB=false. J2ME_CLASSLIB=basis but CVM size was 2.9MB.

cjplummer
Offline
Joined: 2006-10-16

> I am optimzing the phoneme code for CVM size up to
> 2MB.
You won't get there if you are including all components needed to run a GTK port.

> So i want remove tools directory form
> phoneme_advanced_mr 2\ tools which contains
> (1)checkreports(2)\configurator(3)makefiles etc. So
> when i optimzed phoneme code for CVM size up to 2MB
> to remove phoneme_advanced_mr 2\ tools its shows
> Error. I want compile phoneme_advanced_mr 2 src
> with only with build and src directory.
You can't build without the tools components.

> and make
> CVM size less than2 MB.I have tried
> CVM_PRELOAD_LIB=false. J2ME_CLASSLIB=basis but CVM
> size was 2.9MB.

Yes, and it is even bigger if you count the lib/basis.jar and lib/libawtgtk.so files. You need all of these to run build. This is as small as it gets with a GTK build.

Chris

anu_1977
Offline
Joined: 2007-06-26

You can't build without the tools components.?
what is the dependency to used tool components.?

cjplummer
Offline
Joined: 2006-10-16

There are makefiles in the tools component that are shared between the cdc component and other components. Also, the source for Configurator.jar is there, which is a too used during the build to produce PackageManager.java, which is needed by the cdc build. If you are worried about the size of the cvm binary, chopping things out of the tools component won't help you. It has no impact on the size. It only provides buildtime support.

Chris