This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
libgcj.a link probs during build
- From: Nick Burrett <nick at sqrt dot co dot uk>
- To: java at gcc dot gnu dot org
- Date: Sat, 05 Mar 2005 15:38:53 +0000
- Subject: libgcj.a link probs during build
Hi,
I'm working on a port of Java to an operating system based on the
ARM/ELF target with a GNU binutils backend toolset. My target only
supports static libraries.
The version of GCC that I'm working from is 4.0.0 20050220.
During the build process, libgcj.a is sucessfully built, but when
linking jv-convert, I find many unresolved symbols. Here's one example:
./.libs/libgcj.a(jni.o)(.text+0xff0c): In function `_Jv_Method*
_Jv_JNI_GetAnyMethodID<false>(_Jv_JNIEnv*, java::lang::Class*, char
const*, char const*)':
jni.cc: undefined reference to
`java::lang::StringBuffer::StringBuffer(java::lang::String*)'
./.libs/libgcj.a(jni.o)(.text+0xffe4):jni.cc: undefined reference to
`java::lang::StringBuffer::class$'
./.libs/libgcj.a(jni.o)(.text+0x10198): In function `_Jv_Method*
_Jv_JNI_GetAnyMethodID<true>(_Jv_JNIEnv*, java::lang::Class*, char
const*, char const*)':
jni.cc: undefined reference to
`java::lang::StringBuffer::StringBuffer(java::lang::String*)'
As far as I can tell, this is happening because there are two object
files names StringBuffer.o and the linker is picking up the wrong one,
namely that from gnu/gcj/runtime rather than java/lang.
[nick@nick libjava]$ find . -name "StringBuffer.o"
./java/lang/StringBuffer.o
./gnu/gcj/runtime/StringBuffer.o
[nick@nick libjava]$
This is one example of many unresolved symbols, caused by duplicate
object file names.
Can anybody shed any light on this ?
Regards,
Nick.