Compile...

Jeff Sturm jeff.sturm@commerceone.com
Tue Sep 26 07:34:00 GMT 2000


Ricardo Costa wrote:
> I'm using Conectiva Linux, it's a very similar distribution of Redhat.
> The RPM that I used was from the distribution.
> And with gcc I can compile normaly.

OK.  The short answer is that it is a problem with your distribution.  If you
want to look more closely, examine the output of both "gcc -v" and "gcj -v". 
The important command here is collect2, which should be in the last line of
output.

On my system, I see (some lines omitted for brevity):

[jsturm@toronto tmp]$ gcc -v hello.c -o hello
...
/opt/gcj/lib/gcc-lib/alphapca56-unknown-linux-gnu/2.96/collect2 \
  -m elf64alpha -O1 -dynamic-linker /lib/ld-linux.so.2 -o hello \
  /usr/lib/crt1.o /usr/lib/crti.o \
  /opt/gcj/lib/gcc-lib/alphapca56-unknown-linux-gnu/2.96/crtbegin.o \
...

[jsturm@toronto tmp]$ gcj -v Hello.java --main=Hello -o hello
...
/opt/gcj/lib/gcc-lib/alphapca56-unknown-linux-gnu/2.96/collect2 \
  -m elf64alpha -O1 -dynamic-linker /lib/ld-linux.so.2 -o hello \
  /usr/lib/crt1.o /usr/lib/crti.o \
  /opt/gcj/lib/gcc-lib/alphapca56-unknown-linux-gnu/2.96/crtbegin.o \
...

The linker scripts are similar.  Both use the same crtbegin.o.  If your gcc and
gcj are different versions or are installed in different ${prefix} the paths
will not be the same, but you can see where it is looking for crtbegin.o.

If you can't get it to work, you have other options:

1) build gcj/libgcj from source (as explained on
http://sources.redhat.com/java/ )
2) find another binary RPM for Linux/x86
3) complain to your distribution vendor

--
Jeff Sturm
jeff.sturm@commerceone.com


More information about the Java mailing list