ld error with gcj cross-compiler

Aran Benner aran@iekey.nl
Fri May 24 00:48:00 GMT 2002


Hi,

After much efford, I've finally managed to set up GCC 3.1 as a
cross-compiler for a M68k-elf system (a M5272 system running uClinux, to be
precise). 

I've copied a test program, HelloWorld.java:

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

I've compiled and ran this program succesfully with a GCJ 3.0.4 native
compiler, but now, trying to compile it with a GCJ 3.1 cross-compiler I get
an error. Actually, I'm not exactly sure what compile options I have to
give, but I've tried multiple combinations, each with the same result. Here
is the most basic one:

[aran]# /usr/local/bin/m68k-elf-gcj -m5200 --main=HelloWorld -o HelloWorld
HelloWorld.java -v
Reading specs from /usr/local/lib/gcc-lib/m68k-elf/3.1/specs
Reading specs from libgcj.spec
rename spec lib to liborig
rename spec startfile to startfileorig
Configured with: /home/aran/gcc-3.1/configure --target=m68k-elf :
(reconfigured) /home/aran/gcc-3.1/configure --target=m68k-elf
--enable-languages=java : (reconfigured) /home/aran/gcc-3.1/configure
--target=m68k-elf --enable-languages=java --with-newlib : (reconfigured)
/home/aran/gcc-3.1/configure --target=m68k-elf --enable-languages=java
--with-newlib --disable-softfloat : (reconfigured)
/home/aran/gcc-3.1/configure --target=m68k-elf --enable-languages=c
--with-newlib --disable-shared --without-headers : (reconfigured)
/home/aran/gcc-3.1/configure --target=m68k-elf --prefix=/usr/local
--enable-languages=c,c++,java --with-local=prefix=/usr/local/m68k-elf :
(reconfigured) /home/aran/gcc-3.1/configure --target=m68k-elf
--prefix=/usr/local --enable-languages=c,c++,java
--with-local=prefix=/usr/local/m68k-elf
Thread model: single
gcc version 3.1
 /usr/local/lib/gcc-lib/m68k-elf/3.1/jc1 HelloWorld.java
-fuse-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions -quiet
-dumpbase HelloWorld.java -m5200 -g1 -version -o /tmp/ccA0SEL6.s
GNU Java version 3.1 (m68k-elf)
        compiled by GNU C version 2.95.3 20010315 (SuSE).
Class path starts here:
    ./
    /usr/local/share/java/libgcj-3.1.jar/ (system) (zip)
 /usr/local/lib/gcc-lib/m68k-elf/3.1/../../../../m68k-elf/bin/as
--traditional-format -m5200 -o /tmp/ccsHpNzb.o /tmp/ccA0SEL6.s
 /usr/local/lib/gcc-lib/m68k-elf/3.1/jvgenmain HelloWorldmain /tmp/ccCfXwKh.i
 /usr/local/lib/gcc-lib/m68k-elf/3.1/cc1 /tmp/ccCfXwKh.i -quiet -dumpbase
HelloWorldmain.c -m5200 -g1 -version -fdollars-in-identifiers -o
/tmp/ccA0SEL6.s
GNU CPP version 3.1 (cpplib) (68k, MIT syntax)
GNU C version 3.1 (m68k-elf)
        compiled by GNU C version 2.95.3 20010315 (SuSE).
 /usr/local/lib/gcc-lib/m68k-elf/3.1/../../../../m68k-elf/bin/as
--traditional-format -m5200 -o /tmp/cco3Y0iq.o /tmp/ccA0SEL6.s
 /usr/local/lib/gcc-lib/m68k-elf/3.1/collect2 -o HelloWorld
/usr/local/lib/gcc-lib/m68k-elf/3.1/crtbegin.o
-L/usr/local/lib/gcc-lib/m68k-elf/3.1/m5200
-L/usr/local/lib/gcc-lib/m68k-elf/3.1
-L/usr/local/lib/gcc-lib/m68k-elf/3.1/../../../../m68k-elf/lib/m5200
-L/usr/local/lib/gcc-lib/m68k-elf/3.1/../../../../m68k-elf/lib
/tmp/cco3Y0iq.o /tmp/ccsHpNzb.o -lgcc -lgcj -lm -lgcjgc -lzgcj -ldl -lgcc
-lc -lgcc /usr/local/lib/gcc-lib/m68k-elf/3.1/crtend.o
/usr/local/lib/gcc-lib/m68k-elf/3.1/../../../../m68k-elf/bin/ld.real:
cannot find -lgcj
collect2: ld returned 1 exit status
[aran]#


Any help would be greatly appreciated.

Regards,

Aran Benner




More information about the Java mailing list