https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82172

--- Comment #15 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #12)
> N.B. this bug has been latent for years. The reason people are only seeing
> it now is that usually the "extern template class std::basic_string<char>"
> explicit instantiation declarations prevent this symbol being emitted in
> user's object files, so the definition in the library is used.
> 
> When compiling with -std=c++17 that extern template is not declared, so the
> compiler emits a definition of that symbol in every object that uses the old
> std::string.

LDPR_PREVAILING_DEF_IRONLY means that the symbol in our translation unit is
prevailing definition with no reference. However it's not true as libstdc++
shared library is having it's own symbol. That's what causes the segfault.
Shouldn't one have different versions of libstdc++.so in order to either have a
single global symbol or definitions in user's object files?

Reply via email to