PATCH: Recent conversion to explicit instantiation model broke alpha*-*-freebsd*

Loren James Rittle rittle@latour.rsch.comm.mot.com
Wed Feb 7 15:55:00 GMT 2001


Some static builds now fail with:

/usr/home/rittle/tmp/gcc-build-clerc-milon-0206/alpha-unknown-freebsd4.2/libstdc
++-v3/src/.libs/libstdc++.a(locale-inst.o):/usr/home/rittle/outside-cvs-src/egcs
/libstdc++-v3/include/bits/stl_uninitialized.h:190: undefined reference to `std:
:__normal_iterator<std::locale::facet**, std::vector<std::locale::facet*, std::a
llocator<std::locale::facet*> > > std::fill_n<std::__normal_iterator<std::locale
::facet**, std::vector<std::locale::facet*, std::allocator<std::locale::facet*> 
> >, unsigned long, std::locale::facet*>(std::__normal_iterator<std::locale::fac
et**, std::vector<std::locale::facet*, std::allocator<std::locale::facet*> > >, 
unsigned long, std::locale::facet* const&)'

and all shared builds now fail with something similar (except the
helpful source line reference to [...]/stl_uninitialized.h:190 is missing).

This patch fixes the problem for alpha*-*-freebsd*:

(However, it is unclear if all targets should be explicitly
 instantiating both [...]unsigned[...] and [...]unsigned long[...]
 versions of the template since, at least, alpha*-*-freebsd* doesn't
 appear to require the former.  I have no clue on how to trace
 template instantiations chains, statically or with gdb, back to the
 root typedef, which in this case is ``unsigned'' on most platforms
 but ``unsigned long'' on alpha*-*-freebsd* thus this is the best
 patch I can produce.)

2001-02-07  Loren J. Rittle  <ljrittle@acm.org>

	* src/locale-inst.cc: Explicitly instantiate more functions.

Index: libstdc++-v3/src/locale-inst.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/locale-inst.cc,v
retrieving revision 1.14
diff -c -r1.14 locale-inst.cc
*** locale-inst.cc	2001/02/07 01:54:21	1.14
--- locale-inst.cc	2001/02/07 22:44:52
***************
*** 306,311 ****
--- 306,318 ----
  	   unsigned, locale::facet* const&);
  
    template
+     __normal_iterator<locale::facet**, 
+                       vector<locale::facet*> >
+     fill_n(__normal_iterator<locale::facet**, 
+ 	                     vector<locale::facet*> >,
+ 	   unsigned long, locale::facet* const&);
+ 
+   template
      void
      fill (__normal_iterator<locale::facet**, 
  	                    vector<locale::facet*> >,


More information about the Libstdc++ mailing list