Skip to main content

linux x86 and gcc 4.0.3

13 replies [Last post]
djoog
Offline
Joined: 2006-12-04

Hi.

I am trying to build the j2me code on ubuntu dapper. i basically too the svn code and tried to compile it.

1) could you explain why i am getting these errors :

generating ../generated/NativesTable.cpp ...
... BSDSocket.cpp
... FloatSupport_i386.cpp
... HotRoutines0.cpp
... HotRoutines1.cpp
... JarFileUncommon.cpp
cc1plus: warnings being treated as errors
/home/ymo/build/scratchbox.build/j2me/cldc/cldc-2006-12-04/cldc/src/vm/share/runtime/JarFileUncommon.cpp: In function ‘void Jvm_read_jar_entry(const JvmPathChar*, const char*, _jobject*)’:
/home/ymo/build/scratchbox.build/j2me/cldc/cldc-2006-12-04/cldc/src/vm/share/runtime/JarFileUncommon.cpp:36: warning: control may reach end of non-void function ‘static JVMOopDesc* JarFileParser::get(const JvmPathChar*, JVMTraps*)’ being inlined
/home/ymo/build/scratchbox.build/j2me/cldc/cldc-2006-12-04/cldc/src/vm/share/runtime/JarFileParser.hpp:239: warning: control may reach end of non-void function ‘static JVMOopDesc* JarFileParser::get(const JvmPathChar*, jint, JVMTraps*)’ being inlined
make[1]: *** [JarFileUncommon.o] Error 1
make[1]: Leaving directory `/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-04/build/cldc/linux_i386/loopgen/app'

2) i am now using the host gcc. But i am setup to also use scratchbox which provides a set of easy configured toolchain environement for arm and x86. Have you used scratchbox ? or is it possible to compile the feature mr1 with it.

p.s.
the above errors happen on the host gcc which is :
Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-awt=gtk-default --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --with-tune=pentium4 --enable-checking=release i486-linux-gnu

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
djoog
Offline
Joined: 2006-12-04

thanks you for the quick response. Now i am getting this :

... linking /home/ymo/build/scratchbox.build/j2me/cldc/cldc-2006-12-05/build/midp/bin/i386/runMidlet
/home/ymo/build/scratchbox.build/j2me/cldc/cldc-2006-12-05/build/midp/obj/i386/gxj_graphics.o: In function `gx_draw_rect':gxj_graphics.c:(.text+0x650): undefined reference to `draw_roundrect'
/home/ymo/build/scratchbox.build/j2me/cldc/cldc-2006-12-05/build/midp/obj/i386/gxj_graphics.o: In function `gx_draw_roundrect':gxj_graphics.c:(.text+0x730): undefined reference to `draw_roundrect'
/home/ymo/build/scratchbox.build/j2me/cldc/cldc-2006-12-05/build/midp/obj/i386/gxj_graphics.o: In function `gx_fill_roundrect':gxj_graphics.c:(.text+0x7f2): undefined reference to `draw_roundrect'
/home/ymo/build/scratchbox.build/j2me/cldc/cldc-2006-12-05/build/midp/obj/i386/gxj_graphics.o: In function `gx_draw_arc':gxj_graphics.c:(.text+0x8ae): undefined reference to `draw_arc'
/home/ymo/build/scratchbox.build/j2me/cldc/cldc-2006-12-05/build/midp/obj/i386/gxj_graphics.o: In function `gx_fill_arc':gxj_graphics.c:(.text+0x968): undefined reference to `draw_arc'
/home/ymo/build/scratchbox.build/j2me/cldc/cldc-2006-12-05/build/midp/obj/i386/gxj_graphics.o: In function `gx_fill_rect':gxj_graphics.c:(.text+0xb23): undefined reference to `draw_roundrect'
collect2: ld returned 1 exit status

m_gasanenko
Offline
Joined: 2006-10-20

make with which parameters and from which directory have you issued?

And one more notice: if you change the build options, you have to perform 'make clean', for example, "make BLA=blahblah clean all"

djoog
Offline
Joined: 2006-12-04

ok .. i redid all my compiles just to make sure but now it is failing in pcsl.

here are my params. as you
can see i am checking out the mr2 branch as of now

CLDC_ROOT=$DIR_BUILD/j2me/cldc/cldc-2006-12-06

#export LD_LIBRARY_PATH=
export JDK_DIR=$DIR_BUILD/jdk/j2sdk1.4.2_13

export JVMWorkSpace=$CLDC_ROOT/cldc
export JVMBuildSpace=$CLDC_ROOT/build/cldc
export CLDC_DIST_DIR=$JVMBuildSpace/linux_i386/dist

export ENABLE_PCSL=true
export ENABLE_ISOLATE=true
export PCSL_PLATFORM=linux_i386_gcc
export PCSL_OUTPUT_DIR=$CLDC_ROOT/build/pcsl

export NETWORK_MODULE=bsd/qte
#export NETWORK_MODULE=bsd/generic

export MIDP_DIR=$CLDC_ROOT/midp
export MIDP_OUTPUT_DIR=$CLDC_ROOT/build/midp

#export GNU_TOOLS_DIR=$NEUROS_TOOLCHAIN/arm-linux

#svn checkout https://phoneme.dev.java.net/svn/phoneme/components/pcsl/trunk $CLDC_ROOT/pcsl
#svn checkout https://phoneme.dev.java.net/svn/phoneme/components/cldc/trunk $CLDC_ROOT/cldc

#svn checkout https://phoneme.dev.java.net/svn/phoneme/components/pcsl/branches/pcsl-m... $CLDC_ROOT/pcsl
cd $CLDC_ROOT/pcsl
make clean ; make all

make[4]: Entering directory `/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/memory/memory_port'
make[4]: Leaving directory `/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/memory/memory_port'
building memory module...
make[4]: Entering directory `/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/memory/malloc'
make[4]: Leaving directory `/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/memory/malloc'
make[3]: Leaving directory `/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/memory'
compiling pcsl_posix.o
pcsl_posix.c: In function ‘pcsl_file_open’:
pcsl_posix.c:90: warning: pointer targets in passing argument 1 of ‘open’ differ in signedness
pcsl_posix.c: In function ‘pcsl_file_unlink’:
pcsl_posix.c:144: warning: pointer targets in passing argument 1 of ‘unlink’ differ in signedness
pcsl_posix.c: In function ‘pcsl_file_exist’:
pcsl_posix.c:221: warning: pointer targets in passing argument 1 of ‘stat’ differ in signedness
pcsl_posix.c: In function ‘pcsl_file_rename’:
pcsl_posix.c:257: warning: pointer targets in passing argument 1 of ‘rename’ differ in signedness
pcsl_posix.c:257: warning: pointer targets in passing argument 2 of ‘rename’ differ in signedness
pcsl_posix.c: In function ‘pcsl_file_getusedspace’:
pcsl_posix.c:318: warning: pointer targets in passing argument 2 of ‘pcsl_string_convert_to_utf8’ differ in signedness
pcsl_posix.c: In function ‘pcsl_file_getnextentry’:
pcsl_posix.c:391: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
pcsl_posix.c:403: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
pcsl_posix.c:403: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
pcsl_posix.c:403: warning: pointer targets in passing argument 2 of ‘__builtin_strcmp’ differ in signedness
pcsl_posix.c:403: warning: pointer targets in passing argument 2 of ‘__builtin_strcmp’ differ in signedness
pcsl_posix.c:403: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
pcsl_posix.c:403: warning: pointer targets in passing argument 2 of ‘__builtin_strcmp’ differ in signedness
pcsl_posix.c:403: warning: pointer targets in passing argument 2 of ‘__builtin_strcmp’ differ in signedness
pcsl_posix.c:403: warning: pointer targets in passing argument 2 of ‘strncmp’ differ in signedness
pcsl_posix.c:419: warning: pointer targets in passing argument 1 of ‘pcsl_string_convert_from_utf8’ differ in signedness
pcsl_posix.c: In function ‘pcsl_file_opendir’:
pcsl_posix.c:463: warning: pointer targets in passing argument 1 of ‘opendir’ differ in signedness
compiling pcsl_dir_posix.o
pcsl_dir_posix.c: In function ‘pcsl_file_is_directory’:
pcsl_dir_posix.c:59: warning: pointer targets in passing argument 1 of ‘stat’ differ in signedness
pcsl_dir_posix.c: In function ‘pcsl_file_mkdir’:
pcsl_dir_posix.c:84: warning: pointer targets in passing argument 1 of ‘mkdir’ differ in signedness
pcsl_dir_posix.c: In function ‘pcsl_file_rmdir’:
pcsl_dir_posix.c:103: warning: pointer targets in passing argument 1 of ‘rmdir’ differ in signedness
pcsl_dir_posix.c: In function ‘pcsl_file_getfreesize’:
pcsl_dir_posix.c:124: warning: pointer targets in passing argument 1 of ‘statvfs’ differ in signedness
pcsl_dir_posix.c: In function ‘pcsl_file_gettotalsize’:
pcsl_dir_posix.c:149: warning: pointer targets in passing argument 1 of ‘statvfs’ differ in signedness
pcsl_dir_posix.c: In function ‘pcsl_file_get_attribute’:
pcsl_dir_posix.c:177: warning: pointer targets in passing argument 1 of ‘stat’ differ in signedness
pcsl_dir_posix.c: In function ‘pcsl_file_set_attribute’:
pcsl_dir_posix.c:221: warning: pointer targets in passing argument 1 of ‘stat’ differ in signedness
pcsl_dir_posix.c:260: warning: pointer targets in passing argument 1 of ‘chmod’ differ in signedness
pcsl_dir_posix.c: In function ‘pcsl_file_get_time’:
pcsl_dir_posix.c:286: warning: pointer targets in passing argument 1 of ‘stat’ differ in signedness
/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/file/posix/../util/pcsl_util_filelist.c: In function ‘pcsl_util_openfileiterator’:
/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/file/posix/../util/pcsl_util_filelist.c:54: warning: incompatible implicit declaration of built-in function ‘memset’
make[2]: Leaving directory `/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/file/posix'
make[1]: Leaving directory `/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/file'
cd /home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/network; make all
make[1]: Entering directory `/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/network'
building network module...
make[2]: Entering directory `/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/network/bsd/qte'
In file included from /home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/network/bsd/qte/pcsl_network_na_qte.cpp:37:
./pcsl_network_qte.h:32:21: error: qsocket.h: No such file or directory
./pcsl_network_qte.h:33:29: error: qsocketnotifier.h: No such file or directory
In file included from /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../include/c++/4.0.3/backward/iostream.h:31,
from /home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/network/bsd/qte/pcsl_network_na_qte.cpp:38:
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../include/c++/4.0.3/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the header for the header for C++ includes, or instead of the deprecated header . To disable this warning use -Wno-deprecated.
./pcsl_network_qte.h:63: error: expected class-name before ‘{’ token
./pcsl_network_qte.h:64: error: ISO C++ forbids declaration of ‘Q_OBJECT’ with no type
./pcsl_network_qte.h:66: error: expected ‘;’ before ‘public’
./pcsl_network_qte.h:70: error: ISO C++ forbids declaration of ‘QSocketNotifier’ with no type
./pcsl_network_qte.h:70: error: expected ‘;’ before ‘*’ token
./pcsl_network_qte.h:71: error: expected `;' before ‘QSocketNotifier’
./pcsl_network_qte.h:71: error: ISO C++ forbids declaration of ‘QSocketNotifier’ with no type
./pcsl_network_qte.h:71: error: expected ‘;’ before ‘*’ token
./pcsl_network_qte.h:72: error: expected `;' before ‘int’
./pcsl_network_qte.h:79: error: expected `:' before ‘slots’
./pcsl_network_qte.h:80: error: expected primary-expression before ‘void’
./pcsl_network_qte.h:80: error: ISO C++ forbids declaration of ‘slots’ with no type
./pcsl_network_qte.h:80: error: expected ‘;’ before ‘void’
./pcsl_network_qte.h:84: error: ISO C++ forbids declaration of ‘QSocketNotifier’ with no type
./pcsl_network_qte.h:84: error: expected ‘;’ before ‘*’ token
./pcsl_network_qte.h:85: error: ISO C++ forbids declaration of ‘QSocketNotifier’ with no type
./pcsl_network_qte.h:85: error: expected ‘;’ before ‘*’ token
/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/network/bsd/qte/pcsl_network_na_qte.cpp: In function ‘void na_destroy(void*)’:
./pcsl_network_qte.h:74: error: ‘int VMSocket::readerCount’ is private
/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/network/bsd/qte/pcsl_network_na_qte.cpp:116: error: within this context
./pcsl_network_qte.h:76: error: ‘int VMSocket::writerCount’ is private
/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/network/bsd/qte/pcsl_network_na_qte.cpp:121: error: within this context
make[2]: *** [/home/ymo/build/scratchbox.build/j2me/cldc/cldc-2006-12-06/build/pcsl/linux_i386/obj/pcsl_network_na_qte.o] Error 1
make[2]: Leaving directory `/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/network/bsd/qte'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-06/pcsl/network'
make: *** [all] Error 2

m_gasanenko
Offline
Joined: 2006-10-20

Yes! I'm getting the same warnings. (I have to thank you for this catch.) And it does not happen with GCC_VERSION=-3.3 . I will examine this, but not right now (it's already a bit late here).

By the way, ENABLE_ISOLATE should have been ENABLE_ISOLATES (plural), and MIDP will call it USE_MULTIPLE_ISOLATES.

m_gasanenko
Offline
Joined: 2006-10-20

PS If it's urgent, you can insert type conversion yourself in the places reported by the compiler.
If (type1*)pointer_to_type2 does not work, (type1*)(void*)pointer_to_type2 will do.

tusharj9
Offline
Joined: 2005-09-22

Hi,
Recently I tried to compile MR2 with gcc 3.4.4 but I got compilation error . I'm able to build for gcc 3.3.4 in scratchbox environment.

... InterpreterSkeleton.cpp
... OopMapsSkeleton.cpp
linking ASM loop generator: ../../loopgen/app/loopgen
FloatSupport_i386.o: In function `bc_load_w::generate()':FloatSupport_i386.cpp:(.text._ZN9bc_load_w8generateEv[bc_load_w::generate()]+0x12): undefined reference to `bc_load_w::generate(BasicType)'
FloatSupport_i386.o: In function `bc_store_w::generate()':FloatSupport_i386.cpp:(.text._ZN10bc_store_w8generateEv[bc_store_w::generate()]+0x12): undefined reference to `bc_store_w::generate(BasicType)'
collect2: ld returned 1 exit status
make[1]: *** [../../loopgen/app/loopgen] Error 1
make[1]: Leaving directory `/home/tushar/phmr2/phoneME_feature/output/cldc_output/linux_i386/loopgen/app'
make: *** [_loopgen] Error 2

Any idea what the difference between gcc version which is causing this error . Are any specific set of files depend on gcc version ?

Regards,
Tushar

djoog
Offline
Joined: 2006-12-04

hi

i am now compiling the code on the mr2 branch with a gcc 4.0.3. Are these warnings supposed to be fixed ?

... /home/ymo/build/scratchbox.build/j2me/cldc/cldc-2006-12-05/build/midp/obj/i386/gxj_putpixel.o
cc1: warnings being treated as errors
/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-05/midp/build/linux_fb_gcc/../../src/lowlevelui/graphics/putpixel/native/gxj_putpixel.c: In function ‘draw_clipped_line’:
/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-05/midp/build/linux_fb_gcc/../../src/lowlevelui/graphics/putpixel/native/gxj_putpixel.c:565: warning: ‘incrX’ may be used uninitialized in this function
/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-05/midp/build/linux_fb_gcc/../../src/lowlevelui/graphics/putpixel/native/gxj_putpixel.c:565: warning: ‘incrY’ may be used uninitialized in this function
/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-05/midp/build/linux_fb_gcc/../../src/lowlevelui/graphics/putpixel/native/gxj_putpixel.c:565: warning: ‘decision’ may be used uninitialized in this function
/home/ymo/build/scratchbox/users/ymo/home/ymo/build/j2me/cldc/cldc-2006-12-05/midp/build/linux_fb_gcc/../../src/lowlevelui/graphics/putpixel/native/gxj_putpixel.c:567: warning: ‘xyEnd’ may be used uninitialized in this function
make: *** [/home/ymo/build/scratchbox.build/j2me/cldc/cldc-2006-12-05/build/midp/obj/i386/gxj_putpixel.o] Error 1

akz003
Offline
Joined: 2006-10-13

Hi,

First of all, great thanks for your interest. It was really exciting to find out that you already picked-up the code from this branch.
I want to say that we are going to fix such a warnings for sure - we will check tomorrow where these fixes are on their way and respond more precisely.

Regards,
Kostya.

djoog
Offline
Joined: 2006-12-04

Is there a setting or parameter to pass to the make file to use a certain version of gcc when one has multiple verions on the host ? I tried the GNU_TOOL_CHAIN directive but it always picks up the first available gcc on the path.

leonidr
Offline
Joined: 2006-10-27

There is GCC_VERSION build option. It allows you to specify a suffix to add to "gcc" or "g++" string. For example, if you specify GCC_VERSION="-2.95", then gcc-2.95/g++-2.95 will be used.

djoog
Offline
Joined: 2006-12-04

if gcc 3.3. the only supported verion ? is 3.4 ok ? if we can get the list of gcc version this will be appreciated

aap031
Offline
Joined: 2006-10-18

Hi!

There is no guarantee but 3.4 is almost likely Ok. The more-or-less official list for MR1 is 2.96 and 3.3. MR2 (to appear very shortly, you can already see it on sandbox branch) will support 3.4 as well as 4.0 and 4.1

Regards,
Andrey

asg024
Offline
Joined: 2006-11-17

djoog,
PhoneME MR1 does not support gcc 4.0.3. Please use gcc 3.3 to compile the code.

thanks
Sveta