This is the mail archive of the
java-discuss@sources.redhat.com
mailing list for the Java project.
Re: Compile...
- To: Ricardo Costa <webrkcpwd at hotmail dot com>
- Subject: Re: Compile...
- From: Jeff Sturm <jeff dot sturm at commerceone dot com>
- Date: Tue, 26 Sep 2000 10:40:59 -0400
- CC: java-discuss at sources dot redhat dot com
- Organization: Commerce One
- References: <F81yeKzGZuNY1SWoBDy00004ab2@hotmail.com>
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