From patchwork Thu Apr 28 04:55:10 2022 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: 53285 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1208D3857C4D for ; Thu, 28 Apr 2022 04:55:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1208D3857C4D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1651121745; bh=Auujf/+GFlhtEdRTv2jxLdLr83xpnMNrPmxsIvUV7pE=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Kc1uHBgk3a4/ftBSO/RYSbZ91Eea/8+KE92nhSUNpA7FEgZtuBENeRg+O2dCs46C5 u0XmtxPFOKpgObhWmjEJevnPHJayBVZQy4tFjGQMzDFzTll/hzmzBFqFYTh5Zf3YKr +GzOcLNe8up4fNZlITOA2Vvppa4oVwiFOqpbHwBo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id AD5F03858D1E; Thu, 28 Apr 2022 04:55:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AD5F03858D1E Received: by mail-wm1-x32d.google.com with SMTP id l16-20020a05600c1d1000b00394011013e8so1736516wms.1; Wed, 27 Apr 2022 21:55:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:from:subject; bh=Auujf/+GFlhtEdRTv2jxLdLr83xpnMNrPmxsIvUV7pE=; b=kpcjn7gRWjKZmc2HRnoUOgs4sb1A2q2k8pG0CBTx+DTz7YoPiMgsOwpSw3c0Ajv4Ae W44IWml8lxTC66aDXiJk8f4fnzzAmNB/AwtgdvQFrkc5iANUxZVfKtN3nzJ8AqpPPWgD 8G4LSREQf55rb1UV2i5ybt0qWI+BViWW0zItiob8+kmNzeefrxUSnf7pF/QXojxARa28 /5fQ0kWvwktE7j3UL2J3T9eGCEuUdmfYxVgnXe+rBDggFNcgrLGgka1l208zxVtY4Vo0 IfFk5JX3Dvt88OebxuZc2xTyLfGIE3HiTIaRRXp02qf/a4PIW9Q8ahYfcvPmq1gJhrMO GxTw== X-Gm-Message-State: AOAM530wpnMOE6tIWuFfNEUFgSaBeUS2RUOgnLquoOxUUljsNqx33W2O tXIqRyWuyXJLyPDDivEUoDFXhm+lEBM= X-Google-Smtp-Source: ABdhPJwRKWzxpikjA8O4L+Vg1WISNfRN9Avzg6M13nQiupIKUte9rdKI1TUWWtqk0Qbax60RqP20fA== X-Received: by 2002:a1c:a301:0:b0:392:9bc5:203c with SMTP id m1-20020a1ca301000000b003929bc5203cmr29158149wme.67.1651121713054; Wed, 27 Apr 2022 21:55:13 -0700 (PDT) Received: from [10.37.6.180] ([109.190.253.11]) by smtp.googlemail.com with ESMTPSA id k11-20020adfc70b000000b0020ad82e3ec8sm10608097wrg.62.2022.04.27.21.55.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Apr 2022 21:55:12 -0700 (PDT) Message-ID: Date: Thu, 28 Apr 2022 06:55:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Content-Language: fr To: "libstdc++@gcc.gnu.org" , gcc-patches Subject: [PATCH][_GLIBCXX_INLINE_VERSION] Fix std::random_device definition X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi     Still time for this fix for gcc 12 ?     If so I'll make sure to run tests quickly, especially the abi.exp one to confirm that the cleanup in gnu-versioned-namespace.ver do not need to be replaced by the same in __8 namespace. libstdc++: [_GLIBCXX_INLINE_VERSION] Fix std::random_device definition Definition shall be put in _GLIBCXX_BEGIN_VERSION_NAMESPACE/ _GLIBCXX_END_VERSION_NAMESPACE like the declaration. libstdc++-v3/ChangeLog     * src/c++11/cow-string-inst.cc: Put random_device member definitions     in versioned namespace.     * src/c++11/random.cc: Likewise.     * config/abi/pre/gnu-versioned-namespace.ver: Remove std::random_device     symbols. François diff --git a/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver b/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver index e9520a6421e..b37199ece72 100644 --- a/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver +++ b/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver @@ -28,7 +28,6 @@ GLIBCXX_8.0 { { std::*; std::__8::*; - std::random_device::* }; # operator new(size_t) diff --git a/libstdc++-v3/src/c++11/cow-string-inst.cc b/libstdc++-v3/src/c++11/cow-string-inst.cc index e5331bb029a..f038d0018f0 100644 --- a/libstdc++-v3/src/c++11/cow-string-inst.cc +++ b/libstdc++-v3/src/c++11/cow-string-inst.cc @@ -38,6 +38,8 @@ namespace std _GLIBCXX_VISIBILITY(default) { +_GLIBCXX_BEGIN_NAMESPACE_VERSION + void random_device::_M_init(const std::string& token) { _M_init(token.c_str(), token.length()); } @@ -45,5 +47,7 @@ namespace std _GLIBCXX_VISIBILITY(default) void random_device::_M_init_pretr1(const std::string& token) { _M_init(token.c_str(), token.length()); } + +_GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif diff --git a/libstdc++-v3/src/c++11/random.cc b/libstdc++-v3/src/c++11/random.cc index 8b5175a4ebf..9c806b92559 100644 --- a/libstdc++-v3/src/c++11/random.cc +++ b/libstdc++-v3/src/c++11/random.cc @@ -301,7 +301,9 @@ namespace std _GLIBCXX_VISIBILITY(default) return any; // should be unreachable } - } + } // namespace + +_GLIBCXX_BEGIN_NAMESPACE_VERSION void random_device::_M_init(const std::string& token) @@ -665,5 +667,6 @@ namespace std _GLIBCXX_VISIBILITY(default) linear_congruential_engine; template struct __detail::_Mod; #endif +_GLIBCXX_END_NAMESPACE_VERSION } #endif // _GLIBCXX_USE_C99_STDINT_TR1