http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #21 from Daniel Richard G. <skunk at iskunk dot org> 2012-07-23 
18:52:06 UTC ---
(In reply to comment #20)
> You could try adding this to ctype.cc around line 54

--- libstdc++-v3/src/c++98/ctype.cc.orig    2012-01-23 18:12:01.000000002 -0500
+++ libstdc++-v3/src/c++98/ctype.cc    2012-07-23 13:31:55.000000002 -0400
@@ -52,6 +52,8 @@

   const size_t ctype<char>::table_size;

+  inline template class ctype<char>;    // added by skunk
+
   ctype<char>::~ctype()
   { 
     _S_destroy_c_locale(_M_c_locale_ctype);


I rebuilt ctype.o and the libraries it goes into. Unfortunately, I still get
the link error. If I compare the output of "nm -A" on the old and new ctype.o
objects, I don't see a difference in the defined symbols.

The mangled form of "vtable for std::ctype<char>" is "_ZTVSt5ctypeIcE". If I
grep for that in "nm -A ctype.o", I see

    ctype.o:000017c0 d _ZTVSt5ctypeIcE.P8

but no instances without the ".P8" suffix. Looking through all the objects of
libstdc++, grep only turns up these:

    ctype_configure_char.o:         U _ZTVSt5ctypeIcE
    ctype_configure_char.o:000008a4 d _ZTVSt5ctypeIcE.P8

For comparison, I grepped for "_ZTVNSt6locale5facetE", the mangled form of
"vtable for std::locale::facet", and got the below:

    time_members.o:         U _ZTVNSt6locale5facetE
    time_members.o:00001778 d _ZTVNSt6locale5facetE.P8
    codecvt.o:         U _ZTVNSt6locale5facetE
    codecvt.o:000015d0 d _ZTVNSt6locale5facetE.P8
    locale-inst.o:         U _ZTVNSt6locale5facetE
    locale-inst.o:00023974 d _ZTVNSt6locale5facetE.P8
    wlocale-inst.o:         U _ZTVNSt6locale5facetE
    wlocale-inst.o:00023c2c d _ZTVNSt6locale5facetE.P8
    numeric_members.o:         U _ZTVNSt6locale5facetE
    numeric_members.o:00000e64 d _ZTVNSt6locale5facetE.P8
    ctype.o:         U _ZTVNSt6locale5facetE
    ctype.o:000017bc d _ZTVNSt6locale5facetE.P8
    monetary_members.o:         U _ZTVNSt6locale5facetE
    monetary_members.o:00001b80 d _ZTVNSt6locale5facetE.P8
    locale_init.o:         U _ZTVNSt6locale5facetE
    locale_init.o:00004a50 d _ZTVNSt6locale5facetE.P8
    ctype_configure_char.o:         U _ZTVNSt6locale5facetE
    ctype_configure_char.o:000008a0 d _ZTVNSt6locale5facetE.P8
    locale.o:00002b08 d _ZTVNSt6locale5facetE
    locale.o:00002b08 D _ZTVNSt6locale5facetE
    locale.o:00002b3c d _ZTVNSt6locale5facetE.P8


The fact of the symbol being a vtable for a template class appears to be
relevant. Maybe a different kind of explicit instantiation is needed?

Reply via email to