From patchwork Fri Jun 18 18:49:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Marusich X-Patchwork-Id: 30449 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8FC9F27BC81; Fri, 18 Jun 2021 19:50:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5B32727BC78 for ; Fri, 18 Jun 2021 19:50:17 +0100 (BST) Received: from localhost ([::1]:53112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luJZI-0003yy-FY for patchwork@mira.cbaines.net; Fri, 18 Jun 2021 14:50:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luJZ4-0003ym-Kc for guix-patches@gnu.org; Fri, 18 Jun 2021 14:50:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46651) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luJZ4-0002Ij-Cg for guix-patches@gnu.org; Fri, 18 Jun 2021 14:50:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1luJZ4-00078Q-CN for guix-patches@gnu.org; Fri, 18 Jun 2021 14:50:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48825] [PATCH] gnu: Simplify the use of --with-long-double-128 on powerpc64le. Resent-From: Chris Marusich Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 18 Jun 2021 18:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48825 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48825@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162404216927385 (code B ref -1); Fri, 18 Jun 2021 18:50:02 +0000 Received: (at submit) by debbugs.gnu.org; 18 Jun 2021 18:49:29 +0000 Received: from localhost ([127.0.0.1]:58197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1luJYX-00077c-7l for submit@debbugs.gnu.org; Fri, 18 Jun 2021 14:49:29 -0400 Received: from lists.gnu.org ([209.51.188.17]:40602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1luJYU-00077U-Oa for submit@debbugs.gnu.org; Fri, 18 Jun 2021 14:49:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luJYU-0003vX-DU for guix-patches@gnu.org; Fri, 18 Jun 2021 14:49:26 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:44580) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luJYO-0001oZ-PY for guix-patches@gnu.org; Fri, 18 Jun 2021 14:49:26 -0400 Received: by mail-pf1-x435.google.com with SMTP id u18so2978775pfk.11 for ; Fri, 18 Jun 2021 11:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=urIk26l5aus6h6aep3LzmE4Gje+6sPhYvnX+ZJ623qA=; b=QL+TTdgPaC53zUZid4HU052X2ax/9dBvF62RU0+tiz1duOoXFQB4t8YdGMgpxOzjam CkaTelZR8c8oYQoL4JK19T2BfEvZ7YNA9b2nrdcajTx561Epx6qLC65MGQ53Aa3QdRxT AaOhMBaqu7t9zzmSs6m/hrxEUZ1fun5iDSmZm1hBeI8+7VDCYMPjhG80C7KRFIh2xpIT P3pW8LNp1uvmzpOU1f5zK/9Mot9I/lI2L/qSij+AM/0dQRj5vtRuGzSfcFKHPb0gg1+v TFF3R6Mh+aYyO1OZCQsuDBTRl9GhCaNfdopjxAUeReeqwhqlNOUWdXVzMg2/TFEKAx9F F16A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=urIk26l5aus6h6aep3LzmE4Gje+6sPhYvnX+ZJ623qA=; b=cKfGSIf90CEK+1C3dqzkYjDrEcWJFbAQmm5v0G1Mj4ml4NiGDMQneFrCZc/ocanQ2P bLEu6nkey4veKYLrETC1NHAKaDM0WEhg3fTfFFG8DGcigXW4A0U8M6yWUZnxSKpVasVN XW1ASXKzjJocDk39h82FD3YnFSPjyxPJoBsdVKpBFyGdmoKye0E2LxTnXZTZ0IfR7DmL v7LLpHuEeiq8i81bTq7aPSNeLnzZKPWGpFSbkeNbrNC95ZhoAKhSSbpe0TD4DmVWPoak JRMPjmUGPuPZYhL9LHVxQli30DQQ17WbOeH4sQczQ9clCYrRDN4dy8BMNgo4kq2QjEOI qVOA== X-Gm-Message-State: AOAM5309CtNy5WhBj1y23ZnCRDTmrT5dQ3WAz7gqDKSzyXxGVJjjyLrw ShwVltDljc+MeaZELLtA0eFKUeh0Wo//eA== X-Google-Smtp-Source: ABdhPJx+ctUJbHKxwwKvvcmmFic0mhuvztNJRP4s0xgH//7kBAjqvVUIAfd+sY8/t2bh+7Op7YFWOA== X-Received: by 2002:a62:27c5:0:b029:2f7:d4e3:7f2d with SMTP id n188-20020a6227c50000b02902f7d4e37f2dmr6405754pfn.59.1624042158793; Fri, 18 Jun 2021 11:49:18 -0700 (PDT) Received: from garuda-lan ([2601:601:9d01:3f90::24aa]) by smtp.gmail.com with ESMTPSA id n33sm2377967pgm.55.2021.06.18.11.49.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 11:49:17 -0700 (PDT) From: Chris Marusich References: <87o8cmtdxr.fsf@gmail.com> Date: Fri, 18 Jun 2021 11:49:13 -0700 In-Reply-To: (Efraim Flashner's message of "Sun, 6 Jun 2021 11:12:59 +0300") Message-ID: <87k0mr6mae.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=cmmarusich@gmail.com; helo=mail-pf1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi Efraim, Efraim Flashner writes: > couple of thoughts: > powerpc64le is in 'technology preview', so IMO it's fine to make big > changes to it as needed. That's true, but since we now have a stable place from which to work (master), I feel less concerned about getting changes into master. I thought about this again now, and I think I will plan to push this change to core-updates instead of master. > On master (and probably on core-updates too) we have a patch for glibc > to force ... something (that I don't remember) on powerpc architectures, > which has the side effect of needing '--with-long-double-128' on > powerpc-linux also in commencement.scm. If we could drop that patch then > I don't think we would need it anymore for powerpc. I'm not sure what change this would be, but if you ever figure it out, please do let me know! >> diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm >> index d4511ed914..db564db9c4 100644 >> --- a/gnu/packages/commencement.scm >> +++ b/gnu/packages/commencement.scm >> @@ -2819,13 +2819,6 @@ exec " gcc "/bin/" program >> "--disable-shared" >> "--enable-languages=c,c++" >> > > I've adjusted this on core-updates to also take effect on powerpc-linux. Thank you for mentioning this. In light of your change, I needed to modify my patch. I've attached a new patch which takes powerpc into account. I modified the commit message a bit, too. I'm confident the attached patch is correct for powerpc64le-linux, but if you could take a peek and make sure I didn't miss something related to powerpc, I would appreciate it! > This can be just 'powerpc64le' When checking the string prefix, that does probably work for little endian powerpc 64, since I don't think there are any other architectures that start with "powerpc64le". However, if you did something similar for powerpc (like in your change on core-updates), please keep in mind that it will affect not only powerpc64le, but also big-endian powerpc64, and any other powerpc architecture. For that reason, I personally prefer to keep the hyphen when I have a specific architecture in mind. From 1d6043ea33236a7f35f990935e457ef440b365c4 Mon Sep 17 00:00:00 2001 From: Chris Marusich Date: Fri, 18 Jun 2021 11:26:31 -0700 Subject: [PATCH] gnu: Simplify the use of --with-long-double-128. In short, this change adds the hard-coded "--with-long-double-128" configure option in one place and removes it from two other places. This changes and simplifies the use of this option for various architectures that start with the string "powerpc". * gnu/packages/gcc.scm (gcc-configure-flags-for-triplet): Add a clause for targets starting with "powerpc64le-" or "powerpc-" which adds the "--with-long-double-128" option. This causes any package using this procedure to be built using this new option on these architectures. In particular, this affects the gcc package and the gcc-final package, in addition to all the other versions of GCC defined in (gnu packages gcc). * gnu/packages/commencement.scm (gcc-boot0)[#:configure-flags]: Remove the code that adds the "--with-long-double-128" configure option for all architectures starting with "powerpc", since it is now redundant on the architectures where it is needed. The gcc-boot0 package uses (and adds to) the gcc package's configure options. This means that the above change in gcc.scm is sufficient to ensure that the gcc-boot0 package's configure options will include "--with-long-double-128" on powerpc64le and powerpc architectures. Additionally, since the option is apparently not required on the big-endian powerpc64 architecture, this change also has the nice effect of omitting the option in that case. * gnu/packages/cross-base.scm (cross-gcc-arguments)[#:configure-flags]: Remove the code that adds the "--with-long-double-128" configure option for powerpc64le, since it is now redundant. The cross-gcc-arguments procedure uses (and adds to) the configure options of its xgcc argument (a package). This means that regardless of which gcc from gcc.scm is used as the xgcc, the above change in gcc.scm is sufficient to ensure that the cross-gcc-arguments procedure's configure options will include "--with-long-double-128" on the powerpc64le and powerpc architectures. --- gnu/packages/commencement.scm | 7 ------- gnu/packages/cross-base.scm | 6 ------ gnu/packages/gcc.scm | 5 +++++ 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index d44d1dd3ca..af61512129 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -2733,13 +2733,6 @@ exec " gcc "/bin/" program "--disable-shared" "--enable-languages=c,c++" - ;; On POWER9 (little endian) glibc needs the 128-bit - ;; long double type. 32-bit PPC is affected by the - ;; changes applied for powerpc64le. - ,@(if (string-prefix? "powerpc" (boot-triplet)) - '("--with-long-double-128") - '()) - ;; libstdc++ cannot be built at this stage ;; ("Link tests are not allowed after ;; GCC_NO_EXECUTABLES."). diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 926b00ccdf..ced226ef34 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -153,12 +153,6 @@ base compiler and using LIBC (which may be either a libc package or #f.)" "--disable-decimal-float" ;would need libc "--disable-libcilkrts" - ,@(if (string-prefix? "powerpc64le-" target) - ;; On POWER9 (little endian) glibc needs - ;; the 128-bit long double type. - '("--with-long-double-128") - '()) - ;; When target is any OS other than 'none' these ;; libraries will fail if there is no libc ;; present. See diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 5d114dca87..31c7997fd0 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -79,6 +79,11 @@ where the OS part is overloaded to denote a specific ABI---into GCC ;; Cilk has been removed from GCC 8 anyway. '("--disable-libcilkrts")) + ;; glibc needs the 128-bit long double type on these architectures. + ((or (string-prefix? "powerpc64le-" target) + (string-prefix? "powerpc-" target)) + '("--with-long-double-128")) + (else ;; TODO: Add `arm.*-gnueabi', etc. '()))) -- 2.30.2