From patchwork Wed May 3 18:53:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 89830 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1541083vqo; Wed, 3 May 2023 11:54:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7VplMy5g0tGKTiLDQQ62SCTTKhUTOJAD8umvrnTmyji2wz3M25kD53NvG3cDCjjNcpi4TB X-Received: by 2002:a17:907:7245:b0:946:2fa6:3b85 with SMTP id ds5-20020a170907724500b009462fa63b85mr4555219ejc.36.1683140078775; Wed, 03 May 2023 11:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683140078; cv=none; d=google.com; s=arc-20160816; b=ZbaalH9335AecwM9iD46GJ2pY1M8rzzmcInQCIQTsvK2j7yR78rWnrmOwpHyiQkUuq c9RFiCKpPC91eWZkSbYkeEdyxbDgAo8i0mZE7T49VLGxBZka93HM4MSyxmwNwQ8ClSR/ h+T/KEUey0zWiQhbeEV4FjpFIWgM2Wzpbogtt4jJQyrjiO1uIWxzy/BTbtLgh4eKx7IB Ud8FMctyChtXTmpbatplp7RxPOlucsKEKxxIu6oIAHrdmbI1brktQigw9Pj1sW529Bo7 Z9IbLk2DXGmOrBeziC/Y4TaFlqzL3FXselySHHDNOX3zgw5F/mBYuR8+RXTmG8TTUKRD 92jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:cc:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=ypevC+krYt5mQVYOEvv25XAvcOGpgsYVQBrB3iRRGI4=; b=xu91Iqum8XvHqWoAPj+2eNeAudYbgN37O2SU2olYS+csGFbK9QDl6F0SCTeHO048/Y hD7ED1uoGlvTmN2i8YcxlI8YH+87l2+QPWMCw7nJqF5wmAX+AFEZosEMw0gYI5iuRD4n bSeAGWrBXW6iODwP7GY7i3JgzugNGaeIzTiiyJryqKrp6vIdx//QR1flqjJ/2wV8CHYD w0Fk+xS/mGHarlTlkAATPajsYVG9stz9hsOR4DS2nvLa+Eq6Riq6ewjf1A2Q8Qtksgih IIfo9LIoounPgJJEHR+SCGfIOzjJ0vFYv6y/s2TFqaklZIZv6D2iup5vEiwJ6ppOSTnK Be/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rwDe3o0Y; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id mc25-20020a170906eb5900b0094f2d5de047si22528731ejb.287.2023.05.03.11.54.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 11:54:38 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rwDe3o0Y; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D2D62385842D for ; Wed, 3 May 2023 18:54:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2D62385842D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683140075; bh=ypevC+krYt5mQVYOEvv25XAvcOGpgsYVQBrB3iRRGI4=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=rwDe3o0Yo+gvDnT1JjFRhwVXfqB0JusVVl2sdSaAC9Zh+VejXwe4kTJF9xO3PuAj9 0DOYWoLB+VNjDNeQVn0h+zq0/8V1yG/092nfPlKNMmklirvcDITUIHLftWEkB74JOR uRzDlw+QROxSCnjg7JKFGFvK1iYDRnHqwd0RBa70= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A5FEC3858D33 for ; Wed, 3 May 2023 18:53:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A5FEC3858D33 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-596-ovYzmab5PVmEJvLa-ekYMQ-1; Wed, 03 May 2023 14:53:48 -0400 X-MC-Unique: ovYzmab5PVmEJvLa-ekYMQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 236CB1C068D2; Wed, 3 May 2023 18:53:48 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.156]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D38422026D16; Wed, 3 May 2023 18:53:47 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 343IrjZ33326083 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 3 May 2023 20:53:45 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 343IrjOs3326082; Wed, 3 May 2023 20:53:45 +0200 Date: Wed, 3 May 2023 20:53:44 +0200 To: Jonathan Wakely Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] libstdc++: Fix up abi.exp FAILs on powerpc64le-linux Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764900291537840495?= X-GMAIL-MSGID: =?utf-8?q?1764900291537840495?= Hi! This is an ABI problem on powerpc64le-linux, introduced in 13.1. When libstdc++ is configured against old glibc, the _ZSt10from_charsPKcS0_RDF128_St12chars_format@@GLIBCXX_3.4.31 _ZSt8to_charsPcS_DF128_@@GLIBCXX_3.4.31 _ZSt8to_charsPcS_DF128_St12chars_format@@GLIBCXX_3.4.31 _ZSt8to_charsPcS_DF128_St12chars_formati@@GLIBCXX_3.4.31 symbols are exported from the library, while when it is configured against new enough glibc, those symbols aren't exported and we export instead _ZSt10from_charsPKcS0_Ru9__ieee128St12chars_format@@GLIBCXX_IEEE128_3.4.29 _ZSt8to_charsPcS_u9__ieee128@@GLIBCXX_IEEE128_3.4.29 _ZSt8to_charsPcS_u9__ieee128St12chars_format@@GLIBCXX_IEEE128_3.4.29 _ZSt8to_charsPcS_u9__ieee128St12chars_formati@@GLIBCXX_IEEE128_3.4.29 together with various other @@GLIBCXX_IEEE128_3.4.{29,30,31} and @@CXXABI_IEEE128_1.3.13 symbols. The idea was that those *IEEE128* symbol versions (similarly to *LDBL* symbol versions) are optional (but if it appears, all symbols from it up to the version of the library appears), but the base appears always. My _Float128 from_chars/to_chars changes unfortunately broke this. I believe nothing really uses those symbols if libstdc++ has been configured against old glibc, so if 13.1 wasn't already released, it might be best to make sure they aren't exported on powerpc64le-linux. But as they were exported, I think the best resolution for this ABI difference is to add those 4 symbols as aliases to the GLIBCXX_IEEE128_3.4.29 *u9__ieee128* symbols, which the following patch does. Tested on powerpc64le-linux (both configured against glibc 2.36 and 2.17) and powerpc64-linux (configured against glibc 2.17), ok for trunk? 2023-05-03 Jakub Jelinek * src/c++17/floating_from_chars.cc (_ZSt10from_charsPKcS0_RDF128_St12chars_format): New alias to _ZSt10from_charsPKcS0_Ru9__ieee128St12chars_format. * src/c++17/floating_to_chars.cc (_ZSt8to_charsPcS_DF128_): New alias to _ZSt8to_charsPcS_u9__ieee128. (_ZSt8to_charsPcS_DF128_St12chars_format): New alias to _ZSt8to_charsPcS_u9__ieee128St12chars_format. (_ZSt8to_charsPcS_DF128_St12chars_formati): New alias to _ZSt8to_charsPcS_u9__ieee128St12chars_formati. * config/abi/post/powerpc64le-linux-gnu/baseline_symbols.txt: Updated. Jakub --- libstdc++-v3/src/c++17/floating_from_chars.cc.jj 2023-04-13 23:00:36.125459347 +0200 +++ libstdc++-v3/src/c++17/floating_from_chars.cc 2023-05-03 17:24:45.121600206 +0200 @@ -1272,6 +1272,13 @@ from_chars(const char* first, const char // fast_float doesn't support IEEE binary128 format, but we can use strtold. return from_chars_strtod(first, last, value, fmt); } + +extern "C" from_chars_result +_ZSt10from_charsPKcS0_RDF128_St12chars_format(const char* first, + const char* last, + __ieee128& value, + chars_format fmt) noexcept +__attribute__((alias ("_ZSt10from_charsPKcS0_Ru9__ieee128St12chars_format"))); #elif defined(USE_STRTOF128_FOR_FROM_CHARS) from_chars_result from_chars(const char* first, const char* last, _Float128& value, --- libstdc++-v3/src/c++17/floating_to_chars.cc.jj 2023-01-16 23:19:06.284716774 +0100 +++ libstdc++-v3/src/c++17/floating_to_chars.cc 2023-05-03 17:12:16.766877278 +0200 @@ -1851,6 +1851,23 @@ to_chars(char* first, char* last, __floa { return __floating_to_chars_precision(first, last, value, fmt, precision); } + +extern "C" to_chars_result +_ZSt8to_charsPcS_DF128_(char* first, char* last, __float128 value) noexcept + __attribute__((alias ("_ZSt8to_charsPcS_u9__ieee128"))); + +extern "C" to_chars_result +_ZSt8to_charsPcS_DF128_St12chars_format(char* first, char* last, + __float128 value, + chars_format fmt) noexcept + __attribute__((alias ("_ZSt8to_charsPcS_u9__ieee128St12chars_format"))); + +extern "C" to_chars_result +_ZSt8to_charsPcS_DF128_St12chars_formati(char* first, char* last, + __float128 value, + chars_format fmt, + int precision) noexcept + __attribute__((alias ("_ZSt8to_charsPcS_u9__ieee128St12chars_formati"))); #else to_chars_result to_chars(char* first, char* last, _Float128 value) noexcept --- libstdc++-v3/config/abi/post/powerpc64le-linux-gnu/baseline_symbols.txt.jj 2023-05-02 19:27:47.538504941 +0200 +++ libstdc++-v3/config/abi/post/powerpc64le-linux-gnu/baseline_symbols.txt 2023-05-03 19:06:33.389469841 +0200 @@ -4491,6 +4491,7 @@ FUNC:_ZNSt9type_infoD1Ev@@GLIBCXX_3.4 FUNC:_ZNSt9type_infoD2Ev@@GLIBCXX_3.4 FUNC:_ZNVSt9__atomic011atomic_flag12test_and_setESt12memory_order@@GLIBCXX_3.4.11 FUNC:_ZNVSt9__atomic011atomic_flag5clearESt12memory_order@@GLIBCXX_3.4.11 +FUNC:_ZSt10from_charsPKcS0_RDF128_St12chars_format@@GLIBCXX_3.4.31 FUNC:_ZSt10from_charsPKcS0_RdSt12chars_format@@GLIBCXX_3.4.29 FUNC:_ZSt10from_charsPKcS0_ReSt12chars_format@@GLIBCXX_3.4.29 FUNC:_ZSt10from_charsPKcS0_RfSt12chars_format@@GLIBCXX_3.4.29 @@ -4641,6 +4642,9 @@ FUNC:_ZSt7getlineIwSt11char_traitsIwESaI FUNC:_ZSt7getlineIwSt11char_traitsIwESaIwEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_@@GLIBCXX_3.4.21 FUNC:_ZSt7getlineIwSt11char_traitsIwESaIwEERSt13basic_istreamIT_T0_ES7_RSbIS4_S5_T1_E@@GLIBCXX_3.4 FUNC:_ZSt7getlineIwSt11char_traitsIwESaIwEERSt13basic_istreamIT_T0_ES7_RSbIS4_S5_T1_ES4_@@GLIBCXX_3.4 +FUNC:_ZSt8to_charsPcS_DF128_@@GLIBCXX_3.4.31 +FUNC:_ZSt8to_charsPcS_DF128_St12chars_format@@GLIBCXX_3.4.31 +FUNC:_ZSt8to_charsPcS_DF128_St12chars_formati@@GLIBCXX_3.4.31 FUNC:_ZSt8to_charsPcS_d@@GLIBCXX_3.4.29 FUNC:_ZSt8to_charsPcS_dSt12chars_format@@GLIBCXX_3.4.29 FUNC:_ZSt8to_charsPcS_dSt12chars_formati@@GLIBCXX_3.4.29