Subject: [bug#74290] [PATCH v2 05/40] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.

From: <[email-masked]>
Date: Mon, 18 Nov 2024 09:45:59 +0100

> Ludovic Courtès writes:
>
>> Janneke Nieuwenhuizen <[email-masked]> skribis:
>>
>> Then, as a second step, we could prepare a ‘core-packages-team’ branch
>> that upgrades ‘gcc’ globally, and that way we keep something consistent
>> and simpler, without ‘current-gcc’.  (Though it means we’d have to wait
>> before we can build natively on x86_64-gnu.)
>>
>> WDYT?
>
> I've been thinking about this route and decided against it because it
> seems to me that upgrading to gcc-14 will cause a lot of trouble/work.
>
> However, if that work is shared, and we have the build farm to help, it
> may be the best route.  Maybe the wait doesn't have to be too long?
> Also, in the mean time, upstream support might improve.
>
> Maybe we can decide to go the route you propose and also keep this
> current-gcc patch on the hurd-team branch for a bit (we prepend a fat
> REMOVEME in front of it).  We can keep working on native Hurd builds
> that use gcc-14 on hurd-team using this hack, until core-packages-team
> is ready to make it obsolete?

So, what about if we do, in addition to the %xgcc => gcc-14 in
cross-base -- we use gcc-14 on the 64bit hurd /system/:

--8<---------------cut here---------------start------------->8---
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index a14de3002f..2b0b4b07b4 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3642,7 +3642,9 @@ (define-public gcc-toolchain-14
 
 ;; The default GCC
 (define-public gcc-toolchain
-  gcc-toolchain-11)
+  (if (system-hurd64?)
+      gcc-toolchain-14
+      gcc-toolchain-11))
 
 (define-public gcc-toolchain-aka-gcc
   ;; It's natural for users to try "guix install gcc".  This package
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 64ba37fd69..d90502f403 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -857,7 +857,10 @@ (define-public gcc-14
 
 ;; Note: When changing the default gcc version, update
 ;;       the gcc-toolchain-* definitions.
-(define-public gcc gcc-11)
+(define-public gcc
+  (if (system-hurd64?)
+      gcc-14
+      gcc-11))
 
 
 ;;;
--8<---------------cut here---------------end--------------->8---

Wouldn't that just work?

We can do that in parallel with the gcc-14 update in core-packages-team.

Greetings,
Janneke

-- 
Janneke Nieuwenhuizen <[email-masked]>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com