This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

MIPS C++ bug


Hi.

I have encountered an issue with my gcc-3.2.3 mips port.  With the attached
testcase, I am seeing:

  [gp] mips-c++:>make clean;make
  rm -f libsomelib.so *.o someprog
  ntomips-g++ -shared -O2 -c somelib.cpp
  ntomips-g++ -shared -O2 -o libsomelib.so somelib.o
  ntomips-g++ -O2 -c someprog.cpp
  ntomips-g++ -O2 -o someprog -Wl,-R. someprog.o -L. -lsomelib
  ./libsomelib.so: undefined reference to `SomeCls::DEF_INST'
  collect2: ld returned 1 exit status
  make: *** [all] Error 1

It has to do with the .externs and optimization. DEF_INST is a public static
const int in class SomeCls. 

If I use -O0, or if I use -G0, then it works.  It fails with -O1, -O2, and -O3.

Could someone try this and let me know?  I have trimmed it down to a fairly
small testcase.  I don't have a working mips port of anything newer than
3.2.3, using binutils 2.12.1.

Thanks.
GP

Attachment: mips++.tgz
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]