[java, 3.0.1]: BUG: Unresolved symbols with -O3 and higher

Manfred Hollstein manfred.h@gmx.net
Tue Jul 24 02:40:00 GMT 2001

Hi there,

I just reported my test results of a tree from the gcc-3_0-branch
as of yesterday. I defined GCJFLAGS="-O3 -march=i686 -fstrict-aliasing"
to build libgcj with some higher optimization enabled (among other
environment vars to control C and C++ opts). Everything went smooth
until linking jv-convert with the newly created libgcj.so; this fails

  ./.libs/libgcj.so: undefined reference to `java::util::Hashtable::getEntry(java::util::Map__U24_Entry*)'
  ./.libs/libgcj.so: undefined reference to `java::util::HashMap::getEntry(java::util::Map__U24_Entry*)'
  ./.libs/libgcj.so: undefined reference to `java::util::SubList::checkMod()'
  collect2: ld returned 1 exit status

These symbols are referenced in the following files:

  ./java/util/.libs/Hashtable.o:	U _ZN4java4util9Hashtable8getEntryEPNS0_14Map__U24_EntryE
  ./java/util/Hashtable.o:		U _ZN4java4util9Hashtable8getEntryEPNS0_14Map__U24_EntryE

  ./java/util/.libs/HashMap.o:		U _ZN4java4util7HashMap8getEntryEPNS0_14Map__U24_EntryE
  ./java/util/HashMap.o:		U _ZN4java4util7HashMap8getEntryEPNS0_14Map__U24_EntryE

  ./java/util/.libs/AbstractList.o:	U _ZN4java4util7SubList8checkModEv
  ./java/util/AbstractList.o:		U _ZN4java4util7SubList8checkModEv

Funnily, the methods in question are used _and_ defined (in Java source
code, but obviously not emitted) in the corresponding .java file. Using
"-O2" (ie. no automatic function inlining) doesn't show this problem.



More information about the Gcc-bugs mailing list