From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id wG2jFZYIOGRfeAAASxT56A (envelope-from ) for ; Thu, 13 Apr 2023 15:50:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KLeNFZYIOGSf/AAA9RJhRA (envelope-from ) for ; Thu, 13 Apr 2023 15:50:14 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F23CD37D21 for ; Thu, 13 Apr 2023 15:50:13 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pmxKh-00064H-Tr; Thu, 13 Apr 2023 09:49:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pmxKg-00063y-Ok for guix-devel@gnu.org; Thu, 13 Apr 2023 09:49:50 -0400 Received: from mira.cbaines.net ([2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pmxKT-0002Xl-Do for guix-devel@gnu.org; Thu, 13 Apr 2023 09:49:50 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:54d1:d5d4:280e:f699]) by mira.cbaines.net (Postfix) with ESMTPSA id F15A2174FC; Thu, 13 Apr 2023 14:49:33 +0100 (BST) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 7895bd83; Thu, 13 Apr 2023 13:49:32 +0000 (UTC) References: <87a60xcrdl.fsf@inria.fr> User-agent: mu4e 1.8.13; emacs 28.2 From: Christopher Baines To: Andreas Enge Cc: guix-devel@gnu.org, 61879@debbugs.gnu.org, Efraim Flashner Subject: Re: bug#61879: Powerpc on core-updates Date: Thu, 13 Apr 2023 14:46:00 +0100 In-reply-to: Message-ID: <87mt3byjrp.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681393814; a=rsa-sha256; cv=none; b=rkeSP7QweU29mTS4GCpcygLR8I1GjSe9GWMI9tgIpHK2lfyrCs7Qu5YL8917kmAjO0a+qx BlWrfCa/Xc54kNd8vIGc0OUXXgxUr36oDXK9DYyhGazwHRCbCyLot3cLHvGOK4RYtYDRMf 87MXuSfbatJoahRN8pFZJLoK55bpKftVt3nKQ+EQuuwjo7MFOScs7Zk+AmHX1e4BjwWMe7 REBir68+F+iNZ6LnHmz4Jp0Pq0tk8VyOtFUuZTlsFporNRnXpU9aA0UzIZ+xRCsucQwa6v kGhNaTp9kZCgIJVUyeZ6+iyFUDihHY9HlR6wzQjmO8LVws32Y/G+Sp2D/zVz1g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681393814; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=cy4nr4927DEGobLlx/veOOhCNZFCFdUCBrybuQiKMU8=; b=qluKCdNtB3NNwuDdR6r/bVl+3Z4U96nNM9vbGhCD1/vsJyMTM+ToksuHcGirH5vRQJeaHZ 1KGiz9ZCisB6HezVgnfLxVpzvk/u+lm8Vsb1OCFFrtU/FyfH7OLukhPwVL35sfD/B5V/wg WSrF20Jl/lDFtzrupNdFBfQcTwQqyZy3iyyFlTzLULfy7uEqyVAOHJKqiEpgg7MxqFLNQA ul4pwUkuIk0eu4Bd+EnUMepMALcz7IXrlra3wwubXasVQLg08ZR5/Blminkgj+hQK9tjh/ V25U22oK0YXV+lbDY7AulNw3e54rqqTn0TYVfY0eV5Dbj7VsZRLlXw+JZrOn6Q== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -5.12 X-Spam-Score: -5.12 X-Migadu-Queue-Id: F23CD37D21 Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-TUID: ogpPRxHiiTkU --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Andreas Enge writes: > In the file > libstdc++-v3/src/c++17/floating_from_chars.cc > previous functions have code like this: > #if _GLIBCXX_USE_CXX11_ABI > buffer_resource mr; > pmr::string buf(&mr); > #else > string buf; > if (!reserve_string(buf)) > return make_result(first, 0, {}, ec); > #endif > > while here we only have: > buffer_resource mr; > pmr::string buf(&mr); > > So my guess would be that we should simply replace this snippet with the > one above. > > Could someone with access to a powerpc machine try out this change? Thanks for figuring this out Andreas! I've managed to apply this change in the relevant place, and it appears to work. I tried to apply it in a way that only affected powerpc64le-linux, but I'm not sure I was successful. I've got no idea where it's best to apply this patch, or how describe it, but at least this is a step forward. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-WIP.patch Content-Transfer-Encoding: quoted-printable From=20382862fc06085ba80380977caf2a1f9c3203a12d Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 13 Apr 2023 14:45:14 +0100 Subject: [PATCH] WIP =2D-- gnu/packages/gcc.scm | 108 ++++++++++++++++++--------------- gnu/packages/patches/foo.patch | 20 ++++++ 2 files changed, 80 insertions(+), 48 deletions(-) create mode 100644 gnu/packages/patches/foo.patch diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index a511cdbc45..6f6f2caa5e 100644 =2D-- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -853,56 +853,68 @@ (define-public (make-libstdc++ gcc) (inherit gcc) (name "libstdc++") (arguments =2D `(#:out-of-source? #t =2D #:modules ((srfi srfi-1) + (list + #:out-of-source? #t + #:modules `((srfi srfi-1) (srfi srfi-26) ,@%gnu-build-system-modules) =2D #:phases =2D (modify-phases %standard-phases =2D ,@(if (version>=3D? (package-version gcc) "11") =2D `((add-after 'unpack 'hide-gcc-headers =2D (lambda* (#:key native-inputs inputs #:allow-other-ke= ys) =2D (let ((gcc (assoc-ref (or native-inputs inputs) =2D ,(if (%current-target-system) =2D "cross-gcc" =2D "gcc")))) =2D ;; Fix a regression in GCC 11 where the GCC heade= rs =2D ;; shadows glibc headers when building libstdc++.= An =2D ;; upstream fix was added in GCC 11.3.0, but it o= nly =2D ;; hides system include directories, not those on =2D ;; CPLUS_INCLUDE_PATH. See discussion at =2D ;; =2D ;; and the similar adjustment in GCC-FINAL. =2D (substitute* "libstdc++-v3/src/c++17/Makefile.in" =2D (("AM_CXXFLAGS =3D ") =2D (string-append ,(if (%current-target-system) =2D "CROSS_CPLUS_INCLUDE_PATH = =3D " =2D "CPLUS_INCLUDE_PATH =3D ") =2D (string-join =2D (remove (cut string-prefix? gc= c <>) =2D (string-split =2D (getenv =2D ,(if (%current-targe= t-system) =2D "CROSS_CPLUS_IN= CLUDE_PATH" =2D "CPLUS_INCLUDE_= PATH")) =2D #\:)) =2D ":") =2D "\nAM_CXXFLAGS =3D "))))))) =2D '()) =2D ;; Force rs6000 (i.e., powerpc) libdir to be /lib and not /lib6= 4. =2D (add-before 'chdir 'fix-rs6000-libdir =2D (lambda _ =2D (when (file-exists? "gcc/config/rs6000") =2D (substitute* (find-files "gcc/config/rs6000") =2D (("/lib64") "/lib"))))) =2D (add-before 'configure 'chdir =2D (lambda _ =2D (chdir "libstdc++-v3")))) =2D =2D #:configure-flags `("--disable-libstdcxx-pch" =2D ,(string-append "--with-gxx-include-dir=3D" =2D (assoc-ref %outputs "out") =2D "/include")))) + #:phases + #~(modify-phases %standard-phases + #$@(if (and (target-ppc64le?) + (version>=3D? (package-version gcc) "11")) + #~((add-after 'unpack 'patch-foo + (lambda _ + (define patch + #$(local-file + (search-patch "foo.patch"))) + (peek "CWD" (getcwd)) + (invoke "patch" "--force" "-p1" "-i" patch)))) + '()) + #$@(if (version>=3D? (package-version gcc) "11") + #~((add-after 'unpack 'hide-gcc-headers + (lambda* (#:key native-inputs inputs #:allow-other-k= eys) + (let ((gcc (assoc-ref (or native-inputs inputs) + #$(if (%current-target-syste= m) + "cross-gcc" + "gcc")))) + ;; Fix a regression in GCC 11 where the GCC head= ers + ;; shadows glibc headers when building libstdc++= . An + ;; upstream fix was added in GCC 11.3.0, but it = only + ;; hides system include directories, not those on + ;; CPLUS_INCLUDE_PATH. See discussion at + ;; + ;; and the similar adjustment in GCC-FINAL. + (substitute* "libstdc++-v3/src/c++17/Makefile.in" + (("AM_CXXFLAGS =3D ") + (string-append #$(if (%current-target-system) + "CROSS_CPLUS_INCLUDE_PAT= H =3D " + "CPLUS_INCLUDE_PATH =3D = ") + (string-join + (remove (cut string-prefix? g= cc <>) + (string-split + (getenv + #$(if (%current-tar= get-system) + "CROSS_CPLUS_= INCLUDE_PATH" + "CPLUS_INCLUD= E_PATH")) + #\:)) + ":") + "\nAM_CXXFLAGS =3D "))))))) + '()) + ;; Force rs6000 (i.e., powerpc) libdir to be /lib and not /lib64. + (add-before 'chdir 'fix-rs6000-libdir + (lambda _ + (when (file-exists? "gcc/config/rs6000") + (substitute* (find-files "gcc/config/rs6000") + (("/lib64") "/lib"))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "libstdc++-v3")))) + + #:configure-flags #~(list + "--disable-libstdcxx-pch" + (string-append "--with-gxx-include-dir=3D" + #$output + "/include")))) (outputs '("out" "debug")) (inputs '()) (native-inputs '()) diff --git a/gnu/packages/patches/foo.patch b/gnu/packages/patches/foo.patch new file mode 100644 index 0000000000..5f3ccda91d =2D-- /dev/null +++ b/gnu/packages/patches/foo.patch @@ -0,0 +1,20 @@ +--- a/libstdc++-v3/src/c++17/floating_from_chars.cc ++++ b/libstdc++-v3/src/c++17/floating_from_chars.cc +@@ -495,10 +495,16 @@ + from_chars(const char* first, const char* last, __ieee128& value, + chars_format fmt) noexcept + { ++ errc ec =3D errc::invalid_argument; ++#if _GLIBCXX_USE_CXX11_ABI + buffer_resource mr; + pmr::string buf(&mr); ++#else ++ string buf; ++ if (!reserve_string(buf)) ++ return make_result(first, 0, {}, ec); ++#endif + size_t len =3D 0; +- errc ec =3D errc::invalid_argument; + __try + { + if (const char* pat =3D pattern(first, last, fmt, buf)) [[likely]] =2D-=20 2.32.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmQ4CGpfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XcKdxAAkuUBYDgcLRvtR2FAuCy1gjP/M2NsxJm2 yXIJ5FPzDpHgLapig5D2RglnE6oRzBvd+RthTUL1aelT5LOjfbcJhsp7jEigcUve yX9MMpcR1uIgabk+ds1Oi8VO3anOQtu076xtrFF5H/OkdjqiOFgDBj7X0Y8UWOS1 VEKOHdaeCXdhNoaAM9B6IXJGFo+TlemNEbpJUGLJnW0KgTRITUOMaKdomuc2QG9k /abaWeQ9iKDdda+WjgTrnh4JX4Q4/3wTPHLhzxqcl+HjDPRWYznRF5gIyUdR2gu9 1jPAO+ICgSQFQnxP6fMqJWyaV6rYVl2CojxlswUt5pk2zo1Raej47FW0HKjQI/vU GOVyHt2EkATtkVb7xwW2qpEsM04+jlNlw3a5LkAQHfu0V/lcI2WEm5jY6aYXJu8n WUdew2QeqQa3nbIulJj28hKORmJ05K2anA2x9gzE1etuY9ILr+N92NCZJgO7Q5yb SWqhXPpL/q+Nbi1sUe7rEXxzXkJemeejVqZBsf3rkbIKHeHYLTbGSG9LY5wVO2gn 3M2ysnUXj/sDxZLjYy1OE3CqtgjwrHCJhLzwruv2z9rYbXJJFk2pwjwxbNjWLbK8 khiWtf0Lx8teS8lJq1Mg6XACB+26Ryms1Z6fJDn3p5r0a1OMFIfRPllRs/QA/ZfM fyTcLgdBXJ8= =4Wf+ -----END PGP SIGNATURE----- --==-=-=--