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]

Re: -frepo works great on egcs-1.1


On Sun, 16 Aug 1998, Mike Stump wrote:

> > Could you please try out the following testcase? I only see the problem 
> > when I use maps.
> 
> Works fine here with 8/15 compiler.  Try a make clean and a rebuild?
> 

My CVS tree is typically updated each day, and then rebuilt from scratch 
using the compiler from previous build to avoid any odd problems. I still
see it. If anybody's interested, I'll send more info.

Basically, this is what I see on a RH 5.1 box with latest patches applied
(glibc-2.0.7-19, binutils-2.9.1.0.4-2):

code:

  #include <map>
  using namespace std;
  int main () {
    map <int, int> foo;
    return 0;
  }

after compile and link:
  
frepo-bug.rpo entry for offending symbol:

O rb_tree<int, pair<int const, int>, select1st<pair<int const, int> >, less<int>, __default_alloc_template<1, 0> >::__erase(__rb_tree_node<pair<int const, int> > *)

../../gcc/xgcc -B../../gcc/ -L../../i686-pc-linux-gnu/libstdc++  frepo-bug.o  -lstdc++ -o frepo-bug
frepo-bug.o: In function `rb_tree<int, pair<int const, int>, select1st<pair<int const, int> >, less<int>, __default_alloc_template<true, 0> >::clear(void)':
frepo-bug.o(.rb_tree<int, pair<int const, int>, select1st<pair<int const, int> >, less<int>, __default_alloc_template<1, 0> >::gnu.linkonce.t.clear(void)+0x21): undefined reference to `rb_tree<int, pair<int const, int>, select1st<pair<int const, int> >, l
ess<int>, __default_alloc_template<true, 0> >::__erase(__rb_tree_node<pair<int const, int> > *)'
collect2: ld returned 1 exit status
make: *** [frepo-bug] Error 1

Now compare the undefined symbol in the object file, .rpo entry and the
eventual linker error message.

.o file undefined entry:
rb_tree<int, pair<int const, int>, select1st<pair<int const, int> >, 
  less<int>, __default_alloc_template<1, 0> >::
  __erase(__rb_tree_node<pair<int const, int> > *)

.rpo entry:
rb_tree<int, pair<int const, int>, select1st<pair<int const, int> >, 
  less<int>, __default_alloc_template<1, 0> >::
  __erase(__rb_tree_node<pair<int const, int> > *)

linker output:
rb_tree<int, pair<int const, int>, select1st<pair<int const, int> >, 
  less<int>, __default_alloc_template<true, 0> >::
  __erase(__rb_tree_node<pair<int const, int> > *)

The only difference is the first template arg to __default_alloc_template,
which is ``true'' (for threads) in .rpo file, but ``1'' in linker output.
That may just be due the difference between how ``nm --dem'' and c++filt
is demangling the symbols.

If I'm the only one seeing this problem on i686-pc-linux-gnu, I guess I'll
retreat until egcs-1.1 and retry. Again, this works on about 6 different
platforms I've tried so far (all non ELF).

Regards,
Mumit




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