From patchwork Fri Apr 11 09:49:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 41575 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 B47D527BC49; Fri, 11 Apr 2025 10:50:34 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DEB9227BC4A for ; Fri, 11 Apr 2025 10:50:31 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u3B1T-0000Hw-J8; Fri, 11 Apr 2025 05:50:07 -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 1u3B1O-0000H1-TM for guix-patches@gnu.org; Fri, 11 Apr 2025 05:50:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u3B1O-00016a-JK for guix-patches@gnu.org; Fri, 11 Apr 2025 05:50:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=fMATifkL+9kcqetE96wGnzttSPvaGKPvOQvOzlUdBQc=; b=KuULy+HUlboT1Z+dMjnBI4waTwdprurbtOn61r1YolYPcRFFDalweg/A52oYzyRti9MmwaEkDbnnyBau3p09Rl3m0m1z3X+4+Pmlx8qGnVPdhnqs5oqFWR0Q9E+qOBbdKRdE8AzAOISUzmmcgmulaR3LxjgJ0mGKOPRmrw992k0QjEhFOqzATQEe3hR9ppUdIv1uA3hVaRhsh01YKaSnk7mhrtpYYVlw5yxWSSnIcPXHtFUjGl0mPvNahed319nODtsae3aSXa1rtF3zeWJtGqoKigwyDljSLHRXiR1de1eTaEiPB7m9Sw9VvhwTYIfBxATM+nhf2t+i1sgn/xMvww==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u3B1O-0006CY-8F for guix-patches@gnu.org; Fri, 11 Apr 2025 05:50:02 -0400 Subject: bug#75620: [PATCH core-packages-team] gnu: gcc-6: Use libstdc++ headers appropriate for each GCC. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Fri, 11 Apr 2025 09:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 75620 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Leo =?utf-8?q?Nikkil=C3=A4?= Cc: 75620-done@debbugs.gnu.org Mail-Followup-To: 75620@debbugs.gnu.org, ludo@gnu.org, hello@lnikki.la Received: via spool by 75620-done@debbugs.gnu.org id=D75620.174436497323777 (code D ref 75620); Fri, 11 Apr 2025 09:50:02 +0000 Received: (at 75620-done) by debbugs.gnu.org; 11 Apr 2025 09:49:33 +0000 Received: from localhost ([127.0.0.1]:48780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3B0u-0006BQ-WE for submit@debbugs.gnu.org; Fri, 11 Apr 2025 05:49:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54818) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u3B0s-0006B4-BX for 75620-done@debbugs.gnu.org; Fri, 11 Apr 2025 05:49:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u3B0l-000142-4Q; Fri, 11 Apr 2025 05:49:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=fMATifkL+9kcqetE96wGnzttSPvaGKPvOQvOzlUdBQc=; b=UR3zSSvN1J9DnbyTTWOt ki28Eu9e8IAjGboG6/rQHQ+HY10tgtJyHRawxwdWORLQ7RaJHtWephQGU9k/M0gptE+5/OfsVCkc7 yLHaaJqRIjO3uKwv0BXHWCWAOOEjSUxQNsLMCxuBesS1OaYQS6pnYzzm9d5R996oNLF44t0EMPVIv WW3uzdivysmB1JULaFoPrxzLmdi+RVjPzb6t5TJcF4FPMZ9Lit3Z5/o/3k0Gqdg1TN8bXQP8kItuO 7GleEmCoXxez/KTXcHgCHHUtCE7zxZHwtJtH3WdSBJWDwqg9c/ceMpyBbfF9HWaQf4c9UZxwL2D+A eXLPLXIxgiGGEw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= In-Reply-To: <20250117030954.2640-1-hello@lnikki.la> ("Leo =?utf-8?q?Nikkil?= =?utf-8?q?=C3=A4?= "'s message of "Fri, 17 Jan 2025 05:08:49 +0200") References: <20250117030954.2640-1-hello@lnikki.la> Date: Fri, 11 Apr 2025 11:49:08 +0200 Message-ID: <878qo7ni3v.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hi Leo, Leo Nikkilä skribis: > After the "hack" introduced for , all GCCs > are built with the current GCC's libstdc++ headers. This results in subtly > broken C++ headers in older versions, which aren't necessarily compatible with > libstdc++s from other versions. [...] > * gnu/packages/gcc.scm (libstdc++, libstdc++-headers): Remove variables. > (make-libstdc++-headers): New procedure. > (gcc-6)[native-inputs]: Use it with `this-package'. > --- > gnu/packages/gcc.scm | 38 ++++++++++++++++++-------------------- > 1 file changed, 18 insertions(+), 20 deletions(-) Somehow this patch fell into the cracks. I’ve now applied it with the change below (using ‘mlambdaq’ for ‘make-libstdc++-headers’); I also shortened the commit log. Thanks! Ludo’. diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 0eec6452f6..5273aa2ce3 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -52,6 +52,7 @@ (define-module (gnu packages gcc) #:use-module (gnu packages perl) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix memoization) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (guix gexp) @@ -1081,27 +1082,28 @@ (define-public (make-libstdc++ gcc) (propagated-inputs '()) (synopsis "GNU C++ standard library"))) -(define (make-libstdc++-headers gcc) - ;; XXX: This package is for internal use to work around - ;; (see above). The main difference compared - ;; to the libstdc++ headers that come with 'gcc' is that - ;; is right under include/c++ and not under - ;; include/c++/x86_64-unknown-linux-gnu (aka. GPLUSPLUS_TOOL_INCLUDE_DIR). - (let ((libstdc++ (make-libstdc++ gcc))) - (package - (inherit libstdc++) - (name "libstdc++-headers") - (outputs '("out")) - (build-system trivial-build-system) - (arguments - '(#:builder (let* ((out (assoc-ref %outputs "out")) - (libstdc++ (assoc-ref %build-inputs "libstdc++"))) - (mkdir out) - (mkdir (string-append out "/include")) - (symlink (string-append libstdc++ "/include") - (string-append out "/include/c++"))))) - (inputs `(("libstdc++" ,libstdc++))) - (synopsis "Headers of GNU libstdc++")))) +(define make-libstdc++-headers + (mlambdaq (gcc) ;memoize to play well with the object cache + ;; XXX: This package is for internal use to work around + ;; (see above). The main difference compared + ;; to the libstdc++ headers that come with 'gcc' is that + ;; is right under include/c++ and not under + ;; include/c++/x86_64-unknown-linux-gnu (aka. GPLUSPLUS_TOOL_INCLUDE_DIR). + (let ((libstdc++ (make-libstdc++ gcc))) + (package + (inherit libstdc++) + (name "libstdc++-headers") + (outputs '("out")) + (build-system trivial-build-system) + (arguments + '(#:builder (let* ((out (assoc-ref %outputs "out")) + (libstdc++ (assoc-ref %build-inputs "libstdc++"))) + (mkdir out) + (mkdir (string-append out "/include")) + (symlink (string-append libstdc++ "/include") + (string-append out "/include/c++"))))) + (inputs `(("libstdc++" ,libstdc++))) + (synopsis "Headers of GNU libstdc++"))))) (define-public libstdc++-4.9 (make-libstdc++ gcc-4.9))