GNU bug report logs - #74290
[PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd.

Previous Next

Package: guix-patches;

Reported by: Janneke Nieuwenhuizen <janneke <at> gnu.org>

Date: Sun, 10 Nov 2024 10:35:02 UTC

Severity: normal

Tags: patch

Done: Janneke Nieuwenhuizen <janneke <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #602 received at 74290 <at> debbugs.gnu.org (full text, mbox):

From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
To: 74290 <at> debbugs.gnu.org
Subject: [PATCH v4 52/58] gnu: Use gcc-14, gcc-toolchain-14 on the 64bit Hurd.
Date: Sun, 24 Nov 2024 08:55:15 +0100
This enables building packages in a 64bit childhurd.  It will not enable
offloading to a childhurd.

* guix/utils.scm (host-hurd?, host-x86-64, host-hurd64?): New procedures.
* gnu/packages/commencement.scm (gcc-toolchain): Use them to determine if the
host is a 64bit Hurd, and use gcc-toolchain-14.
* gnu/packages/gcc.scm (gcc): Likewise, to use gcc-14.

Change-Id: I55e43fdc61e3ea5fc13065fc7ca854b951c94930
---
 gnu/packages/commencement.scm |  4 +++-
 gnu/packages/gcc.scm          |  5 ++++-
 guix/utils.scm                | 19 +++++++++++++++++++
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index a14de3002f..3f11bb3384 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 (host-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 e437bf5826..6247919fec 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -858,7 +858,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 (host-hurd64?)
+      gcc-14
+      gcc-11))
 
 
 ;;;
diff --git a/guix/utils.scm b/guix/utils.scm
index e100c03365..537d0490e0 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -96,6 +96,9 @@ (define-module (guix utils)
             system-hurd?
             target-hurd64?
             system-hurd64?
+            host-hurd?
+            host-hurd64?
+            host-x86-64?
             target-mingw?
             target-x86-32?
             target-x86-64?
@@ -729,6 +732,22 @@ (define* (system-hurd64?)
   (and (system-hurd?)
        (target-64bit? (%current-system))))
 
+(define (host-hurd?)
+  "Are we running on a Hurd system?  This is almost never the right function,
+use target-hurd? or system-hurd? instead."
+  (equal? (utsname:sysname (uname)) "GNU"))
+
+(define (host-x86-64?)
+  "Are we running on a x86_64 system?  This is almost never the right
+function, use target-x86-64? or system-x86-64? instead."
+  (equal? (utsname:machine (uname)) "x86_64"))
+
+(define (host-hurd64?)
+  "Are we running on a 64bit Hurd?  This is almost never the right
+function, use target-hurd64? or system-hurd64? instead."
+  (and (host-hurd?)
+       (host-x86-64?)))
+
 (define* (target-mingw? #:optional (target (%current-target-system)))
   "Is the operating system of TARGET Windows?"
   (and target
-- 
2.46.0





This bug report was last modified 175 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.