problem with GCJ while running java code

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

problem with GCJ while running java code

by gforgcc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi friends
I have a problem while running a java code with GCJ...
i recently cross compiled GCC for arm with added language option as java. so i got arm-unknown-linux-gnu-gcj..
My java code is

class helloworld
{
    static public void main(String argc[])
   {
         System.out.println("Hello World !");
   }
}

so i am crosscompiling my java code like this...
arm-unknown-linux-gnu-gcj -g --main=helloworld -o helloworld helloworld.java
and running like this
./helloworld
the above should print Hello World ! as far as my understanding since GCJ does not require JVM
while compiling and running it is not giving any error or warning..
but to some extent GDB helped me to atleast post here..
this is my GDB dump..

GNU gdb 6.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i386-pc-linux-gnu --target=arm-unknown-linux-gnu"...
(gdb) break main
Breakpoint 1 at 0x899c: file /var/tmp/ccdniIeT.i, line 10.
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
0xb5e88330 in ?? ()
(gdb) c
Continuing.

Breakpoint 1, main (argc=1, argv=0xb7f06824) at /var/tmp/ccdniIeT.i:10
10      /var/tmp/ccdniIeT.i: No such file or directory.
        in /var/tmp/ccdniIeT.i
(gdb) s
11      in /var/tmp/ccdniIeT.i
(gdb) s
JvRunMain (klass=Variable "klass" is not available.
)
    at /home/developer/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.0.1-glibc-2.3.2/gcc-4.0.1/libjava/prims.cc:1370
1370      _Jv_RunMain (klass, NULL, argc, argv, false);
Current language:  auto; currently c++
(gdb) s
1368    JvRunMain (jclass klass, int argc, const char **argv)
(gdb) s
1370      _Jv_RunMain (klass, NULL, argc, argv, false);
(gdb) s
1368    JvRunMain (jclass klass, int argc, const char **argv)
(gdb) s
1370      _Jv_RunMain (klass, NULL, argc, argv, false);
(gdb) s
s_Jv_RunMain (klass=Variable "klass" is not available.
)
    at /home/developer/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.0.1-glibc-2.3.2/gcc-4.0.1/libjava/prims.cc:1364
1364      _Jv_RunMain (NULL, klass, name, argc, argv, is_jar);
(gdb) s
1362                 bool is_jar)
(gdb) s
1364      _Jv_RunMain (NULL, klass, name, argc, argv, is_jar);
(gdb) s
_Jv_RunMain (vm_args=Variable "vm_args" is not available.
)
    at /home/developer/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.0.1-glibc-2.3.2/gcc-4.0.1/libjava/prims.cc:1314
1314      java::lang::Runtime *runtime = NULL;
(gdb) s
1308                 const char **argv, bool is_jar)
(gdb) s
1314      java::lang::Runtime *runtime = NULL;
(gdb) s
1308                 const char **argv, bool is_jar)
(gdb) s
1311      _Jv_SetArgs (argc, argv);
(gdb) s
_Jv_SetArgs (argc=1, argv=0xb7f06824)
    at /home/developer/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.0.1-glibc-2.3.2/gcc-4.0.1/libjava/prims.cc:117
117       _Jv_argc = argc;
(gdb) s
115     _Jv_SetArgs (int argc, const char **argv)
(gdb) s
117       _Jv_argc = argc;
(gdb) s
118       _Jv_argv = argv;
(gdb) s
117       _Jv_argc = argc;
(gdb) s
118       _Jv_argv = argv;
(gdb) s
119     }
(gdb) s
_Jv_RunMain (vm_args=Variable "vm_args" is not available.
)
    at /home/developer/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.0.1-glibc-2.3.2/gcc-4.0.1/libjava/prims.cc:1318
1318          if (_Jv_CreateJavaVM (vm_args) < 0)
(gdb) s
_Jv_CreateJavaVM (vm_args=Variable "vm_args" is not available.
)
    at /home/developer/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.0.1-glibc-2.3.2/gcc-4.0.1/libjava/prims.cc:1211
1211    _Jv_CreateJavaVM (JvVMInitArgs* vm_args)
(gdb) s
1215      if (runtimeInitialized)
(gdb) s
1144      if (_Jv_Compiler_Properties)
(gdb) s
1218      runtimeInitialized = true;
(gdb) s
1144      if (_Jv_Compiler_Properties)
(gdb) s
1149          for (int i = 0; props[i]; i++)
(gdb) s
1147          _Jv_Compiler_Properties = NULL;
(gdb) s
1149          for (int i = 0; props[i]; i++)
(gdb) s
1158      if (vm_args == NULL)
(gdb) s
852       char *props = getenv("GCJ_PROPERTIES");
(gdb) s
857       if (NULL == props)
(gdb) s
1228      _Jv_InitThreads ();

really dunno what is wrong why is showing those warnings.. as highlighted in the dump..
what is the meaning of all those..
please help me to solve this problem...
i just need it to print Hello World !
thanks... :) :)

Re: problem with GCJ while running java code

by Andrew Haley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

gforgcc wrote:

> Hi friends
> I have a problem while running a java code with GCJ...
> i recently cross compiled GCC for arm with added language option as java. so
> i got arm-unknown-linux-gnu-gcj..
> My java code is
>
> class helloworld
> {
>     static public void main(String argc[])
>    {
>          System.out.println("Hello World !");
>    }
> }
>
> so i am crosscompiling my java code like this...
> arm-unknown-linux-gnu-gcj -g --main=helloworld -o helloworld helloworld.java
> and running like this
> ./helloworld
> the above should print Hello World ! as far as my understanding since GCJ
> does not require JVM
> while compiling and running it is not giving any error or warning..

We need to know

Exactly which gcc / gcj
Exactly which linux
Exactly which options you used to configure gcc / gcj

Andrew.

Re: problem with GCJ while running java code

by gforgcc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andrew Haley wrote:
We need to know

Exactly which gcc / gcj
Exactly which linux
Exactly which options you used to configure gcc / gcj

Andrew.
Thanks for the reply Andrew...

I am using DebianEtch linux OS for building the GCC-4.0.1 and have cross compiled it for ARM...
i have used the exact steps what is told in the below link.....

http://kegel.com/crosstool/crosstool-0.43/doc/crosstool-howto.html
(Have followed only till the completion of the Quick Start step... have not proceded further...)
and i am using gcc-4.0.1, glibc-2.3.2, core gcc as gcc 3.3.6, gdb-6.5 and have used glibc-linuxthreads-2.3.2 and linux-libc-headers-2.6.12.0
GCC_LANGUAGES="c,c++,java
The only thing i have used that is other than what is told in the above link is the Linux kernel..
i have used kernel-2.6.19-ts.at91sam9260ek.1
i.e. while configuring i have given the LINUX_DIR as the above path where the above kernel is present..

Re: problem with GCJ while running java code

by gforgcc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andrew Haley wrote:
Exactly which options you used to configure gcc / gcj

Andrew.
sorry for not posting the complete configuration what i have used.. here it is...

debian:~# arm-unknown-linux-gnu-gcj -v
Using built-in specs.
Reading specs from /opt/crosstool/gcc-4.0.1-glibc-2.3.2/arm-unknown-linux-gnu/lib/gcc/arm-unknown-linux-gnu/4.0.1/../../../../arm-unknown-linux-gnu/lib/libgcj.spec
rename spec lib to liborig
Target: arm-unknown-linux-gnu
Configured with: /home/developer/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.0.1-glibc-2.3.2/gcc-4.0.1/configure
--target=arm-unknown-linux-gnu --host=i686-host_pc-linux-gnu --prefix=/opt/crosstool/gcc-4.0.1-glibc-2.3.2/arm-unknown-linux-gnu
--with-headers=/opt/crosstool/gcc-4.0.1-glibc-2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-gnu/include
--with-local-prefix=/opt/crosstool/gcc-4.0.1-glibc-2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-gnu
--disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++,java
--enable-shared --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.0.1

Re: problem with GCJ while running java code

by Andrew Haley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

gforgcc wrote:

>
> Andrew Haley wrote:
>> Exactly which options you used to configure gcc / gcj
>>
>> Andrew.
>>
>>
> sorry for not posting the complete configuration what i have used.. here it
> is...
>
> debian:~# arm-unknown-linux-gnu-gcj -v
> Using built-in specs.
> Reading specs from
> /opt/crosstool/gcc-4.0.1-glibc-2.3.2/arm-unknown-linux-gnu/lib/gcc/arm-unknown-linux-gnu/4.0.1/../../../../arm-unknown-linux-gnu/lib/libgcj.spec

I recently finished the work to port gcj to ARM.  It was on
the new ARM EABI, not the "old" one (which is what I think you have).

http://wiki.debian.org/ArmEabiPort

gcc 4.0.1 may or may not work with gcj.  Sorry.

Andrew.

Re: problem with GCJ while running java code

by gforgcc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andrew Haley wrote:
I recently finished the work to port gcj to ARM.  It was on
the new ARM EABI, not the "old" one (which is what I think you have).

http://wiki.debian.org/ArmEabiPort

gcc 4.0.1 may or may not work with gcj.  Sorry.

Andrew.

oh.. Great andrew... :) thanks again for the valuable info..
and can u please detail it """ what is new ARM EABI and what is OLD""" ?
is there something wrong in my configuring options ? or the only problem is GCC verison i am using ? or some any other reasons ?
and will you please suggest me what version of GCC can i cross compile for ARM architecture to get GCJ (cross compiled) to be working...
i.e. if i compile my java code using cross compiled GCJ (which will generate the executable for ARM) .. the executable should give the output.....
Please give me some links or share your knowledge regarding how to Cross compile GCJ for ARM with working version specifications and configuring options...
thanks again.. :)

Re: problem with GCJ while running java code

by Andrew Haley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

gforgcc wrote:

>
> Andrew Haley wrote:
>> I recently finished the work to port gcj to ARM.  It was on
>> the new ARM EABI, not the "old" one (which is what I think you have).
>>
>> http://wiki.debian.org/ArmEabiPort
>>
>> gcc 4.0.1 may or may not work with gcj.  Sorry.
>>
>> Andrew.
>>
>>
>
>
> oh.. Great andrew... :) thanks again for the valuable info..
> and can u please detail it """ what is new ARM EABI and what is OLD""" ?

That's why I posted the link.

> is there something wrong in my configuring options ? or the only problem is
> GCC verison i am using ? or some any other reasons ?

I have no way to know.

> and will you please suggest me what version of GCC can i cross compile for
> ARM architecture to get GCJ (cross compiled) to be working...

Top of trunk, i.e. http://gcc.gnu.org/svn/gcc/trunk

Get it with

svn co http://gcc.gnu.org/svn/gcc/trunk

> i.e. if i compile my java code using cross compiled GCJ (which will generate
> the executable for ARM) .. the executable should give the output.....
> Please give me some links or share your knowledge regarding how to Cross
> compile GCJ for ARM with working version specifications and configuring
> options...

Cross compiling for ARM Linux is easy.  Here's how to do it on
Fedora 8.

You already have a cross-linker, assembler, etc.  Make sure they're
in your path.

Download http://ftp.linux.org.uk/pub/linux/arm/fedora/rootfs/rootfs-f8.tar.bz2
and unpack it:

cd /local/x-arm-gcc/rootfs-f8
tar xf ~/rootfs-f8.tar.bz2

In the top level directory of the gcc source, do:

./contrib/download_ecj

Build gcc in a clean directory with --with-sysroot= pointing at your ARM
root filesystem:

/home/aph/gcc/trunk/configure --prefix=/local/x-arm-gcc/install \
--with-sysroot=/local/x-arm-gcc/rootfs-f8 --disable-libssp --disable-libgomp \
--disable-libmudflap --enable-libgcj --disable-bootstrap --disable-multilib \
--disable-static --disable-sjlj-exceptions --target=arm-linux-gnueabi --enable-languages=c,c++,java

make

make install

This should work equally well for Debian, etc.  You can use the root FS
from any ARM EABI Linux system.

Testing, first compiling on the x86 host:

$ /local/x-arm-gcc/install/bin/arm-linux-gnueabi-gcj Hello.java  --main=Hello

And then running on the target, with the a.out we just made:

$ ./a.out
Hello, World!

Andrew.


Re: problem with GCJ while running java code

by gforgcc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Andrew Haley wrote:
Build gcc in a clean directory with --with-sysroot= pointing at your ARM
root filesystem:

/home/aph/gcc/trunk/configure --prefix=/local/x-arm-gcc/install \
--with-sysroot=/local/x-arm-gcc/rootfs-f8 --disable-libssp --disable-libgomp \
--disable-libmudflap --enable-libgcj --disable-bootstrap --disable-multilib \
--disable-static --disable-sjlj-exceptions --target=arm-linux-gnueabi --enable-languages=c,c++,java

make

make install

This should work equally well for Debian, etc.  You can use the root FS
from any ARM EABI Linux system.

Testing, first compiling on the x86 host:

$ /local/x-arm-gcc/install/bin/arm-linux-gnueabi-gcj Hello.java  --main=Hello

And then running on the target, with the a.out we just made:

$ ./a.out
Hello, World!
Andrew.
woow... very useful info... :) :) i will try all these things and get back if i have some problems regarding this...
thanks... :)

Re: problem with GCJ while running java code

by gforgcc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Andrew Haley wrote:
Build gcc in a clean directory with --with-sysroot= pointing at your ARM
root filesystem:

/home/aph/gcc/trunk/configure --prefix=/local/x-arm-gcc/install \
--with-sysroot=/local/x-arm-gcc/rootfs-f8 --disable-libssp --disable-libgomp \
--disable-libmudflap --enable-libgcj --disable-bootstrap --disable-multilib \
--disable-static --disable-sjlj-exceptions --target=arm-linux-gnueabi --enable-languages=c,c++,java

make
Hi Andrew
i faced some problems while building when i tried the above steps what you told.. Here is the log of the error messages..(I have configured with the options as you have told above.)

current directory is /home/developer/downloads/build_dir

../gcc-4.0.1/configure --prefix=/home/developer/downloads/install_gcc_dir
--with-sysroot=/home/developer/downloads/rootfs-f8 --disable-libssp --disable-libgomp
--disable-libmudflap --enable-libgcj --disable-bootstrap --disable-multilib
--disable-static --disable-sjlj-exceptions --target=arm-linux-gnueabi
--enable-languages=c,c++,java

and then did a make in the /home/developer/downloads/build_dir

after sometime it gave these error messages...


        HEADERS="ansidecl.h" DEFINES="" \
        /bin/sh ../../gcc-4.0.1/gcc/mkconfig.sh tconfig.h
/home/developer/downloads/build_dir/gcc/xgcc -B/home/developer/downloads/build_dir/gcc/ -B/home/developer/downloads/install_gcc_dir/arm-linux-gnueabi/bin/ -B/home/developer/downloads/install_gcc_dir/arm-linux-gnueabi/lib/ -isystem /home/developer/downloads/install_gcc_dir/arm-linux-gnueabi/include -isystem /home/developer/downloads/install_gcc_dir/arm-linux-gnueabi/sys-include -O2 -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -I. -I. -I../../gcc-4.0.1/gcc -I../../gcc-4.0.1/gcc/. -I../../gcc-4.0.1/gcc/../include -I../../gcc-4.0.1/gcc/../libcpp/include   -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-unit-at-a-time  \
           -c ../../gcc-4.0.1/gcc/crtstuff.c -DCRT_BEGIN \
          -o crtbegin.o
/tmp/cc4Kl0Qv.s: Assembler messages:
/tmp/cc4Kl0Qv.s:36: Error: junk at end of line, first unrecognized character is `@'
/tmp/cc4Kl0Qv.s:37: Error: junk at end of line, first unrecognized character is `@'
/tmp/cc4Kl0Qv.s:38: Error: no such instruction: `stmfd sp!,{r4,r5,lr}'
/tmp/cc4Kl0Qv.s:39: Error: no such instruction: `ldr r5,.L13'
/tmp/cc4Kl0Qv.s:40: Error: no such instruction: `ldrb r3,[r5,'
/tmp/cc4Kl0Qv.s:41: Error: expecting operand after ','; got nothing
/tmp/cc4Kl0Qv.s:42: Error: no such instruction: `ldmnefd sp!,{r4,r5,pc}'
/tmp/cc4Kl0Qv.s:43: Error: no such instruction: `ldr r4,.L13+4'
/tmp/cc4Kl0Qv.s:44: Error: no such instruction: `ldr r3,[r4,'
/tmp/cc4Kl0Qv.s:45: Error: no such instruction: `ldr r2,[r3,'
/tmp/cc4Kl0Qv.s:46: Error: expecting operand after ','; got nothing
/tmp/cc4Kl0Qv.s:47: Error: no such instruction: `beq .L5'
/tmp/cc4Kl0Qv.s:49: Error: too many memory references for `add'
/tmp/cc4Kl0Qv.s:50: Error: invalid char '[' beginning operand 2 `[r4'
/tmp/cc4Kl0Qv.s:51: Error: too many memory references for `mov'
/tmp/cc4Kl0Qv.s:52: Error: too many memory references for `mov'
/tmp/cc4Kl0Qv.s:53: Error: no such instruction: `ldr r3,[r4,'
/tmp/cc4Kl0Qv.s:54: Error: no such instruction: `ldr r2,[r3,'
/tmp/cc4Kl0Qv.s:55: Error: expecting operand after ','; got nothing
/tmp/cc4Kl0Qv.s:56: Error: no such instruction: `bne .L9'
/tmp/cc4Kl0Qv.s:58: Error: no such instruction: `ldr r3,.L13+8'
/tmp/cc4Kl0Qv.s:59: Error: expecting operand after ','; got nothing
/tmp/cc4Kl0Qv.s:60: Error: no such instruction: `ldrne r0,.L13+12'
/tmp/cc4Kl0Qv.s:61: Error: no such instruction: `movne lr,pc'
/tmp/cc4Kl0Qv.s:62: Error: no such instruction: `movne pc,r3'
/tmp/cc4Kl0Qv.s:64: Error: expecting operand after ','; got nothing
/tmp/cc4Kl0Qv.s:65: Error: invalid char '[' beginning operand 2 `[r5'
/tmp/cc4Kl0Qv.s:66: Error: no such instruction: `ldmfd sp!,{r4,r5,pc}'
/tmp/cc4Kl0Qv.s:77: Error: junk at end of line, first unrecognized character is `@'
/tmp/cc4Kl0Qv.s:78: Error: junk at end of line, first unrecognized character is `@'
/tmp/cc4Kl0Qv.s:79: Error: invalid char '[' beginning operand 2 `[sp'
/tmp/cc4Kl0Qv.s:82: Error: no such instruction: `bl __do_global_dtors_aux'
/tmp/cc4Kl0Qv.s:85: Error: no such instruction: `ldr pc,[sp],'
/tmp/cc4Kl0Qv.s:91: Error: junk at end of line, first unrecognized character is `@'
/tmp/cc4Kl0Qv.s:92: Error: junk at end of line, first unrecognized character is `@'
/tmp/cc4Kl0Qv.s:93: Error: no such instruction: `ldr r3,.L24'
/tmp/cc4Kl0Qv.s:94: Error: expecting operand after ','; got nothing
/tmp/cc4Kl0Qv.s:95: Error: invalid char '[' beginning operand 2 `[sp'
/tmp/cc4Kl0Qv.s:96: Error: no such instruction: `ldr r0,.L24+4'
/tmp/cc4Kl0Qv.s:97: Error: no such instruction: `ldr r1,.L24+8'
/tmp/cc4Kl0Qv.s:98: Error: no such instruction: `movne lr,pc'
/tmp/cc4Kl0Qv.s:99: Error: no such instruction: `movne pc,r3'
/tmp/cc4Kl0Qv.s:101: Error: no such instruction: `ldr r0,.L24+12'
/tmp/cc4Kl0Qv.s:102: Error: no such instruction: `ldr r3,[r0,'
/tmp/cc4Kl0Qv.s:103: Error: expecting operand after ','; got nothing
/tmp/cc4Kl0Qv.s:104: Error: no such instruction: `ldr r3,.L24+16'
/tmp/cc4Kl0Qv.s:105: Error: no such instruction: `ldreq pc,[sp],'
/tmp/cc4Kl0Qv.s:106: Error: expecting operand after ','; got nothing
/tmp/cc4Kl0Qv.s:107: Error: no such instruction: `ldreq pc,[sp],'
/tmp/cc4Kl0Qv.s:108: Error: too many memory references for `mov'
/tmp/cc4Kl0Qv.s:109: Error: too many memory references for `mov'
/tmp/cc4Kl0Qv.s:110: Error: no such instruction: `ldr pc,[sp],'
/tmp/cc4Kl0Qv.s:122: Error: junk at end of line, first unrecognized character is `@'
/tmp/cc4Kl0Qv.s:123: Error: junk at end of line, first unrecognized character is `@'
/tmp/cc4Kl0Qv.s:124: Error: invalid char '[' beginning operand 2 `[sp'
/tmp/cc4Kl0Qv.s:127: Error: no such instruction: `bl frame_dummy'
/tmp/cc4Kl0Qv.s:130: Error: no such instruction: `ldr pc,[sp],'
make[1]: *** [crtbegin.o] Error 1
make[1]: Leaving directory `/home/developer/downloads/build_dir/gcc'
make: *** [all-gcc] Error 2

Re: problem with GCJ while running java code

by Andrew Haley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

gforgcc wrote:

>
>
> Andrew Haley wrote:
>> Build gcc in a clean directory with --with-sysroot= pointing at your ARM
>> root filesystem:
>>
>> /home/aph/gcc/trunk/configure --prefix=/local/x-arm-gcc/install \
>> --with-sysroot=/local/x-arm-gcc/rootfs-f8 --disable-libssp
>> --disable-libgomp \
>> --disable-libmudflap --enable-libgcj --disable-bootstrap
>> --disable-multilib \
>> --disable-static --disable-sjlj-exceptions --target=arm-linux-gnueabi
>> --enable-languages=c,c++,java
>>
>> make
>>
>>
>
> Hi Andrew
> i faced some problems while building when i tried the above steps what you
> told.. Here is the log of the error messages..(I have configured with the
> options as you have told above.)
>
> current directory is /home/developer/downloads/build_dir
>
> ../gcc-4.0.1/configure --prefix=/home/developer/downloads/install_gcc_dir
> --with-sysroot=/home/developer/downloads/rootfs-f8 --disable-libssp
> --disable-libgomp
> --disable-libmudflap --enable-libgcj --disable-bootstrap --disable-multilib
> --disable-static --disable-sjlj-exceptions --target=arm-linux-gnueabi
> --enable-languages=c,c++,java
>
> and then did a make in the /home/developer/downloads/build_dir
>
> after sometime it gave these error messages...
>
>
>         HEADERS="ansidecl.h" DEFINES="" \
>         /bin/sh ../../gcc-4.0.1/gcc/mkconfig.sh tconfig.h
> /home/developer/downloads/build_dir/gcc/xgcc
> -B/home/developer/downloads/build_dir/gcc/
> -B/home/developer/downloads/install_gcc_dir/arm-linux-gnueabi/bin/
> -B/home/developer/downloads/install_gcc_dir/arm-linux-gnueabi/lib/ -isystem
> /home/developer/downloads/install_gcc_dir/arm-linux-gnueabi/include -isystem
> /home/developer/downloads/install_gcc_dir/arm-linux-gnueabi/sys-include -O2
> -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes
> -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -I. -I.
> -I../../gcc-4.0.1/gcc -I../../gcc-4.0.1/gcc/.
> -I../../gcc-4.0.1/gcc/../include -I../../gcc-4.0.1/gcc/../libcpp/include  
> -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions
> -fno-zero-initialized-in-bss -fno-unit-at-a-time  \
>            -c ../../gcc-4.0.1/gcc/crtstuff.c -DCRT_BEGIN \
>           -o crtbegin.o
> /tmp/cc4Kl0Qv.s: Assembler messages:
> /tmp/cc4Kl0Qv.s:36: Error: junk at end of line, first unrecognized character

You're picking up the assembler for your host machine, not the cross-assembler
for your target.

When you run configure, make sure that your target binutils are in the PATH.
Alternatively, you can use --with-ld=, --with-as=, etc.

The output of configure will tell you which ld, as, etc. it's using.  Make sure
these are the target versions.

Andrew.

Re: problem with GCJ while running java code

by gforgcc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Andrew Haley wrote:
You're picking up the assembler for your host machine, not the cross-assembler
for your target.

When you run configure, make sure that your target binutils are in the PATH.
Alternatively, you can use --with-ld=, --with-as=, etc.

The output of configure will tell you which ld, as, etc. it's using.  Make sure
these are the target versions.

Andrew.
oh.. ya thanks for that info Andrew...:)
and again it is giving some other problems...

i configured --with-ld=<ld in the rootfs-f8 usr/bin/ folder> i.e. --with-ld=/home/developer/downloads/rootfs-f8/usr/bin/ld
and similarly for --with-as --with-ar --with-nm too.....

during the time of compilation after sometime it tells
/scratchbox/tools/bin/misc_runner: /targets/links/scratchbox.config: No such file or directory :(
(is this because i am running outside scratchbox ?)

and when i tried running inside scratchbox it is telling
/lib/ld-linux.so.3 not found...

how to proceed further ?
thanks again.. :)

Re: problem with GCJ while running java code

by Andrew Haley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

gforgcc wrote:

>
>
> Andrew Haley wrote:
>>
>> You're picking up the assembler for your host machine, not the
>> cross-assembler
>> for your target.
>>
>> When you run configure, make sure that your target binutils are in the
>> PATH.
>> Alternatively, you can use --with-ld=, --with-as=, etc.
>>
>> The output of configure will tell you which ld, as, etc. it's using.  Make
>> sure
>> these are the target versions.
>>
>> Andrew.
>>
>>
> oh.. ya thanks for that info Andrew...:)
> and again it is giving some other problems...
>
> i configured --with-ld=<ld in the rootfs-f8 usr/bin/ folder> i.e.
> --with-ld=/home/developer/downloads/rootfs-f8/usr/bin/ld
> and similarly for --with-as --with-ar --with-nm too.....

Eh?  Surely those versions won't run on the host machine.  These are
for the target.

> during the time of compilation after sometime it tells
> /scratchbox/tools/bin/misc_runner: /targets/links/scratchbox.config: No such
> file or directory :(
> (is this because i am running outside scratchbox ?)
>
> and when i tried running inside scratchbox it is telling
> /lib/ld-linux.so.3 not found...

Is the root fs you built the x-compiler with the same as the root
fs you're running on?

Andrew.

Re: problem with GCJ while running java code

by Cesc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andrew Haley wrote:
Build gcc in a clean directory with --with-sysroot= pointing at your ARM
root filesystem:

/home/aph/gcc/trunk/configure --prefix=/local/x-arm-gcc/install \
--with-sysroot=/local/x-arm-gcc/rootfs-f8 --disable-libssp --disable-libgomp \
--disable-libmudflap --enable-libgcj --disable-bootstrap --disable-multilib \
--disable-static --disable-sjlj-exceptions --target=arm-linux-gnueabi --enable-languages=c,c++,java

make
Hi Andrew,

thanks for your hint.

I'm getting this error when I do make:

../.././gcc/config/arm/arm.c: In function ‘thumb_find_work_register’:
../.././gcc/config/arm/arm.c:3567: error: ‘struct function’ has no member named ‘args_info’
make[2]: *** [arm.o] Error 1
make[2]: Leaving directory `/root/tmp/trunk/host-i686-pc-linux-gnu/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/root/tmp/trunk'
make: *** [all] Error 2


Config:

./configure --prefix=/root/tmp/f8/install --with-sysroot=/root/tmp/f8/rootfs-f8/ --disable-libssp --disable-libgomp --disable-libmudflap --enable-libgcj --disable-bootstrap --disable-multilib --disable-static --disable-sjlj-exceptions --target=arm-linux-gnueabi --enable-languages=c,c++,java --with-build-time-tools=/root/tmp/f8/rootfs-f8/usr/bin/

I'm doing this with Kubuntu (2.6.22.4), does it matter? should I try with fedora 8?

Francesco


Re: problem with GCJ while running java code

by Andrew Haley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Cesc wrote:

>
> Andrew Haley wrote:
>>
>> Build gcc in a clean directory with --with-sysroot= pointing at your ARM
>> root filesystem:
>>
>> /home/aph/gcc/trunk/configure --prefix=/local/x-arm-gcc/install \
>> --with-sysroot=/local/x-arm-gcc/rootfs-f8 --disable-libssp
>> --disable-libgomp \
>> --disable-libmudflap --enable-libgcj --disable-bootstrap
>> --disable-multilib \
>> --disable-static --disable-sjlj-exceptions --target=arm-linux-gnueabi
>> --enable-languages=c,c++,java
>>
>> make
>>
>>
>
> Hi Andrew,
>
> thanks for your hint.
>
> I'm getting this error when I do make:
>
> ../.././gcc/config/arm/arm.c: In function ‘thumb_find_work_register’:
> ../.././gcc/config/arm/arm.c:3567: error: ‘struct function’ has no member
> named ‘args_info’
> make[2]: *** [arm.o] Error 1
> make[2]: Leaving directory `/root/tmp/trunk/host-i686-pc-linux-gnu/gcc'
> make[1]: *** [all-gcc] Error 2
> make[1]: Leaving directory `/root/tmp/trunk'
> make: *** [all] Error 2
>
>
> Config:
>
> ./configure --prefix=/root/tmp/f8/install

When I said "Build gcc in a clean directory" above *I really meant it*.

Don't configure in srcdir.  I don't know if this is the cause of your
problem, but don't do it.

> --with-sysroot=/root/tmp/f8/rootfs-f8/ --disable-libssp --disable-libgomp
> --disable-libmudflap --enable-libgcj --disable-bootstrap --disable-multilib
> --disable-static --disable-sjlj-exceptions --target=arm-linux-gnueabi
> --enable-languages=c,c++,java
> --with-build-time-tools=/root/tmp/f8/rootfs-f8/usr/bin/
>
> I'm doing this with Kubuntu (2.6.22.4), does it matter? should I try with
> fedora 8?

That shouldn't make any difference.

Andrew.

Re: problem with GCJ while running java code

by Cesc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Andrew Haley wrote:
That shouldn't make any difference.

Andrew.
Wow I managed to compile arm-linux-gcj, thanks a lot for your help.

However I'm getting this error when I try to compile a java class:

./arm-linux-gnueabi-gcj /root/testfiles/HelloWorld.java

arm-linux-gnueabi-gcj: error trying to exec 'ecj1': execvp: No such file or directory

I did /contrib/.download_ecj before doing configure and make

Any ideas?

Thanks again,

Francesco





Re: problem with GCJ while running java code

by gnu_andrew :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 14/04/2008, Cesc <ffileppo@...> wrote:

>
>
>
>  Andrew Haley wrote:
>  >
>  >
>  > That shouldn't make any difference.
>  >
>  > Andrew.
>  >
>  >
>
>
> Wow I managed to compile arm-linux-gcj, thanks a lot for your help.
>
>  However I'm getting this error when I try to compile a java class:
>
>  ./arm-linux-gnueabi-gcj /root/testfiles/HelloWorld.java
>
>  arm-linux-gnueabi-gcj: error trying to exec 'ecj1': execvp: No such file or
>  directory
>
>  I did /contrib/.download_ecj before doing configure and make
>
>  Any ideas?
>
>  Thanks again,
>
>  Francesco
>
>
>
>
>
>
>  --
>  View this message in context: http://www.nabble.com/problem-with-GCJ-while-running-java-code-tp15455624p16670521.html
>
> Sent from the gcc - java mailing list archive at Nabble.com.
>
>

download_ecj will obtain the required ecj JAR file.  ecj1 is a script
or binary that executes the GCCMain class in this  First check that
there isn't one in your GCJ build, but not on your path.  If you can't
find one, a script called ecj1 containing:

#!/bin/sh

gij --classpath <path to ecj.jar> \
   org.eclipse.jdt.internal.compiler.batch.GCCMain \
   ${1+"$@"}

or

gcj -oecj1 --main=org.eclipse.jdt.internal.compiler.batch.GCCMain ecj.jar

should suffice. gcj depends on ecj1 for source to bytecode compilation.
--
Andrew :-)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8

Re: problem with GCJ while running java code

by Cesc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Andrew John Hughes wrote:
download_ecj will obtain the required ecj JAR file.  ecj1 is a script
or binary that executes the GCCMain class in this  First check that
there isn't one in your GCJ build, but not on your path.  If you can't
find one, a script called ecj1 containing:

#!/bin/sh

gij --classpath <path to ecj.jar> \
   org.eclipse.jdt.internal.compiler.batch.GCCMain \
   ${1+"$@"}

or

gcj -oecj1 --main=org.eclipse.jdt.internal.compiler.batch.GCCMain ecj.jar
Thank you very much Andrew, I really appreciate your help.

I did ./arm-linux-gnueabi-gcj -oecj1 --main=org.eclipse.jdt.internal.compiler.batch.GCCMain ecj.jar

but now I'm getting this error:

as: unrecognized option `-meabi=4'

Francesco


Re: problem with GCJ while running java code

by Andrew Haley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Cesc wrote:

>
>
> Andrew John Hughes wrote:
>>
>> download_ecj will obtain the required ecj JAR file.  ecj1 is a script
>> or binary that executes the GCCMain class in this  First check that
>> there isn't one in your GCJ build, but not on your path.  If you can't
>> find one, a script called ecj1 containing:
>>
>> #!/bin/sh
>>
>> gij --classpath <path to ecj.jar> \
>>    org.eclipse.jdt.internal.compiler.batch.GCCMain \
>>    ${1+"$@"}
>>
>> or
>>
>> gcj -oecj1 --main=org.eclipse.jdt.internal.compiler.batch.GCCMain ecj.jar
>>
>>
>
> Thank you very much Andrew, I really appreciate your help.
>
> I did ./arm-linux-gnueabi-gcj -oecj1
> --main=org.eclipse.jdt.internal.compiler.batch.GCCMain ecj.jar
>
> but now I'm getting this error:
>
> as: unrecognized option `-meabi=4'

Works for me.  Maybe you have an old version of as?  What does

  as -version?

say?  

What does

  arm-linux-gnueabi-gcj -verbose -save-temps -oecj1 --main=org.eclipse.jdt.internal.compiler.batch.GCCMain ecj.jar

say?

Andrew.

Re: problem with GCJ while running java code

by Cesc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andrew Haley wrote:
Works for me.  Maybe you have an old version of as?  What does

  as -version?

say?  

What does

  arm-linux-gnueabi-gcj -verbose -save-temps -oecj1 --main=org.eclipse.jdt.internal.compiler.batch.GCCMain ecj.jar

say?

Andrew.
Hi,

I did

./arm-linux-gnueabi-gcj --verbose -save-temps -oecj1 --main=org.eclipse.jdt.internal.compiler.batch.GCCMain ecj.jar

and it says

Using built-in specs.
Reading specs from /root/tmp/f8/install/lib/gcc/arm-linux-gnueabi/4.4.0/../../../../arm-linux-gnueabi/lib/libgcj.spec
rename spec startfile to startfileorig
rename spec lib to liborig
Target: arm-linux-gnueabi
Configured with: ../configure --prefix=/root/tmp/f8/install --with-sysroot=/mnt/new --disable-libssp --disable-libgomp --disable-libmudflap --enable-libgcj --disable-bootstrap --disable-multilib --disable-static --disable-sjlj-exceptions --target=arm-linux-gnueabi --enable-languages=c,c++,java --with-build-time-tools=/root/tmp/buildroot/build_arm/staging_dir/usr/arm-linux-uclibcgnueabi/bin --disable-libstdcxx-debug
Thread model: posix
gcc version 4.4.0 20080411 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-oecj1' '-fbootclasspath=./:/root/tmp/f8/install/share/java/libgcj-4.4.0.jar' '-g1' '-shared-libgcc'
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-oecj1' '-fbootclasspath=./:/root/tmp/f8/install/share/java/libgcj-4.4.0.jar' '-g1' '-shared-libgcc'
 /root/tmp/f8/install/libexec/gcc/arm-linux-gnueabi/4.4.0/jc1 ecj.jar -fuse-divide-subroutine -fcheck-references -fuse-boehm-gc -fkeep-inline-functions -quiet -dumpbase ecj.jar -auxbase ecj -g1 -version -fbootclasspath=./:/root/tmp/f8/install/share/java/libgcj-4.4.0.jar -faux-classpath ecj.zip -o ecj.s
GNU Java (GCC) version 4.4.0 20080411 (experimental) (arm-linux-gnueabi)
        compiled by GNU C version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2), GMP version 4.2.1, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Class path starts here:
    ecj.zip/ (zip)
    ./ (system)
    /root/tmp/f8/install/share/java/libgcj-4.4.0.jar/ (system) (zip)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-oecj1' '-fbootclasspath=./:/root/tmp/f8/install/share/java/libgcj-4.4.0.jar' '-g1' '-shared-libgcc'
 as -meabi=4 -o ecj.o ecj.s
as: unrecognized option `-meabi=4'



Which "as" are you referring to?

The one in my /usr/bin says:

GNU assembler (GNU Binutils for Ubuntu) 2.18
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `i486-linux-gnu'.

while the one in my toolchain (/root/tmp/buildroot/build_arm/staging_dir/usr/arm-linux-uclibcgnueabi/bin says:

GNU assembler (GNU Binutils) 2.18
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `arm-linux-uclibcgnueabi'.


 I guess gcj is using the one from /usr/bin. Is this correct?

Thank you,

Francesco

Re: problem with GCJ while running java code

by Andrew Haley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Cesc wrote:

>
> Andrew Haley wrote:
>>
>> Works for me.  Maybe you have an old version of as?  What does
>>
>>   as -version?
>>
>> say?  
>>
>> What does
>>
>>   arm-linux-gnueabi-gcj -verbose -save-temps -oecj1
>> --main=org.eclipse.jdt.internal.compiler.batch.GCCMain ecj.jar
>>
>> say?
>>
>> Andrew.
>>
>>
>
> Hi,
>
> I did
>
> ./arm-linux-gnueabi-gcj --verbose -save-temps -oecj1
> --main=org.eclipse.jdt.internal.compiler.batch.GCCMain ecj.jar
>
> and it says
>
> Using built-in specs.
> Reading specs from
> /root/tmp/f8/install/lib/gcc/arm-linux-gnueabi/4.4.0/../../../../arm-linux-gnueabi/lib/libgcj.spec
> rename spec startfile to startfileorig
> rename spec lib to liborig
> Target: arm-linux-gnueabi
> Configured with: ../configure --prefix=/root/tmp/f8/install
> --with-sysroot=/mnt/new --disable-libssp --disable-libgomp
> --disable-libmudflap --enable-libgcj --disable-bootstrap --disable-multilib
> --disable-static --disable-sjlj-exceptions --target=arm-linux-gnueabi
> --enable-languages=c,c++,java
> --with-build-time-tools=/root/tmp/buildroot/build_arm/staging_dir/usr/arm-linux-uclibcgnueabi/bin
> --disable-libstdcxx-debug
> Thread model: posix
> gcc version 4.4.0 20080411 (experimental) (GCC)
> COLLECT_GCC_OPTIONS='-v' '-save-temps' '-oecj1'
> '-fbootclasspath=./:/root/tmp/f8/install/share/java/libgcj-4.4.0.jar' '-g1'
> '-shared-libgcc'
> COLLECT_GCC_OPTIONS='-v' '-save-temps' '-oecj1'
> '-fbootclasspath=./:/root/tmp/f8/install/share/java/libgcj-4.4.0.jar' '-g1'
> '-shared-libgcc'
>  /root/tmp/f8/install/libexec/gcc/arm-linux-gnueabi/4.4.0/jc1 ecj.jar
> -fuse-divide-subroutine -fcheck-references -fuse-boehm-gc
> -fkeep-inline-functions -quiet -dumpbase ecj.jar -auxbase ecj -g1 -version
> -fbootclasspath=./:/root/tmp/f8/install/share/java/libgcj-4.4.0.jar
> -faux-classpath ecj.zip -o ecj.s
> GNU Java (GCC) version 4.4.0 20080411 (experimental) (arm-linux-gnueabi)
>         compiled by GNU C version 4.1.3 20070929 (prerelease) (Ubuntu
> 4.1.2-16ubuntu2), GMP version 4.2.1, MPFR version 2.3.1.
> GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
> Class path starts here:
>     ecj.zip/ (zip)
>     ./ (system)
>     /root/tmp/f8/install/share/java/libgcj-4.4.0.jar/ (system) (zip)
> COLLECT_GCC_OPTIONS='-v' '-save-temps' '-oecj1'
> '-fbootclasspath=./:/root/tmp/f8/install/share/java/libgcj-4.4.0.jar' '-g1'
> '-shared-libgcc'
>  as -meabi=4 -o ecj.o ecj.s
> as: unrecognized option `-meabi=4'
>
>
>
> Which "as" are you referring to?
>
> The one in my /usr/bin says:
>
> GNU assembler (GNU Binutils for Ubuntu) 2.18
> Copyright 2007 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License version 3 or later.
> This program has absolutely no warranty.
> This assembler was configured for a target of `i486-linux-gnu'.
>
> while the one in my toolchain
> (/root/tmp/buildroot/build_arm/staging_dir/usr/arm-linux-uclibcgnueabi/bin
> says:
>
> GNU assembler (GNU Binutils) 2.18
> Copyright 2007 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License version 3 or later.
> This program has absolutely no warranty.
> This assembler was configured for a target of `arm-linux-uclibcgnueabi'.
>
>
>  I guess gcj is using the one from /usr/bin. Is this correct?

Obviously not, no:

> This assembler was configured for a target of `i486-linux-gnu'.

Ah, your gcc target and your as target don't match.  arm-linux-gnueabi and
arm-linux-uclibcgnueabi; this is bad.  It's really important to configure
binutils and gcc for the *same( target.

Anyway, you should be able to get it to work by making sure your PATH is set
correctly when builfing for ARM.

Andrew.
< Prev | 1 - 2 | Next >