This is the mail archive of the gcc-bugs@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]

[Bug libstdc++/14720] Undefined reference to `std::basic_ios<char, std::char_traits<char> >::_M_setstate(std::_Ios_Iostate)


------- Additional Comments From bkoz at gcc dot gnu dot org  2004-03-29 18:55 -------

I'm not quite sure where these _M_setstate references are coming from. From your
(huge) preprocessed source, I'm guessing:

%g++ 14720.ii
/tmp/ccv13WmI.o(.gnu.linkonce.t._ZSt7getlineIcSt11char_traitsIcEN5boost12smart_assert7Private18smart_assert_allocIcEEERSt13basic_istreamIT_T0_ESB_RSbIS8_S9_T1_ES8_+0x18f):
In function `std::basic_istream<char, std::char_traits<char> >&
std::getline<char, std::char_traits<char>,
boost::smart_assert::Private::smart_assert_alloc<char>
>(std::basic_istream<char, std::char_traits<char> >&, std::basic_string<char,
std::char_traits<char>, boost::smart_assert::Private::smart_assert_alloc<char>
>&, char)':
: undefined reference to `std::basic_ios<char, std::char_traits<char>
>::_M_setstate(std::_Ios_Iostate)'
collect2: ld returned 1 exit status

So, _M_setstate cannot be found. Because this works with static, and not shared,
this indicates something's up with the link map exports.

This doesn't happen with the 3.4/3.5 link maps:
%readelf -s --wide libstdc++.so.6.0.0 | grep _M_setstate
   885: 00057430    41 FUNC    WEAK   DEFAULT   11
_ZNSt9basic_iosIcSt11char_traitsIcEE11_M_setstateESt12_Ios_Iostate@@GLIBCXX_3.4
  1721: 000577b0    41 FUNC    WEAK   DEFAULT   11
_ZNSt9basic_iosIwSt11char_traitsIwEE11_M_setstateESt12_Ios_Iostate@@GLIBCXX_3.4
  1756: 00057430    41 FUNC    WEAK   DEFAULT   11
_ZNSt9basic_iosIcSt11char_traitsIcEE11_M_setstateESt12_Ios_Iostate
  2592: 000577b0    41 FUNC    WEAK   DEFAULT   11
_ZNSt9basic_iosIwSt11char_traitsIwEE11_M_setstateESt12_Ios_Iostate


... but is visible with 3.3.x:
%readelf -s --wide libstdc++.so.5.0.5  | grep _M_setstate
   426: 000475b0    46 FUNC    LOCAL  DEFAULT   11
_ZNSt9basic_iosIcSt11char_traitsIcEE11_M_setstateESt12_Ios_Iostate
   507: 000480e0    46 FUNC    LOCAL  DEFAULT   11
_ZNSt9basic_iosIwSt11char_traitsIwEE11_M_setstateESt12_Ios_Iostate

So, the solution seems to b pretty straight forward, in that _M_setstate bits
need to be added to the link map for 3.3.x.

The 3.4/3.5 link map exports this with:
     std::i[a-n]*;

Probably the std::string backflips on the 3.3. branch are getting in the way for
that version of the sources.

-benjamin

-- 


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


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