diff mbox series

[bug#74290,31/31] system: hurd: Use 64bit gnumach for the 64bit Hurd.

Message ID 52f615e031e134f37d20b5bda18e24391c6654c0.1731232753.git.janneke@gnu.org
State New
Headers show
Series Add support for x86_64-gnu, aka the 64bit Hurd. | expand

Commit Message

Janneke Nieuwenhuizen Nov. 10, 2024, 10:38 a.m. UTC
* gnu/system/hurd.scm (%hurd-default-operating-system-kernel): Use
actual (%current-target-system) to specify (%current-system) instead of using
hardcoded "i686-linux".

Change-Id: Ifc179bce221b1a54461860c24ba400cf6932ec86
---
 gnu/system/hurd.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Comments

Janneke Nieuwenhuizen Nov. 10, 2024, 2:40 p.m. UTC | #1
Janneke Nieuwenhuizen writes:

> * gnu/system/hurd.scm (%hurd-default-operating-system-kernel): Use
> actual (%current-target-system) to specify (%current-system) instead of using
> hardcoded "i686-linux".
>
> Change-Id: Ifc179bce221b1a54461860c24ba400cf6932ec86
> ---
>  gnu/system/hurd.scm | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
> index 9a351529e8..58e41959f4 100644
> --- a/gnu/system/hurd.scm
> +++ b/gnu/system/hurd.scm
> @@ -18,6 +18,7 @@
>  ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
>  
>  (define-module (gnu system hurd)
> +  #:use-module (ice-9 match)
>    #:use-module (guix gexp)
>    #:use-module (guix profiles)
>    #:use-module (guix utils)
> @@ -64,9 +65,13 @@ (define %hurd-default-operating-system-kernel
>    (if (system-hurd?)
>        gnumach
>        ;; A cross-built GNUmach does not work
> -      (with-parameters ((%current-system "i686-linux")
> -                        (%current-target-system #f))
> -        gnumach)))
> +      (let ((system (match (%current-system)
> +                      ((? target-x86-32?) "i686-linux")
> +                      ((? target-x86-64?) "x86_64-linux")
> +                      (_  "i686-linux"))))
> +        (with-parameters ((%current-system system)
> +                          (%current-target-system #f))
> +          gnumach))))

This is obviously wrong; the idea was to do something like

--8<---------------cut here---------------start------------->8---
      (let ((system (match (or (%current-target-system)
                               (%current-system))
                      ((? target-x86-32?) "i686-linux")
                      ((? target-x86-64?) "x86_64-linux")
                      (_  "i686-linux"))))
        (with-parameters ((%current-system system)
                          (%current-target-system #f))
          gnumach))))
--8<---------------cut here---------------end--------------->8---

...but as %hurd-default-operating-system-kernel is a variable that is
evaluated at toplevel/too early, this also doesn't work.  Ideas?

Janneke
diff mbox series

Patch

diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 9a351529e8..58e41959f4 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -18,6 +18,7 @@ 
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu system hurd)
+  #:use-module (ice-9 match)
   #:use-module (guix gexp)
   #:use-module (guix profiles)
   #:use-module (guix utils)
@@ -64,9 +65,13 @@  (define %hurd-default-operating-system-kernel
   (if (system-hurd?)
       gnumach
       ;; A cross-built GNUmach does not work
-      (with-parameters ((%current-system "i686-linux")
-                        (%current-target-system #f))
-        gnumach)))
+      (let ((system (match (%current-system)
+                      ((? target-x86-32?) "i686-linux")
+                      ((? target-x86-64?) "x86_64-linux")
+                      (_  "i686-linux"))))
+        (with-parameters ((%current-system system)
+                          (%current-target-system #f))
+          gnumach))))
 
 (define %base-packages/hurd
   ;; Note: the Shepherd comes before the Hurd, not just because its duty is to