From: "François Dumont" <frs.dumont@gmail.com>
To: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [PATCH] Fix gnu-versioned-namespace build
Date: Fri, 30 Oct 2020 13:59:28 +0100 [thread overview]
Message-ID: <c14dba45-25e4-de0c-8f5a-75d7b094a0fb@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 685 bytes --]
The gnu-versioned-namespace build is broken.
The fix in charconv/floating_from_chars.cc is quite trivial. I am not so
sure about the fix in sstream-inst.cc.
libstdc++: Fix gnu-version-namespace buid
libstdc++-v3/ChangeLog
* include/std/charconv (from_chars): Define only if
_GLIBCXX_USE_CXX11_ABI.
* src/c++17/floating_from_chars.cc (from_chars): Likewise.
* src/c++20/sstream-inst.cc: Limit instantiations if
_GLIBCXX_USE_CXX11_ABI.
I build the lib with this patch. I am now running tests.
Ok to commit if tests are successful ?
François
[-- Attachment #2: version-ns.patch --]
[-- Type: text/x-patch, Size: 1632 bytes --]
diff --git a/libstdc++-v3/include/std/charconv b/libstdc++-v3/include/std/charconv
index dd1ebdf8322..90142659a0c 100644
--- a/libstdc++-v3/include/std/charconv
+++ b/libstdc++-v3/include/std/charconv
@@ -688,7 +688,7 @@ namespace __detail
operator^=(chars_format& __lhs, chars_format __rhs) noexcept
{ return __lhs = __lhs ^ __rhs; }
-#if _GLIBCXX_HAVE_USELOCALE
+#if _GLIBCXX_HAVE_USELOCALE && _GLIBCXX_USE_CXX11_ABI
from_chars_result
from_chars(const char* __first, const char* __last, float& __value,
chars_format __fmt = chars_format::general) noexcept;
diff --git a/libstdc++-v3/src/c++17/floating_from_chars.cc b/libstdc++-v3/src/c++17/floating_from_chars.cc
index d52c0a937b9..36685c2d6f4 100644
--- a/libstdc++-v3/src/c++17/floating_from_chars.cc
+++ b/libstdc++-v3/src/c++17/floating_from_chars.cc
@@ -41,7 +41,7 @@
# include <xlocale.h>
#endif
-#if _GLIBCXX_HAVE_USELOCALE
+#if _GLIBCXX_HAVE_USELOCALE && _GLIBCXX_USE_CXX11_ABI
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/src/c++20/sstream-inst.cc b/libstdc++-v3/src/c++20/sstream-inst.cc
index e04560d28c8..8c6840115c5 100644
--- a/libstdc++-v3/src/c++20/sstream-inst.cc
+++ b/libstdc++-v3/src/c++20/sstream-inst.cc
@@ -29,6 +29,7 @@
// Instantiations in this file are only for the new SSO std::string ABI
#include <sstream>
+#if _GLIBCXX_USE_CXX11_ABI
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -106,3 +107,5 @@ basic_stringstream<wchar_t>::view() const noexcept;
_GLIBCXX_END_NAMESPACE_VERSION
}
+
+#endif //_GLIBCXX_USE_CXX11_ABI
next reply other threads:[~2020-10-30 12:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-30 12:59 François Dumont [this message]
2020-10-30 13:23 ` Jonathan Wakely
2020-10-30 13:37 ` Jonathan Wakely
2020-10-30 14:11 ` Jonathan Wakely
2020-10-30 17:51 ` François Dumont
2020-10-30 18:48 ` Jonathan Wakely
2020-10-31 17:16 ` François Dumont
-- strict thread matches above, loose matches on Subject: below --
2019-12-11 7:29 François Dumont
2019-12-11 11:16 ` Jonathan Wakely
2019-12-11 11:22 ` Jonathan Wakely
2019-12-11 20:23 ` François Dumont
2019-12-11 20:44 ` Jonathan Wakely
2019-12-11 21:28 ` François Dumont
2019-12-11 21:33 ` Jonathan Wakely
2019-12-11 16:48 ` Jonathan Wakely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c14dba45-25e4-de0c-8f5a-75d7b094a0fb@gmail.com \
--to=frs.dumont@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).