This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
How to provide coexisting std::string's (with and without abi:cxx11) in GCC 5.1 and above?
- From: Jeffrey Walton <noloader at gmail dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 24 Mar 2016 06:50:43 -0400
- Subject: How to provide coexisting std::string's (with and without abi:cxx11) in GCC 5.1 and above?
- Authentication-results: sourceware.org; auth=none
- Reply-to: noloader at gmail dot com
We caught a report due to _GLIBCXX_USE_CXX11_ABI and abi:cxx11. We are
upstream, and it appears Debian built the library using GCC and
_GLIBCXX_USE_CXX11_ABI was in effect. A user then came along with
Clanf and compiled the userland program. The link failed. This is
expected given our understanding of the landscape.
We found "GCC5 and the C++11 ABI",
https://developerblog.redhat.com/2015/02/05/gcc5-and-the-c11-abi/. The
pages says:
Providers of such libraries or interfaces need to consider
whether they want to provide ABI coexistence, like libstdc++
does, or require their users to rebuild.
I read the Red Hat blog post, but its not clear to me how to
accomplish the coexistence. That is, I want to ensure the library that
Debian builds has a symbol in both namespace so linking can occur with
either GCC or Clang and "things just work" for the user.
How is libstdc++ providing symbols in both namespaces? How do I ensure
the symbol is present in both namesspaces so "things just work" for a
user?
Thanks in advance.