From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <guix-patches-bounces+larch=yhetil.org@gnu.org>
Received: from mp0.migadu.com ([2001:41d0:403:4876::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms13.migadu.com with LMTPS
	id eIVBJXiNMGekAAAAqHPOHw:P1
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 10 Nov 2024 10:39:52 +0000
Received: from aspmx1.migadu.com ([2001:41d0:403:4876::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp0.migadu.com with LMTPS
	id eIVBJXiNMGekAAAAqHPOHw
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 10 Nov 2024 11:39:52 +0100
X-Envelope-To: larch@yhetil.org
Authentication-Results: aspmx1.migadu.com;
	dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=i9Qs6bZa;
	dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=kjMeye03;
	dmarc=pass (policy=none) header.from=gnu.org;
	spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1731235192; a=rsa-sha256; cv=none;
	b=VEvvjPjJ+Btlxr96sZCIBhu0oWdW+P53U7f4QBcKf0U2YdxyIkA49QliZf07+u5g7W1Ngo
	FZuqIrnURfMroz/huNTjVkF1NR7qduCRPGXy4hzPo5yyQJz6C9k7GdotIawC95x2SkAWZw
	RgxE0G33yhTZkdRMY5Q05yP5NYfTD6XX44SFVfTXMj1ET66jnZ267licBJd0ltRN9ZIH0f
	IxsTISUY/t0jPXXpooGOpuD7gMLwASaiDAlM7LeQx+isOYDG4EW+PzWgEfR5WlVM8u2nIv
	hIWr7HAR18cRQYPcfJRcGrYZRhZsfDA3N5TOQKOv1P47VeesSKYa4OUJltn5bA==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=i9Qs6bZa;
	dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=kjMeye03;
	dmarc=pass (policy=none) header.from=gnu.org;
	spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1731235192;
	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:
	 content-transfer-encoding:content-transfer-encoding:resent-cc:
	 resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-unsubscribe:
	 list-subscribe:list-post:dkim-signature;
	bh=QqgkZpQ35wQ5nvcpIQz9aevtH9Zk2w3pu5kxkVZdcVQ=;
	b=B1N56bS53VkFQO/6zv4cnqUqX3417V3KMgtH0chTFRIyePPGxETL9z00SaILM/HBHCrSQx
	UnAiButlQAdQGi7l5IiPow2ezYGlp7w6KvoKisWEuJUL8MDM6hGkXIq6QVJuXNBvyjpuL0
	B9Qqt7OQAGTr5m6xrDlgimkYnZAeYpDLtN5FHz2X30YUDtzTKTddwlZIWYuHrT2EjUn3VU
	+/hI5NGR/TiJzZPpKFwqacz+V9c0YD8YJwKb2urgsKBmTTUpgliUKSUBaI+hbL945SDk4t
	VtK0Os6BcGub1ZM0GNBBGm8E/VaaNLsVpCBIESGszh0EJ8Ip+zVNU46Owdh3lg==
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 4B6C6798BA
	for <larch@yhetil.org>; Sun, 10 Nov 2024 11:39:52 +0100 (CET)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <guix-patches-bounces@gnu.org>)
	id 1tA5Lw-0000Oh-Cg; Sun, 10 Nov 2024 05:39:32 -0500
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 <Debian-debbugs@debbugs.gnu.org>)
 id 1tA5Lo-0000F9-0L
 for guix-patches@gnu.org; Sun, 10 Nov 2024 05:39:26 -0500
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 <Debian-debbugs@debbugs.gnu.org>)
 id 1tA5Ln-0007wX-NZ; Sun, 10 Nov 2024 05:39:23 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=debbugs.gnu.org; s=debbugs-gnu-org; 
 h=MIME-Version:References:In-Reply-To:Date:From:To:Subject;
 bh=MG+VinxqeEt9sHGJBjYsbzkB3oQWjKWdLFD2N5KB47k=; 
 b=i9Qs6bZaMDZGe60fvgtG+xltPCGyeAABbn1qm0YC1egBDMztpwCfXg3VMUNk6gUr0GoVW1xvjch/busaoZ/wKuq5hmeGBhvYn3XeqD1F/7K8OBOO/EzL7Y7lQoArul4yccCObRSV2jbW0EzYXjLS2+WvdtowNZZFMnb2+yP+abGGlVaD7Wn/4f5Bvqep4OM6Mtb1kMRuQ9MYND0QMkUu8c1EmzAzi+0gCjxKOaRVabV3O/jZLJdcFsLW2k9wT6bqwBDuwkGBDsfj55DeQ6KD2eiidoKjz2B+v9cAKHijYKo9MloPa19izdF2hqwxdBpt5kM+XO9TaWW5ozX9Y5fu1g==;
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1tA5LY-0002bO-3e; Sun, 10 Nov 2024 05:39:08 -0500
X-Loop: help-debbugs@gnu.org
Subject: [bug#74290] [PATCH 04/31] gnu: gcc: Add indirections current-gcc,
 current-gcc-toolchain.
Resent-From: Janneke Nieuwenhuizen <janneke@gnu.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: andreas@enge.fr, efraim@flashner.co.il, ekaitz@elenq.tech,
 glv@posteo.net, cox.katherine.e+guix@gmail.com, ludo@gnu.org,
 me@bonfacemunyoki.com, sharlatanus@gmail.com, zimon.toutoune@gmail.com,
 vagrant@debian.org, jgart@dismail.de, guix-patches@gnu.org
Resent-Date: Sun, 10 Nov 2024 10:39:08 +0000
Resent-Message-ID: <handler.74290.B74290.17312351459938@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 74290
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 74290@debbugs.gnu.org
Cc: Andreas Enge <andreas@enge.fr>, Efraim Flashner <efraim@flashner.co.il>,
 Ekaitz Zarraga <ekaitz@elenq.tech>, Guillaume Le Vaillant <glv@posteo.net>,
 Katherine Cox-Buday <cox.katherine.e+guix@gmail.com>,
 Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@gnu.org>,
 Munyoki Kilyungi <me@bonfacemunyoki.com>,
 Sharlatan Hellseher <sharlatanus@gmail.com>,
 Simon Tournier <zimon.toutoune@gmail.com>,
 Vagrant Cascadian <vagrant@debian.org>, jgart <jgart@dismail.de>
X-Debbugs-Original-Xcc: Andreas Enge <andreas@enge.fr>,
 Efraim Flashner <efraim@flashner.co.il>, Ekaitz Zarraga <ekaitz@elenq.tech>,
 Guillaume Le Vaillant <glv@posteo.net>,
 Katherine Cox-Buday <cox.katherine.e+guix@gmail.com>,
 Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@gnu.org>,
 Munyoki Kilyungi <me@bonfacemunyoki.com>,
 Sharlatan Hellseher <sharlatanus@gmail.com>,
 Simon Tournier <zimon.toutoune@gmail.com>,
 Vagrant Cascadian <vagrant@debian.org>, jgart <jgart@dismail.de>
Received: via spool by 74290-submit@debbugs.gnu.org id=B74290.17312351459938
 (code B ref 74290); Sun, 10 Nov 2024 10:39:08 +0000
Received: (at 74290) by debbugs.gnu.org; 10 Nov 2024 10:39:05 +0000
Received: from localhost ([127.0.0.1]:55697 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1tA5LR-0002ZP-71
 for submit@debbugs.gnu.org; Sun, 10 Nov 2024 05:39:04 -0500
Received: from eggs.gnu.org ([209.51.188.92]:54604)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <janneke@gnu.org>) id 1tA5LG-0002Wy-Tu
 for 74290@debbugs.gnu.org; Sun, 10 Nov 2024 05:38:55 -0500
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 <janneke@gnu.org>)
 id 1tA5LB-0007mH-FI; Sun, 10 Nov 2024 05:38:45 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To:
 From; bh=MG+VinxqeEt9sHGJBjYsbzkB3oQWjKWdLFD2N5KB47k=; b=kjMeye03qRUy9z4A951x
 lRJp1zmj2a9YXaZvQs+MUHAwdRnldt6lUEXtFEehS7J/xnbXLRM15UQ27dkKljc5iZTBItqQNRxoq
 RbbUKDYYhtYomRSguEDnvq7n3e84h1cesnUE2Tt2iLKZIbkKrHLwAT/c7uGLBydltdVAi0xQ6dm4O
 hrXP3mMOoFsbH0rIDDSEU+wogLDs5Gt1bftHHA4dDTP4TPyQpH19CST77mc9S/vLCJsJrrr0IOZKb
 gN+yaw9Ms8JDJn1HgqGSDpUK3u+lZ0JDJ/34+FpbDfndI4dWqXsP9g4/wM4xMFkOWxUAPCYdR/Aaa
 DSAGgMpEzEoi0g==;
From: Janneke Nieuwenhuizen <janneke@gnu.org>
Date: Sun, 10 Nov 2024 11:38:00 +0100
Message-ID: <3e5801ce2795b91ba96a60ad239de717d0337a97.1731232753.git.janneke@gnu.org>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <cover.1731232753.git.janneke@gnu.org>
References: <cover.1731232753.git.janneke@gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: guix-patches@gnu.org
List-Id: <guix-patches.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>,
 <mailto:guix-patches-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/guix-patches>
List-Post: <mailto:guix-patches@gnu.org>
List-Help: <mailto:guix-patches-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>,
 <mailto:guix-patches-request@gnu.org?subject=subscribe>
Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org
Sender: guix-patches-bounces+larch=yhetil.org@gnu.org
X-Migadu-Country: US
X-Migadu-Flow: FLOW_IN
X-Migadu-Spam-Score: -0.86
X-Spam-Score: -0.86
X-Migadu-Queue-Id: 4B6C6798BA
X-Migadu-Scanner: mx10.migadu.com
X-TUID: vwnhveQXHqux

Throughout: use (current-gcc) and (current-gcc-toolchain) instead of gcc and
gcc-toolchain.

* gnu/packages/gcc.scm (current-gcc): New procedure.
(gcc): Deprecate.
* gnu/packages/commencement.scm (current-gcc-toolchain): New procedure.
(gcc-toolchain): Deprecate.

Change-Id: I538897e53e2c9956abdc53c67621bb52cbd78a50
---
 gnu/packages/avr.scm            |  7 ++++---
 gnu/packages/benchmark.scm      |  6 ++++--
 gnu/packages/bootloaders.scm    |  2 +-
 gnu/packages/bootstrap.scm      |  4 ++--
 gnu/packages/c.scm              |  4 ++--
 gnu/packages/chicken.scm        |  7 ++++---
 gnu/packages/commencement.scm   | 33 +++++++++++++++++++--------------
 gnu/packages/containers.scm     |  5 +++--
 gnu/packages/cross-base.scm     |  4 ++--
 gnu/packages/dlang.scm          |  3 ++-
 gnu/packages/engineering.scm    |  4 ++--
 gnu/packages/gawk.scm           |  3 ++-
 gnu/packages/gcc.scm            | 21 ++++++++++++++-------
 gnu/packages/golang.scm         |  3 ++-
 gnu/packages/julia-xyz.scm      |  3 ++-
 gnu/packages/lisp.scm           |  3 ++-
 gnu/packages/llvm.scm           |  7 ++++---
 gnu/packages/make-bootstrap.scm | 20 ++++++++++----------
 gnu/packages/mpi.scm            |  3 ++-
 gnu/packages/parallel.scm       |  5 +++--
 gnu/packages/rocm.scm           |  3 ++-
 21 files changed, 88 insertions(+), 62 deletions(-)

diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm
index 6042c1bd55..00dc124aa9 100644
--- a/gnu/packages/avr.scm
+++ b/gnu/packages/avr.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -53,7 +54,7 @@ (define make-avr-binutils
       (inherit (cross-binutils "avr"))
       (name "avr-binutils"))))
 
-(define* (make-avr-gcc/implementation #:key (xgcc gcc))
+(define* (make-avr-gcc/implementation #:key (xgcc (current-gcc)))
   "Return a XGCC-base cross-compiler for the AVR target."
   (let ((xgcc (cross-gcc "avr" #:xgcc xgcc #:xbinutils (make-avr-binutils))))
     (package
@@ -96,7 +97,7 @@ (define* (make-avr-gcc/implementation #:key (xgcc gcc))
               (variable "CROSS_LIBRARY_PATH")
               (files '("avr/lib")))))
       (native-inputs
-       `(("gcc" ,gcc)
+       `(("gcc" ,(current-gcc))
          ,@(package-native-inputs xgcc))))))
 
 (define make-avr-gcc
@@ -136,7 +137,7 @@ (define* (make-avr-libc/implementation #:key
 (define make-avr-libc
   (memoize make-avr-libc/implementation))
 
-(define* (make-avr-toolchain/implementation #:key (xgcc gcc))
+(define* (make-avr-toolchain/implementation #:key (xgcc (current-gcc)))
   (let ((avr-binutils (make-avr-binutils))
         (avr-libc (make-avr-libc #:xgcc (cross-gcc "avr" #:xgcc xgcc)))
         (avr-gcc (make-avr-gcc #:xgcc xgcc)))
diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm
index 326bbc99b4..c802e105ed 100644
--- a/gnu/packages/benchmark.scm
+++ b/gnu/packages/benchmark.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2022 Tomasz Jeneralczyk <tj@schwi.pl>
 ;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -75,8 +76,8 @@ (define-module (gnu packages benchmark)
 
 ;; Lazily resolve the gcc-toolchain to avoid a circular dependency.
 (define gcc-toolchain*
-  (delay (module-ref (resolve-interface '(gnu packages commencement))
-                     'gcc-toolchain)))
+  (delay ((module-ref (resolve-interface '(gnu packages commencement))
+                      'current-gcc-toolchain))))
 
 (define-public fio
   (package
@@ -379,6 +380,7 @@ (define-public phoronix-test-suite
      (list bash
            coreutils
            (force gcc-toolchain*)
+           gcc-toolchain*
            gnu-make
            gzip
            php
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index fcc1088fd6..8ae9621e5b 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -1707,7 +1707,7 @@ (define u-boot-ts-mx6
               (add-before 'build 'adjust-for-current-gcc
                 (lambda _
                   (let ((gcc-major-version #$(version-major
-                                              (package-version gcc))))
+                                              (package-version (current-gcc)))))
                     (copy-file "include/linux/compiler-gcc6.h"
                                (string-append "include/linux/compiler-gcc"
                                               gcc-major-version ".h")))
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 3743abf9fe..c4640b62e1 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2012-2020, 2024 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015, 2018, 2019 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2017, 2020, 2024 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2018, 2020, 2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2018, 2020, 2022, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2019 Carl Dong <contact@carldong.me>
 ;;; Copyright © 2019 Léo Le Bouter <lle-bout@zaclys.net>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
@@ -311,7 +311,7 @@ (define* (glibc-dynamic-linker
                                         gnu-triplet->nix-system)
                                  (%current-system))))
   "Return the name of Glibc's dynamic linker for SYSTEM."
-  ;; See the 'SYSDEP_KNOWN_INTERPRETER_NAMES' cpp macro in libc.
+  ;; See the appropriate 'shlib-versions' file in libc.
   (let ((platform (false-if-platform-not-found
                    (lookup-platform-by-system system))))
     (cond
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index 13fdb99424..f52a7c603e 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -6,7 +6,7 @@
 ;;; Copyright © 2019, 2020, 2022-2024 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2019, 2021 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2019 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020, 2021 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2020 Katherine Cox-Buday <cox.katherine.e@gmail.com>
 ;;; Copyright © 2020, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
@@ -178,7 +178,7 @@ (define-public cproc
                           (string-append "--with-ld=" #$(ld-for-target))
                           (string-append "--with-gcc-libdir=" gcc-lib))))))))
       (inputs `(("qbe" ,qbe)
-                ("gcc:lib" ,gcc "lib")))
+                ("gcc:lib" ,(current-gcc) "lib")))
       (supported-systems (list "x86_64-linux" "aarch64-linux"))
       (synopsis "Simple C11 compiler backed by QBE")
       (description "@code{cproc} is a C compiler using QBE as a backend,
diff --git a/gnu/packages/chicken.scm b/gnu/packages/chicken.scm
index 3743ae3e2a..64fd3cb86b 100644
--- a/gnu/packages/chicken.scm
+++ b/gnu/packages/chicken.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2020 Ekaitz Zarraga <ekaitz@elenq.tech>
 ;;; Copyright © 2020 Evan Hanson <evhan@foldling.org>
 ;;; Copyright © 2020 raingloom <raingloom@riseup.net>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -69,9 +70,9 @@ (define-public chicken
             (files (list "var/lib/chicken/11")))))
     ;; Reference gcc-toolchain lazily to avoid circular module dependency
     ;; problems.
-    (propagated-inputs (list (module-ref (resolve-interface
-                                          '(gnu packages commencement))
-                                         'gcc-toolchain)))
+    (propagated-inputs (list ((module-ref (resolve-interface
+                                           '(gnu packages commencement))
+                                          'current-gcc-toolchain))))
     (home-page "https://www.call-cc.org/")
     (synopsis "R5RS Scheme implementation that compiles native code via C")
     (description
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index ce40f0cea6..2b43759dac 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -73,7 +73,8 @@ (define-module (gnu packages commencement)
   #:use-module (guix utils)
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 vlist)
-  #:use-module (ice-9 match))
+  #:use-module (ice-9 match)
+  #:export (current-gcc-toolchain))
 
 ;;; Commentary:
 ;;;
@@ -908,7 +909,7 @@ (define gcc-core-mesboot0
   ;; with gcc-2.95.3, binutils (2.14.0, 2.20.1a) and glibc-2.2.5 we found a
   ;; GNU toolchain triplet "that works".
   (package
-    (inherit gcc)
+    (inherit (current-gcc))
     (name "gcc-core-mesboot0")
     (version "2.95.3")
     (source (origin
@@ -2319,19 +2320,19 @@ (define libstdc++-boot0-gcc7
 
 (define gcc-boot0
   (package
-    (inherit gcc)
+    (inherit (current-gcc))
     (name "gcc-cross-boot0")
-    (outputs (delete "debug" (package-outputs gcc)))
+    (outputs (delete "debug" (package-outputs (current-gcc))))
     (source
      (bootstrap-origin
       (origin
-        (inherit (package-source gcc))
+        (inherit (package-source (current-gcc)))
         (snippet
          #~(begin
              ;; XXX: The GCC test suite contains files with non-ASCII file
              ;; names, which cannot be repacked by BOOTSTRAP-ORIGIN.  Nor
              ;; can it be deleted from Guile, so resort to this evil hack.
-             #$(origin-snippet (package-source gcc))
+             #$(origin-snippet (package-source (current-gcc)))
              (system* #$(file-append (let-system system
                                        ;; 'coreutils-boot0' is Linux-only.
                                        (if (target-hurd? system)
@@ -2348,7 +2349,7 @@ (define gcc-boot0
                   (ice-9 regex)
                   (srfi srfi-1)
                   (srfi srfi-26))
-      (substitute-keyword-arguments (package-arguments gcc)
+      (substitute-keyword-arguments (package-arguments (current-gcc))
         ((#:configure-flags flags)
          #~(append (list #$(string-append "--target=" (boot-triplet))
 
@@ -2436,7 +2437,7 @@ (define gcc-boot0
                    (with-directory-excursion
                        (string-append out "/lib/gcc/"
                                       #$(boot-triplet)
-                                      "/" #$(package-version gcc))
+                                      "/" #$(package-version (current-gcc)))
                      (symlink "libgcc.a" "libgcc_eh.a"))))))))))
 
     (inputs `(("gmp-source" ,(bootstrap-origin (package-source gmp-6.0)))
@@ -2951,7 +2952,7 @@ (define/system-dependent glibc-final-with-bootstrap-bash
 (define (cross-gcc-wrapper gcc binutils glibc bash)
   "Return a wrapper for the pseudo-cross toolchain GCC/BINUTILS/GLIBC
 that makes it available under the native tool names."
-  (package (inherit gcc)
+  (package (inherit (current-gcc))
     (name (string-append (package-name gcc) "-wrapped"))
     (source #f)
     (build-system trivial-build-system)
@@ -3218,7 +3219,7 @@ (define gcc-final
                   (srfi srfi-26)
                   ,@%default-gnu-modules)
 
-      (substitute-keyword-arguments (package-arguments gcc)
+      (substitute-keyword-arguments (package-arguments (current-gcc))
         ((#:make-flags flags)
          ;; Since $LIBRARY_PATH is not honored, add the relevant flags.
          #~(let ((zlib (assoc-ref %build-inputs "zlib")))
@@ -3541,8 +3542,8 @@ (define* (make-gcc-toolchain gcc
   (let ((gcc (if libc (make-gcc-libc gcc libc) gcc))
         (libc (if libc libc glibc-final)))
     (package
-      (name (string-append (package-name gcc) "-toolchain"))
-      (version (package-version gcc))
+      (name (string-append (package-name (current-gcc)) "-toolchain"))
+      (version (package-version (current-gcc)))
       (source #f)
       (build-system trivial-build-system)
       (arguments
@@ -3639,13 +3640,17 @@ (define-public gcc-toolchain-14
   (make-gcc-toolchain gcc-14))
 
 ;; The default GCC
-(define-public gcc-toolchain
+(define (current-gcc-toolchain)
+  "The current default gcc-toolchain version."
   gcc-toolchain-11)
 
+(define-public gcc-toolchain
+  (deprecated-package "gcc-toolchain" gcc-toolchain-11))
+
 (define-public gcc-toolchain-aka-gcc
   ;; It's natural for users to try "guix install gcc".  This package
   ;; automatically "redirects" them to 'gcc-toolchain'.
-  (deprecated-package "gcc" gcc-toolchain))
+  (deprecated-package "gcc" (current-gcc-toolchain)))
 
 
 (define-public gdc-toolchain-10
diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index d32bc2704a..78304cebbc 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
 ;;; Copyright © 2024 Foundation Devices, Inc. <hello@foundation.xyz>
 ;;; Copyright © 2024 Jean-Pierre De Jesus DIAZ <jean@foundation.xyz>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -533,7 +534,7 @@ (define-public podman
                   (,(string-append #$catatonit      "/bin")
                    ,(string-append #$conmon         "/bin")
                    ,(string-append #$crun           "/bin")
-                   ,(string-append #$gcc            "/bin") ; cpp
+                   ,(string-append #$(current-gcc)  "/bin") ; cpp
                    ,(string-append #$iptables       "/sbin")
                    ,(string-append #$passt          "/bin")
                    ,(string-append #$procps         "/bin") ; ps
@@ -667,7 +668,7 @@ (define-public buildah
                   (,(string-append #$output "/_guix")))
                 `("PATH" suffix
                   (,(string-append #$crun           "/bin")
-                   ,(string-append #$gcc            "/bin") ; cpp
+                   ,(string-append #$(current-gcc)  "/bin") ; cpp
                    ,(string-append #$passt          "/bin")
                    "/run/privileged/bin")))))
           (add-after 'install 'install-completions
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index cecc21083e..9c701efae8 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013-2018, 2020, 2023-2024 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2016, 2019, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2016, 2019, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
@@ -61,7 +61,7 @@ (define-syntax %xgcc
   ;;
   ;; Note: This is a macro so that we do not refer to 'gcc' from the top
   ;; level, which would lead to circular-dependency issues.
-  (identifier-syntax gcc))
+  (identifier-syntax (current-gcc)))
 
 (define %gcc-include-paths
   ;; Environment variables for header search paths.
diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm
index 8bf0ee685e..654d5b2281 100644
--- a/gnu/packages/dlang.scm
+++ b/gnu/packages/dlang.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2021, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2022 ( <paren@disroot.org>
 ;;; Copyright © 2022 Esther Flashner <esther@flashner.co.il>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -426,7 +427,7 @@ (define dmd-bootstrap
     (build-system gnu-build-system)
     (arguments
      (list
-      #:disallowed-references (list (gexp-input (canonical-package gcc)
+      #:disallowed-references (list (gexp-input (canonical-package (current-gcc))
                                                 "lib"))
       ;; Disable tests, as gdmd cannot cope with some arguments used such as
       ;; '-conf'.
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 6f449f0c39..07f3edd4dd 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2336,8 +2336,8 @@ (define-public freehdl
            coreutils
 
            ;; Lazily resolve the gcc-toolchain to avoid a circular dependency.
-           (module-ref (resolve-interface '(gnu packages commencement))
-                       'gcc-toolchain)
+           ((module-ref (resolve-interface '(gnu packages commencement))
+                        'current-gcc-toolchain))
 
            guile-2.2
            perl
diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm
index 6a77a692f5..a8b8369d7b 100644
--- a/gnu/packages/gawk.scm
+++ b/gnu/packages/gawk.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2018, 2022-2024 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2021, 2022 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2022 Paul A. Patience <paul@apatience.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -227,7 +228,7 @@ (define-public cppawk
     (inputs
      (list coreutils                    ; For dirname, mktemp, printf, rm
            gawk-mpfr                    ; Default variant, but supports others
-           gcc                          ; For cpp
+           (current-gcc)                ; For cpp
            sed))
     (home-page "https://www.kylheku.com/cgit/cppawk/")
     (synopsis "Wrapper script that adds C preprocessing to Awk")
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index c9e475b676..3b5d05b9a9 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -17,6 +17,7 @@
 ;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
 ;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2024 Nguyễn Gia Phong <mcsinyx@disroot.org>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -57,7 +58,8 @@ (define-module (gnu packages gcc)
   #:use-module (guix utils)
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 match)
-  #:use-module (ice-9 regex))
+  #:use-module (ice-9 regex)
+  #:export (current-gcc))
 
 (define %gcc-infrastructure
   ;; Base URL for GCC's infrastructure.
@@ -857,7 +859,12 @@ (define-public gcc-14
 
 ;; Note: When changing the default gcc version, update
 ;;       the gcc-toolchain-* definitions.
-(define-public gcc gcc-11)
+(define (current-gcc)
+  "The current default gcc version."
+  gcc-11)
+
+(define-public gcc
+  (deprecated-package "gcc" gcc-11))
 
 
 ;;;
@@ -868,7 +875,7 @@ (define-public gcc-2.95
   ;; Note: 'gcc-core-mesboot0' in commencement.scm provides 2.95 as well, but
   ;; with additional tricks to support compilation with TinyCC and Mes-libc.
   (package
-    (inherit gcc)
+    (inherit (current-gcc))
     (version "2.95.3")
     (source (origin
               (method url-fetch)
@@ -1045,7 +1052,7 @@ (define-public (make-libstdc++ gcc)
 
 (define libstdc++
   ;; Libstdc++ matching the default GCC.
-  (make-libstdc++ gcc))
+  (make-libstdc++ (current-gcc)))
 
 (define libstdc++-headers
   ;; XXX: This package is for internal use to work around
@@ -1100,7 +1107,7 @@ (define (make-libiberty gcc)
     (synopsis "Collection of subroutines used by various GNU programs")))
 
 (define-public libiberty
-  (make-libiberty gcc))
+  (make-libiberty (current-gcc)))
 
 (define* (custom-gcc gcc name languages
                      #:optional
@@ -1157,7 +1164,7 @@ (define-public gfortran-13
 
 (define-public gfortran
   (hidden-package
-   (custom-gcc gcc
+   (custom-gcc (current-gcc)
                "gfortran" '("fortran")
                %generic-search-paths)))
 
@@ -1186,7 +1193,7 @@ (define-public gdc-11
 ;;; Alias tracking the latest GDC version.
 (define-public gdc
   (hidden-package
-   (custom-gcc gcc "gdc" '("d")
+   (custom-gcc (current-gcc) "gdc" '("d")
                %generic-search-paths)))
 
 (define-public (make-libgccjit gcc)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 00dde61f2c..27e0db9cb1 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -47,6 +47,7 @@
 ;;; Copyright © 2024 Greg Hogan <code@greghogan.com>
 ;;; Copyright © 2024 Brennan Vincent <brennan@umanwizard.com>
 ;;; Copyright © 2024 André Batista <nandre@riseup.net>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -253,7 +254,7 @@ (define-public go-1.4
     (inputs
      `(("tzdata" ,tzdata)
        ("pcre" ,pcre)
-       ("gcc:lib" ,(canonical-package gcc) "lib")))
+       ("gcc:lib" ,(canonical-package (current-gcc)) "lib")))
     (native-inputs
      (list pkg-config which net-base perl))
 
diff --git a/gnu/packages/julia-xyz.scm b/gnu/packages/julia-xyz.scm
index 77385ee6e0..3860da608e 100644
--- a/gnu/packages/julia-xyz.scm
+++ b/gnu/packages/julia-xyz.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2021 jgart <jgart@dismail.de>
 ;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2024 Spencer King <spencer.king@geneoscopy.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -5170,7 +5171,7 @@ (define-public julia-quadmath
     (propagated-inputs
      (list julia-requires))
     (inputs
-     `(("gcc:lib" ,gcc "lib")))
+     `(("gcc:lib" ,(current-gcc) "lib")))
     (native-inputs
      (list julia-specialfunctions))
     (home-page "https://github.com/JuliaMath/Quadmath.jl")
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 6c16d8ab71..8dc3208327 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2024 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2024 bigbug <bigbookofbug@proton.me>
 ;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -388,7 +389,7 @@ (define-public clasp-cl
         (base32 "10jjhcid6qp64gx29iyy5rqqijwy8hrvx66f0xabdj8w3007ky39"))))
     (build-system gnu-build-system)
     (inputs
-     (list boost clang-15 fmt `(,gcc "lib") gmp libelf libunwind llvm-15))
+     (list boost clang-15 fmt `(,(current-gcc) "lib") gmp libelf libunwind llvm-15))
     (native-inputs
      (list binutils-gold ninja pkg-config sbcl))
     (arguments
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 9f851a478e..cd2ad311a0 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -27,6 +27,7 @@
 ;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
 ;;; Copyright © 2023 Hilton Chain <hako@ultrarare.space>
 ;;; Copyright © 2023, 2024 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -89,8 +90,8 @@ (define-module (gnu packages llvm)
 
 ;; Lazily resolve the gcc-toolchain to avoid a circular dependency.
 (define gcc-toolchain*
-  (delay (module-ref (resolve-interface '(gnu packages commencement))
-                     'gcc-toolchain)))
+  (delay ((module-ref (resolve-interface '(gnu packages commencement))
+                      'current-gcc-toolchain))))
 
 (define* (system->llvm-target #:optional
                               (system (or (and=> (%current-target-system)
@@ -250,7 +251,7 @@ (define* (clang-from-llvm llvm clang-runtime
     (native-inputs (package-native-inputs llvm))
     (inputs
      `(("libxml2" ,libxml2)
-       ("gcc-lib" ,gcc "lib")
+       ("gcc-lib" ,(current-gcc) "lib")
        ,@(package-inputs llvm)
        ,@(if tools-extra
              `(("clang-tools-extra" ,tools-extra))
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index edc536bff4..c6293b9a38 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2017, 2021 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018, 2019 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2018, 2019, 2021, 2022, 2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2018, 2019, 2021, 2022, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2019, 2020, 2022 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
@@ -108,13 +108,13 @@ (define gcc-for-bootstrap
   (mlambdaq (glibc)
     "Return a variant of GCC that uses the bootstrap variant of GLIBC."
     (package
-      (inherit gcc)
+      (inherit (current-gcc))
       (outputs '("out")) ;all in one so libgcc_s is easily found
       (inputs
        `( ;; Distinguish the name so we can refer to it below.
          ("bootstrap-libc" ,(glibc-for-bootstrap glibc))
          ("libc:static" ,(glibc-for-bootstrap glibc) "static")
-         ,@(package-inputs gcc))))))
+         ,@(package-inputs (current-gcc)))))))
 
 (define (package-with-relocatable-glibc p)
   "Return a variant of P that uses the libc as defined by
@@ -153,7 +153,7 @@ (define (package-with-relocatable-glibc p)
                              (cons (search-path-specification
                                     (variable "CROSS_CPLUS_INCLUDE_PATH")
                                     (files '("include")))
-                                   (package-search-paths gcc)))))
+                                   (package-search-paths (current-gcc))))))
             ("cross-binutils" ,(cross-binutils target))
             ,@(%final-inputs)))
         `(("libc" ,(glibc-for-bootstrap glibc))
@@ -481,11 +481,11 @@ (define (%glibc-stripped)
 (define %gcc-static
   ;; A statically-linked GCC, with stripped-down functionality.
   (package-with-relocatable-glibc
-   (package (inherit gcc)
+   (package (inherit (current-gcc))
      (name "gcc-static")
      (outputs '("out"))                           ; all in one
      (arguments
-      (substitute-keyword-arguments (package-arguments gcc)
+      (substitute-keyword-arguments (package-arguments (current-gcc))
         ((#:modules modules %default-gnu-modules)
          `((srfi srfi-1)
            (srfi srfi-26)
@@ -536,7 +536,7 @@ (define %gcc-static
      (inputs
       `(("zlib:static" ,zlib "static")
         ("isl:static" ,isl "static")
-        ,@(package-inputs gcc)))
+        ,@(package-inputs (current-gcc))))
      (native-inputs
       (if (%current-target-system)
           `(;; When doing a Canadian cross, we need GMP/MPFR/MPC both
@@ -549,13 +549,13 @@ (define %gcc-static
             ("gmp-native" ,gmp)
             ("mpfr-native" ,mpfr)
             ("mpc-native" ,mpc)
-            ,@(package-native-inputs gcc))
-          (package-native-inputs gcc))))))
+            ,@(package-native-inputs (current-gcc)))
+          (package-native-inputs (current-gcc)))))))
 
 (define %gcc-stripped
   ;; The subset of GCC files needed for bootstrap.
   (package
-    (inherit gcc)
+    (inherit (current-gcc))
     (name "gcc-stripped")
     (build-system trivial-build-system)
     (source #f)
diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index bc1fd797d6..e956167137 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2018 Paul Garlick <pgarlick@tourbillion-technology.com>
 ;;; Copyright © 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2024 Romain Garbage <romain.garbage@inria.fr>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -378,7 +379,7 @@ (define-public openmpi-5
                                   "ompi/tools/ompi_info/param.c")
                      (("_ABSOLUTE") "")))))
 
-           #:disallowed-references (list (canonical-package gcc))))))
+           #:disallowed-references (list (canonical-package (current-gcc)))))))
 
 (define-public openmpi-c++
   (package/inherit openmpi
diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm
index 85f8a114c3..c0e3f44bcd 100644
--- a/gnu/packages/parallel.scm
+++ b/gnu/packages/parallel.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
 ;;; Copyright © 2024 Romain Garbage <romain.garbage@inria.fr>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -665,7 +666,7 @@ (define-public openpmix
 
           ;; Don't keep a reference to GCC.
           #:disallowed-references (and (not (%current-target-system))
-                                       (list (canonical-package gcc)))
+                                       (list (canonical-package (current-gcc))))
 
           #:phases
           #~(modify-phases %standard-phases
@@ -737,7 +738,7 @@ (define-public prrte
                      (string-append "prte_launch_agent = \""
                                     #$output "/bin/prted\";\n"))))))
 
-          #:disallowed-references (list (canonical-package gcc))))
+          #:disallowed-references (list (canonical-package (current-gcc)))))
    (inputs (list libevent
                  `(,hwloc "lib")
                  openpmix))
diff --git a/gnu/packages/rocm.scm b/gnu/packages/rocm.scm
index e883371928..2f315e3985 100644
--- a/gnu/packages/rocm.scm
+++ b/gnu/packages/rocm.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net>
 ;;; Copyright © 2022, 2023 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This program is free software; you can redistribute it and/or modify it
 ;;; under the terms of the GNU General Public License as published by
@@ -131,7 +132,7 @@ (define-public roct-thunk-interface
     (build-system cmake-build-system)
     (arguments `(#:tests? #f)) ; Not sure how to run tests.
     (inputs (list libdrm numactl))
-    (native-inputs (list `(,gcc "lib") pkg-config))
+    (native-inputs (list `(,(current-gcc) "lib") pkg-config))
     (home-page "https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface")
     (synopsis "Radeon Open Compute Thunk Interface")
     (description "User-mode API interfaces used to interact with the ROCk
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com