From patchwork Fri Oct 30 12:59:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Fran=C3=A7ois_Dumont?= X-Patchwork-Id: 1391031 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=XYR+dNvd; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CN2T72B8bz9sTR for ; Fri, 30 Oct 2020 23:59:38 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 226E53850404; Fri, 30 Oct 2020 12:59:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 226E53850404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1604062774; bh=SM/t8NnDChuI8WXazpyocSRRWDAoQybOCPODLvgwGJk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=XYR+dNvdOG8CJdW8qP62N5kkcA77D1wd03ocgPOHSwVrui/kJaVkoQO9AXho5C1le w8RODw8rN95P8tvlh9I2VxdgZQTXt8v5iuX/jAI0tTLBTmkdzqgVafx5gG+ThPum62 LT46ZT41TTyrOtiXOdHgHtrkgN2uT/blodUQuCzg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id EE214385780B; Fri, 30 Oct 2020 12:59:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EE214385780B Received: by mail-wr1-x42e.google.com with SMTP id g12so6333711wrp.10; Fri, 30 Oct 2020 05:59:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=SM/t8NnDChuI8WXazpyocSRRWDAoQybOCPODLvgwGJk=; b=I4h6QV2tsqQFYn9tq6yoIs4Cr1ZQZo6BKKlJzvrRlHoHFYc0W7D1WN7sQWhc2L1cji W3btcqdaq2lmAC/7Ku6Li0Naey8fVBsj7x+3Scx+jTsTLFhmqSVtorLTXaS9dQ9eR1bD oyfy4N03SdshaCNMgZiqN1O4ucYNsXbBDuuWU1KECxaxRtmftnQq/GuPCqRQvDbFxUwb DKWB1n18N+HXNC0U7hpTmify0JxlIGVXk7H5lif+uN3AVAxxrccKTInR5L898PP4ssM/ U+2kkB430gk2IfNRH64GttHwjL6ySdUaph+fgz/M//Q5YuDwxHRTc+dyFOKh64Plu4Au 4qbg== X-Gm-Message-State: AOAM5332a5PvJY3VeC7rtIp3xnHtSkJ+X/TP54pXhlTfVdwVmQtSL0b1 urpfIYefiHj1o6VacD9tOLweHU5S/pA= X-Google-Smtp-Source: ABdhPJyN3cXGzgm4+S//kAXq2yCt2RbyQLsRDDay9jSpOWx/oqxIDOXyHohgEdFW5meW6Oh+O274PQ== X-Received: by 2002:adf:9150:: with SMTP id j74mr3236740wrj.57.1604062770532; Fri, 30 Oct 2020 05:59:30 -0700 (PDT) Received: from ?IPv6:2a01:e0a:1dc:b1c0:1100:6997:9a80:b297? ([2a01:e0a:1dc:b1c0:1100:6997:9a80:b297]) by smtp.googlemail.com with ESMTPSA id x65sm4538354wmg.1.2020.10.30.05.59.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Oct 2020 05:59:29 -0700 (PDT) To: "libstdc++@gcc.gnu.org" , gcc-patches Subject: [PATCH] Fix gnu-versioned-namespace build Message-ID: Date: Fri, 30 Oct 2020 13:59:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Language: fr X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Fran=C3=A7ois_Dumont_via_Gcc-patches?= From: =?utf-8?q?Fran=C3=A7ois_Dumont?= Reply-To: =?utf-8?q?Fran=C3=A7ois_Dumont?= Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" 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 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 #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 +#if _GLIBCXX_USE_CXX11_ABI namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -106,3 +107,5 @@ basic_stringstream::view() const noexcept; _GLIBCXX_END_NAMESPACE_VERSION } + +#endif //_GLIBCXX_USE_CXX11_ABI