gcj on FreeBSD - unresolved externals with static link

Jan Mikkelsen janm@transactionware.com
Mon Oct 8 15:45:00 GMT 2001


Hi,
I have built gcj on FreeBSD 4.3 (3.0.1 and the 20011001 snapshot).
Gcj itself seems to run fine, but with shared libraries the resultant
program dumps core, and with static linking, there are unresolved externals
at the link step.
I can see that it is being used because other symbols from libgcj are being
resolved during the static linking process. This is the output from a
static compile:
$ /pkgs/gcc-3.0.1/bin/gcj -static --main=hello hello.java
/pkgs/gcc-3.0.1/lib/gcc-lib/i386-unknown-freebsd4.3/3.0.1/../../../libgcj.a(
Vector.o):/home/janm/Kits/gcc-3.0.1/libjava/java/util/Vector.java:232:
undefined reference to `java::util::List::class$'
/pkgs/gcc-3.0.1/lib/gcc-lib/i386-unknown-freebsd4.3/3.0.1/../../../libgcj.a(
AbstractList.o): In function
`java::util::AbstractList::equals(java::lang::Object*)':
/home/janm/Kits/gcc-3.0.1/libjava/java/util/AbstractList.java:88: undefined
reference to `java::util::List::class$'
/home/janm/Kits/gcc-3.0.1/libjava/java/util/AbstractList.java:91: undefined
reference to `java::util::List::class$'
/home/janm/Kits/gcc-3.0.1/libjava/java/util/AbstractList.java:91: undefined
reference to `java::util::List::class$'
/home/janm/Kits/gcc-3.0.1/libjava/java/util/AbstractList.java:95: undefined
reference to `java::util::List::class$'
/pkgs/gcc-3.0.1/lib/gcc-lib/i386-unknown-freebsd4.3/3.0.1/../../../libgcj.a(
AbstractList.o):/home/janm/Kits/gcc-3.0.1/libjava/java/util/AbstractList.jav
a:95: more undefined references to `java::util::List::class$' follow
collect2: ld returned 1 exit status
hello.java contains:
class hello {
 public static void main(String[] args) {
 System.out.println("hello, world");
 }
}
The compiler was built with:
.../configure --prefix=/pkgs/gcj-3.0.1 --enable-languages=c++,java --enable-
libgcj --disable-threads
Are there any other magic flags I should use to get it going on FreeBSD, or
are the other things I need to do?
Thanks,
Jan Mikkelsen


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /