unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd.
@ 2024-11-10 10:32 Janneke Nieuwenhuizen
  2024-11-10 10:37 ` [bug#74290] [PATCH 01/31] gnu: mig: Update to v1.8+git20231217 Janneke Nieuwenhuizen
                   ` (34 more replies)
  0 siblings, 35 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:32 UTC (permalink / raw)
  To: 74290; +Cc: Jan (janneke) Nieuwenhuizen

From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>

Hi,

Lo and behold, the 64bit Hurd boots!  Again, thanks to the help from the
kind folks over at libera #hurd and their excellent work.  Do something like:

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix system image --image-type=hurd64-qcow2 \
  gnu/system/examples/bare-hurd.tmpl
--8<---------------cut here---------------end--------------->8---

producing something like: /gnu/store/...-disk-image.

Run the image in QEMU:

--8<---------------cut here---------------start------------->8---
guix shell qemu@7 -- qemu-system-x86_64                 \
--machine q35                                           \
-m 4096                                                 \
--enable-kvm                                            \
--device rtl8139,netdev=net0                            \
--netdev user,id=net0,hostfwd=tcp:0.0.0.0:11022-:2222   \
--snapshot                                              \
--hda /gnu/store/...-disk-image
--8<---------------cut here---------------end--------------->8---

and login

--8<---------------cut here---------------start------------->8---
11:03:20 janneke@dundal:~/src/guix/hurd-team 
$ ssh -p 11022 root@localhost
Last login: Sun Nov 10 10:09:00 2024 from 10.0.2.2


  This is the GNU Hurd.  Welcome.

root@guixygnu ~# uname -a
GNU guixygnu 0.9 GNU-Mach 1.8/Hurd-0.9 x86_64 GNU
--8<---------------cut here---------------end--------------->8---

Most notably, besides the expected updates, this series adds an indirection
for gcc and gcc-toolchain, (current-gcc) and (current-gcc-toolchain)
respectively, as the 64bit Hurd needs gcc-14.  We may also want to think about
image names hurd64-qcow2 etc. and their defaults, vs hurd-qcow2/hurd32-qcow2.
We'll probably also want a 64bit childhurd service, etc, etc...

This series builds on/waits for #73927, which I intend to rebase and push
later this weekend if there are no further comments.  And I guess that the
pending blog post will also need an update :)

For your hacking convenience I have reset and updated the `hurd-team' branch.

Greetings,
Janneke

Janneke Nieuwenhuizen (31):
  gnu: mig: Update to v1.8+git20231217.
  gnu: gnumach: Update to v1.8+git20240714.
  gnu: hurd: Update to v0.9.git20240714.
  gnu: gcc: Add indirections current-gcc, current-gcc-toolchain.
  gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
  gnu: cross-libc: Support cross-building for the 64bit Hurd.
  gnu: bash-minimal: Fix build for 64bit Hurd.
  gnu: elfutils: Fix build for 64bit Hurd.
  gnu: grep: Fix build for the 64bit Hurd.
  gnu: patch: Fix build for the 64bit Hurd.
  gnu: libxcrypt: Support the 64bit Hurd.
  gnu: libstdc++: Support the 64bit Hurd.
  gnu: gcc-13, gcc-14: Support being used as parent for gcc-static.
  DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd.
  system: image: Add hurd64 image types.
  gnu: Add libgpg-error-1.50.
  gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd.
  gnu: perl: Support cross-building for the 64bit Hurd.
  gnu: openssl-3.0: Support the 64bit Hurd.
  gnu: pciutils: Support the 64bit Hurd.
  gnu: libpciaccess: Support the 64bit Hurd.
  gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df.
  gnu: netdde: Support the 64bit Hurd.
  gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337.
  gnu: rumpkernel: Support the 64bit Hurd.
  gnu: hurd: Build fixes for the 64bit Hurd.
  gnu: git-minimal: Support the 64bit Hurd.
  gnu: inetutils: Fix build for the 64bit Hurd.
  gnu: grub: Fix build for the 64bit Hurd.
  gnu: guile-fibers: Fix build for the 64bit Hurd.
  system: hurd: Use 64bit gnumach for the 64bit Hurd.

 doc/guix.texi                                 |   9 +-
 gnu/ci.scm                                    |   4 +-
 gnu/local.mk                                  |   9 +
 gnu/packages/admin.scm                        |  14 +-
 gnu/packages/avr.scm                          |   7 +-
 gnu/packages/base.scm                         |  74 ++++---
 gnu/packages/bash.scm                         |   9 +
 gnu/packages/benchmark.scm                    |   6 +-
 gnu/packages/bootloaders.scm                  |  10 +-
 gnu/packages/bootstrap.scm                    |  46 ++++-
 gnu/packages/c.scm                            |   4 +-
 gnu/packages/chicken.scm                      |   7 +-
 gnu/packages/commencement.scm                 |  35 ++--
 gnu/packages/containers.scm                   |   5 +-
 gnu/packages/cross-base.scm                   |  27 +--
 gnu/packages/crypto.scm                       |  15 ++
 gnu/packages/dlang.scm                        |   3 +-
 gnu/packages/elf.scm                          |   6 +-
 gnu/packages/engineering.scm                  |   4 +-
 gnu/packages/gawk.scm                         |   3 +-
 gnu/packages/gcc.scm                          |  69 ++++---
 gnu/packages/gnupg.scm                        |  19 +-
 gnu/packages/golang.scm                       |   3 +-
 gnu/packages/guile-xyz.scm                    |   2 +-
 gnu/packages/hurd.scm                         | 187 ++++++++++++------
 gnu/packages/julia-xyz.scm                    |   3 +-
 gnu/packages/lisp.scm                         |   3 +-
 gnu/packages/llvm.scm                         |   7 +-
 gnu/packages/make-bootstrap.scm               |  60 +++---
 gnu/packages/mpi.scm                          |   3 +-
 gnu/packages/parallel.scm                     |   5 +-
 gnu/packages/patches/gnumach-version.patch    |  23 +++
 gnu/packages/patches/grub-hurd64.patch        |  32 +++
 gnu/packages/patches/hurd-64bit.patch         |  56 ++++++
 gnu/packages/patches/inetutils-hurd64.patch   |  65 ++++++
 .../patches/libpciaccess-hurd64.patch         |  58 ++++++
 gnu/packages/patches/libxcrypt-hurd64.patch   |  38 ++++
 gnu/packages/patches/netdde-csum.patch        |  18 ++
 gnu/packages/patches/openssl-hurd64.patch     |  99 ++++++++++
 gnu/packages/patches/pciutils-hurd64.patch    |  31 +++
 gnu/packages/pciutils.scm                     |  25 ++-
 gnu/packages/perl.scm                         |  20 +-
 gnu/packages/rocm.scm                         |   3 +-
 gnu/packages/tls.scm                          |   9 +
 gnu/packages/version-control.scm              |   8 +-
 gnu/packages/xorg.scm                         |  23 ++-
 gnu/system.scm                                |   1 -
 gnu/system/hurd.scm                           |  11 +-
 gnu/system/images/hurd.scm                    |  47 ++++-
 guix/packages.scm                             |   8 +-
 guix/platforms/x86.scm                        |  11 +-
 guix/utils.scm                                |  15 +-
 m4/guix.m4                                    |  12 +-
 53 files changed, 1025 insertions(+), 246 deletions(-)
 create mode 100644 gnu/packages/patches/gnumach-version.patch
 create mode 100644 gnu/packages/patches/grub-hurd64.patch
 create mode 100644 gnu/packages/patches/hurd-64bit.patch
 create mode 100644 gnu/packages/patches/inetutils-hurd64.patch
 create mode 100644 gnu/packages/patches/libpciaccess-hurd64.patch
 create mode 100644 gnu/packages/patches/libxcrypt-hurd64.patch
 create mode 100644 gnu/packages/patches/netdde-csum.patch
 create mode 100644 gnu/packages/patches/openssl-hurd64.patch
 create mode 100644 gnu/packages/patches/pciutils-hurd64.patch


base-commit: 7105e7125882be35e334448eafd6d81b37b627f0
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 01/31] gnu: mig: Update to v1.8+git20231217.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-10 10:37 ` Janneke Nieuwenhuizen
  2024-11-10 10:37 ` [bug#74290] [PATCH 02/31] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
                   ` (33 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:37 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (mig): Update to v1.8+git20231217.

Change-Id: I0e531ecc7fdcfbefe2e0e24d7b2fb5e0fe8a3ae2
---
 gnu/packages/hurd.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 9c1681f236..0a7db31e1c 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -93,7 +93,7 @@ (define-public gnumach-headers
 (define-public mig
   (package
     (name "mig")
-    (version "1.8+git20230520")
+    (version "1.8+git20231217")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -102,7 +102,7 @@ (define-public mig
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "10r0fdjqjzqsy6ajb21rifvhw0wpjvrw6a1zdyliqlzqny5k0qlz"))))
+                "1mx7w5vzw5ws0zplm1y6s679jb1g2hjkiwl3dlk5lxys0dxs5g4g"))))
     (build-system gnu-build-system)
     ;; Flex is needed both at build and run time.
     (inputs (list gnumach-headers flex))
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 02/31] gnu: gnumach: Update to v1.8+git20240714.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
  2024-11-10 10:37 ` [bug#74290] [PATCH 01/31] gnu: mig: Update to v1.8+git20231217 Janneke Nieuwenhuizen
@ 2024-11-10 10:37 ` Janneke Nieuwenhuizen
  2024-11-10 11:45   ` janneke
  2024-11-10 10:37 ` [bug#74290] [PATCH 03/31] gnu: hurd: Update to v0.9.git20240714 Janneke Nieuwenhuizen
                   ` (32 subsequent siblings)
  34 siblings, 1 reply; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:37 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/gnumach-version.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hurd.scm (gnumach-headers): Update to v1.8+git20240714 and use
it.

Change-Id: I147c64021c2ee79dfc4cd4fd9a29529eef8890c5
---
 gnu/local.mk                               |  1 +
 gnu/packages/hurd.scm                      |  9 ++++-----
 gnu/packages/patches/gnumach-version.patch | 23 ++++++++++++++++++++++
 3 files changed, 28 insertions(+), 5 deletions(-)
 create mode 100644 gnu/packages/patches/gnumach-version.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 2c810117eb..4d3ee9ea35 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1459,6 +1459,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gnome-session-support-elogind.patch	\
   %D%/packages/patches/gnome-tweaks-search-paths.patch		\
   %D%/packages/patches/gnulib-bootstrap.patch			\
+  %D%/packages/patches/gnumach-version.patch			\
   %D%/packages/patches/gnupg-default-pinentry.patch		\
   %D%/packages/patches/gnupg-1-build-with-gcc10.patch		\
   %D%/packages/patches/gnutls-skip-trust-store-test.patch	\
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 0a7db31e1c..28f39cc448 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -57,21 +57,20 @@ (define (hurd-source-url version)
                  version ".tar.gz"))
 
 (define-public gnumach-headers
-  (let ((revision "0")
-        (commit "2556fdece900d67529d5eda01f1bdaae4ffe96b0"))
+  (let ((commit "v1.8+git20240714"))
     (package
       (name "gnumach-headers")
-      (version (git-version "1.8" revision commit))
+      (version (string-drop commit 1))
       (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://git.savannah.gnu.org/git/hurd/gnumach.git")
                (commit commit)))
+         (patches (search-patches "gnumach-version.patch"))
          (file-name (git-file-name "gnumach" version))
          (sha256
-          (base32
-           "1lzsbix0l4jhab38pvwnmk7ip1lsn7m5smhnrciqajsqnadsnlzs"))))
+          (base32 "0ykav1kx0bgxcxw04bpcsh5s4531fzdkahjgrlsfs2h3w3vfkga0"))))
       (build-system gnu-build-system)
       (arguments
        `(#:phases
diff --git a/gnu/packages/patches/gnumach-version.patch b/gnu/packages/patches/gnumach-version.patch
new file mode 100644
index 0000000000..aec3c86a16
--- /dev/null
+++ b/gnu/packages/patches/gnumach-version.patch
@@ -0,0 +1,23 @@
+Upstream-status: Taken from Debian upstream:
+    <https://salsa.debian.org/hurd-team/gnumach/-/raw/master/debian/patches/12_version_suffix.patch>
+
+Index: gnumach/configure.ac
+===================================================================
+--- gnumach.orig/configure.ac
++++ gnumach/configure.ac
+@@ -19,6 +19,7 @@ AC_PREREQ([2.57])
+ m4_include([version.m4])
+ AC_INIT([AC_PACKAGE_NAME], [AC_PACKAGE_VERSION], [AC_PACKAGE_BUGREPORT],
+   [AC_PACKAGE_TARNAME])
++AC_SUBST([PACKAGE_VERSION_SUFFIX])
+ AC_CONFIG_SRCDIR([kern/ipc_kobject.c])
+ 
+ if test -z "${CFLAGS+set}"; then
+Index: gnumach/version.c.in
+===================================================================
+--- gnumach.orig/version.c.in
++++ gnumach/version.c.in
+@@ -1,2 +1,2 @@
+ /* @configure_input@ */
+-const char version[] = "@PACKAGE_NAME@ @PACKAGE_VERSION@";
++const char version[] = "@PACKAGE_NAME@ @PACKAGE_VERSION@@PACKAGE_VERSION_SUFFIX@";
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 03/31] gnu: hurd: Update to v0.9.git20240714.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
  2024-11-10 10:37 ` [bug#74290] [PATCH 01/31] gnu: mig: Update to v1.8+git20231217 Janneke Nieuwenhuizen
  2024-11-10 10:37 ` [bug#74290] [PATCH 02/31] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
@ 2024-11-10 10:37 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 04/31] gnu: gcc: Add indirections current-gcc, current-gcc-toolchain Janneke Nieuwenhuizen
                   ` (31 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:37 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (hurd-headers): Update to v0.9.git20240714.
(hurd)[arguments]: Remove rumpdisk build hack from "prepare-addons" stage.
Instead, when cross-compiling, add stage "fixup-cross-configure" to enable
rumpdisk.
* gnu/system.scm (hurd-multiboot-modules): Remove
"--x-xattr-translator-records" option that has been removed and is now the
default.

Change-Id: I4609b5a959c1ece98e2fe1aedbb1d31d6edadcca
---
 gnu/packages/hurd.scm | 12 +++++++++---
 gnu/system.scm        |  1 -
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 28f39cc448..06fae1bd3b 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -132,7 +132,7 @@ (define-public mig
 
 (define-public hurd-headers
   (let ((revision "3")
-        (commit "v0.9.git20231217"))
+        (commit "v0.9.git20240714"))
     (package
       (name "hurd-headers")
       (version (string-drop commit 1))
@@ -143,7 +143,7 @@ (define-public hurd-headers
                       (commit commit)))
                 (sha256
                  (base32
-                  "1d138kzhil6s5gf9di8grpz1iziakyfv037wkc8s7qyd61imm31d"))
+                  "0wvzil3llmrjg7ymwqs86d11bm5fl771jwncv7kk679lsvqca0ll"))
                 (file-name (git-file-name name version))))
       (build-system gnu-build-system)
       (native-inputs
@@ -336,7 +336,7 @@ (define-public hurd
              ;; Makefile. libdde_linux26 is built later in its own phase.
              (substitute* "Makefile"
                (("libbpf ")
-                "libbpf libmachdevdde libddekit rumpdisk"))))
+                "libbpf libmachdevdde libddekit "))))
          (add-after 'unpack 'find-tirpc
            (lambda* (#:key inputs #:allow-other-keys)
              (for-each (lambda (var)
@@ -362,6 +362,12 @@ (define-public hurd
                (("#include <rpc/pmap_prot.h>" m)
                 (string-append "#include <rpc/types.h>\n#include <rpc/xdr.h>\n" m)))
              #t))
+         ,@(if (%current-target-system)
+               '((add-after 'configure 'fixup-cross-configure
+                   (lambda _
+                     (substitute* "config.make"
+                       (("HAVE_LIBRUMP = no") "HAVE_LIBRUMP = yes")))))
+               '())
          (add-before 'build 'pre-build
            (lambda _
              ;; Don't change the ownership of any file at this time.
diff --git a/gnu/system.scm b/gnu/system.scm
index 533a4154d6..6e1ebbcc9c 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1534,7 +1534,6 @@ (define (hurd-multiboot-modules os)
                 "--multiboot-command-line='${kernel-command-line}'"
                 "--exec-server-task='${exec-task}'"
                 "--store-type=typed"
-                "--x-xattr-translator-records"
                 "'${root}'"
                 "'$(fs-task=task-create)'"))
          (target (%current-target-system))
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 04/31] gnu: gcc: Add indirections current-gcc, current-gcc-toolchain.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (2 preceding siblings ...)
  2024-11-10 10:37 ` [bug#74290] [PATCH 03/31] gnu: hurd: Update to v0.9.git20240714 Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 05/31] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
                   ` (30 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290
  Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Guillaume Le Vaillant, Katherine Cox-Buday, Ludovic Courtès,
	Munyoki Kilyungi, Sharlatan Hellseher, Simon Tournier,
	Vagrant Cascadian, jgart

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))
 
 \f
 ;;;
@@ -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





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 05/31] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (3 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 04/31] gnu: gcc: Add indirections current-gcc, current-gcc-toolchain Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 06/31] gnu: cross-libc: Support cross-building for the " Janneke Nieuwenhuizen
                   ` (29 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290
  Cc: Andreas Enge, Christopher Baines, Efraim Flashner, Ekaitz Zarraga,
	Josselin Poiret, Ludovic Courtès, Mathieu Othacehe,
	Simon Tournier, Tobias Geerinckx-Rice

* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Update comment on where
to find shared linker name.
* guix/platforms/x86.scm (x86_64-gnu): New exported variable.
* guix/utils.scm (target-hurd64? system-hurd64?): New procedures.
* gnu/packages/gcc.scm: (current-gcc): Use target-hurd64? in new procedure to
select gcc-14 on 64bit Hurd.
(libstdc++): Change to procedure.
(libstdc++-headers): Update accordingly.
* gnu/packages/commencement.scm (current-gcc-toolchain): Likewise, to select
gcc-toolchain-14 on 64bit Hurd.
* gnu/packages/cross-base.scm (%xgcc): Use current-gcc.
(cross-kernel-headers*): Use target-hurd? instead of custom "i586..."
matching to also use xhurd-core-headers for target-hurd64.
* gnu/packages/make-bootstrap.scm (package-with-relocatable-glibc):
Capture (current-gcc) before resetting %current-target-system.
[native-inputs]:  Move final-inputs before cross-packages.
(%glibc-stripped): Likewise.
(%gcc-static): Change to procedure.
(%gcc-stripped): Likewise, update accordingly.
(%gcc-bootstrap-tarball): Likewise, update accordingly.
* gnu/ci.scm (%core-packages): Update accordingly.
* gnu/packages/patches/gcc-14-cross-without-bootstrap.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/cross-base.scm (cross-gcc)[origin]: Use it when
cross-building gcc >= 14.

Change-Id: I4ae189e7e5188ced91744b89fe9d753b6a1fca78
---
 gnu/ci.scm                      |  4 ++--
 gnu/packages/commencement.scm   |  6 +++--
 gnu/packages/cross-base.scm     |  6 ++---
 gnu/packages/gcc.scm            | 32 +++++++++++++-------------
 gnu/packages/make-bootstrap.scm | 40 +++++++++++++++++++++------------
 guix/platforms/x86.scm          | 11 ++++++++-
 guix/utils.scm                  | 15 ++++++++++++-
 7 files changed, 76 insertions(+), 38 deletions(-)

diff --git a/gnu/ci.scm b/gnu/ci.scm
index 4e282d197f..e7e839d968 100644
--- a/gnu/ci.scm
+++ b/gnu/ci.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012-2024 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2017, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2017, 2020, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2018, 2019 Clément Lassieur <clement@lassieur.org>
 ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2020, 2021 Mathieu Othacehe <othacehe@gnu.org>
@@ -146,7 +146,7 @@ (define %core-packages
         %bootstrap-binaries-tarball
         %binutils-bootstrap-tarball
         (%glibc-bootstrap-tarball)
-        %gcc-bootstrap-tarball
+        (%gcc-bootstrap-tarball)
         %guile-bootstrap-tarball
         %bootstrap-tarballs))
 
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 2b43759dac..682deb89cf 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3642,10 +3642,12 @@ (define-public gcc-toolchain-14
 ;; The default GCC
 (define (current-gcc-toolchain)
   "The current default gcc-toolchain version."
-  gcc-toolchain-11)
+  (if (target-hurd64?)
+      gcc-toolchain-14
+      gcc-toolchain-11))
 
 (define-public gcc-toolchain
-  (deprecated-package "gcc-toolchain" gcc-toolchain-11))
+  (deprecated-package "gcc-toolchain" (current-gcc-toolchain)))
 
 (define-public gcc-toolchain-aka-gcc
   ;; It's natural for users to try "guix install gcc".  This package
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 9c701efae8..7b32a6b64e 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -641,9 +641,9 @@ (define* (cross-kernel-headers* target
                 ("hurd-headers" ,xhurd-headers)
                 ("hurd-minimal" ,xhurd-minimal)))))
 
-  (match target
-    ((or "i586-pc-gnu" "i586-gnu") xhurd-core-headers)
-    (_ xlinux-headers)))
+  (if (target-hurd? target)
+      xhurd-core-headers
+      xlinux-headers))
 
 (define* (cross-libc . args)
   (if (or (= (length args) 1) (contains-keyword? args))
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 3b5d05b9a9..fc3746fb05 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -861,10 +861,12 @@ (define-public gcc-14
 ;;       the gcc-toolchain-* definitions.
 (define (current-gcc)
   "The current default gcc version."
-  gcc-11)
+  (if (target-hurd64?)
+      gcc-14
+      gcc-11))
 
 (define-public gcc
-  (deprecated-package "gcc" gcc-11))
+  (deprecated-package "gcc" (current-gcc)))
 
 \f
 ;;;
@@ -903,15 +905,15 @@ (define-public gcc-2.95
     (outputs '("out"))
     (arguments
      (let ((matching-system
-             (match (%current-system)
-               ;; This package predates our 64-bit architectures.
-               ;; Force a 32-bit build targeting a similar architecture.
-               ("aarch64-linux"
-                "armhf-linux")
-               ("x86_64-linux"
-                "i686-linux")
-               (_
-                (%current-system)))))
+            (match (%current-system)
+              ;; This package predates our 64-bit architectures.
+              ;; Force a 32-bit build targeting a similar architecture.
+              ("aarch64-linux"
+               "armhf-linux")
+              ("x86_64-linux"
+               "i686-linux")
+              (_
+               (%current-system)))))
        (list #:system matching-system
              #:configure-flags #~'("--disable-werror")
 
@@ -1050,8 +1052,8 @@ (define-public (make-libstdc++ gcc)
     (propagated-inputs '())
     (synopsis "GNU C++ standard library")))
 
-(define libstdc++
-  ;; Libstdc++ matching the default GCC.
+(define (current-libstdc++)
+  ;; Libstdc++ matching the CURRENT-GCC.
   (make-libstdc++ (current-gcc)))
 
 (define libstdc++-headers
@@ -1061,7 +1063,7 @@ (define libstdc++-headers
   ;; is right under include/c++ and not under
   ;; include/c++/x86_64-unknown-linux-gnu (aka. GPLUSPLUS_TOOL_INCLUDE_DIR).
   (package
-    (inherit libstdc++)
+    (inherit (current-libstdc++))
     (name "libstdc++-headers")
     (outputs '("out"))
     (build-system trivial-build-system)
@@ -1072,7 +1074,7 @@ (define libstdc++-headers
                    (mkdir (string-append out "/include"))
                    (symlink (string-append libstdc++ "/include")
                             (string-append out "/include/c++")))))
-    (inputs `(("libstdc++" ,libstdc++)))
+    (inputs `(("libstdc++" ,(current-libstdc++))))
     (synopsis "Headers of GNU libstdc++")))
 
 (define-public libstdc++-4.9
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index c6293b9a38..18281198ba 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -124,8 +124,11 @@ (define (package-with-relocatable-glibc p)
     (glibc-for-bootstrap
      ;; `cross-libc' already returns a cross libc, so clear
      ;; %CURRENT-TARGET-SYSTEM.
-     (parameterize ((%current-target-system #f))
-       (cross-libc target))))
+     (let ((xgcc (cross-gcc target #:xgcc (current-gcc))))
+       (parameterize ((%current-target-system #f))
+         (cross-libc target #:xgcc xgcc
+                     #:xheaders (cross-kernel-headers
+                                 target #:xgcc xgcc))))))
 
   ;; Standard inputs with the above libc and corresponding GCC.
 
@@ -145,7 +148,10 @@ (define (package-with-relocatable-glibc p)
                       target
                       #:xbinutils (cross-binutils target)
                       #:libc (cross-bootstrap-libc target))))
-          `(("cross-gcc" ,(package
+          `(,@(%final-inputs)
+            ;; As versions for gcc and cross-gcc can differ, make sure to have
+            ;; cross-gcc behind gcc in CPLUS_INCLUDE_PATH.
+            ("cross-gcc" ,(package
                             (inherit xgcc)
                             (search-paths
                              ;; Ensure the cross libc headers appears on the
@@ -154,8 +160,7 @@ (define (package-with-relocatable-glibc p)
                                     (variable "CROSS_CPLUS_INCLUDE_PATH")
                                     (files '("include")))
                                    (package-search-paths (current-gcc))))))
-            ("cross-binutils" ,(cross-binutils target))
-            ,@(%final-inputs)))
+            ("cross-binutils" ,(cross-binutils target))))
         `(("libc" ,(glibc-for-bootstrap glibc))
           ("libc:static" ,(glibc-for-bootstrap glibc) "static")
           ("gcc" ,(gcc-for-bootstrap glibc))
@@ -446,7 +451,8 @@ (define (%glibc-stripped)
   ;; GNU libc's essential shared libraries, dynamic linker, and headers,
   ;; with all references to store directories stripped.  As a result,
   ;; libc.so is unusable and need to be patched for proper relocation.
-  (let ((glibc (glibc-for-bootstrap glibc)))
+  (let ((glibc (glibc-for-bootstrap glibc))
+        (gcc (current-gcc)))
     (package (inherit glibc)
       (name "glibc-stripped")
       (build-system trivial-build-system)
@@ -463,8 +469,13 @@ (define (%glibc-stripped)
        `(("libc" ,(let ((target (%current-target-system)))
                     (if target
                         (glibc-for-bootstrap
-                         (parameterize ((%current-target-system #f))
-                           (cross-libc target)))
+                         (let* ((xgcc (cross-gcc target #:xgcc gcc))
+                                (xheaders (cross-kernel-headers target
+                                                                #:xgcc xgcc)))
+                           (parameterize ((%current-target-system #f))
+                             (cross-libc target
+                                         #:xgcc xgcc
+                                         #:xheaders xheaders))))
                         glibc)))))
       (inputs
        `(("kernel-headers"
@@ -478,11 +489,12 @@ (define (%glibc-stripped)
       ;; Only one output.
       (outputs '("out")))))
 
-(define %gcc-static
+(define (%gcc-static)
   ;; A statically-linked GCC, with stripped-down functionality.
   (package-with-relocatable-glibc
    (package (inherit (current-gcc))
      (name "gcc-static")
+     (source (package-source (current-gcc)))
      (outputs '("out"))                           ; all in one
      (arguments
       (substitute-keyword-arguments (package-arguments (current-gcc))
@@ -552,7 +564,7 @@ (define %gcc-static
             ,@(package-native-inputs (current-gcc)))
           (package-native-inputs (current-gcc)))))))
 
-(define %gcc-stripped
+(define (%gcc-stripped)
   ;; The subset of GCC files needed for bootstrap.
   (package
     (inherit (current-gcc))
@@ -575,7 +587,7 @@ (define %gcc-stripped
                       (libdir     (string-append out "/lib"))
                       (includedir (string-append out "/include"))
                       (libexecdir (string-append out "/libexec"))
-                      (gcc        #$%gcc-static))
+                      (gcc        #$(%gcc-static)))
                  (copy-recursively (string-append gcc "/bin") bindir)
                  (for-each remove-store-references
                            (find-files bindir ".*"))
@@ -813,9 +825,9 @@ (define (%glibc-bootstrap-tarball)
   ;; A tarball with GNU libc's shared libraries, dynamic linker, and headers.
   (tarball-package (%glibc-stripped)))
 
-(define %gcc-bootstrap-tarball
+(define (%gcc-bootstrap-tarball)
   ;; A tarball with a dynamic-linked GCC and its headers.
-  (tarball-package %gcc-stripped))
+  (tarball-package (%gcc-stripped)))
 
 (define %guile-bootstrap-tarball
   ;; A tarball with the statically-linked, relocatable Guile.
@@ -856,7 +868,7 @@ (define %bootstrap-tarballs
            ((or "i686-linux" "x86_64-linux")
             (list %linux-libre-headers-bootstrap-tarball))
            (_
-            (list %gcc-bootstrap-tarball
+            (list (%gcc-bootstrap-tarball)
                   %binutils-bootstrap-tarball
                   (%glibc-bootstrap-tarball)
                   %bootstrap-binaries-tarball)))))
diff --git a/guix/platforms/x86.scm b/guix/platforms/x86.scm
index 0c8fc7296c..5617e6dd68 100644
--- a/guix/platforms/x86.scm
+++ b/guix/platforms/x86.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
 ;;; Copyright © 2023, 2024 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,7 +26,8 @@ (define-module (guix platforms x86)
             x86_64-linux-x32
             i686-mingw
             x86_64-mingw
-            i586-gnu))
+            i586-gnu
+            x86_64-gnu))
 
 (define i686-linux
   (platform
@@ -71,3 +73,10 @@ (define i586-gnu
    (system "i586-gnu")
    (rust-target "i686-unknown-hurd-gnu")
    (glibc-dynamic-linker "/lib/ld.so.1")))
+
+(define x86_64-gnu
+  (platform
+   (target "x86_64-pc-gnu")
+   (system "x86_64-gnu")
+   (rust-target "x86_64-unknown-hurd-gnu")
+   (glibc-dynamic-linker "/lib/ld-x86-64.so.1")))
diff --git a/guix/utils.scm b/guix/utils.scm
index f161cb4ef3..e100c03365 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -17,7 +17,7 @@
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
 ;;; Copyright © 2023 Philip McGrath <philip@philipmcgrath.com>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com>
 ;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
@@ -94,6 +94,8 @@ (define-module (guix utils)
             target-linux?
             target-hurd?
             system-hurd?
+            target-hurd64?
+            system-hurd64?
             target-mingw?
             target-x86-32?
             target-x86-64?
@@ -716,6 +718,17 @@ (define* (system-hurd?)
   "Is the current system the GNU(/Hurd) system?"
   (and=> (%current-system) target-hurd?))
 
+(define* (target-hurd64? #:optional (target (or (%current-target-system)
+                                                (%current-system))))
+  "Does TARGET represent the 64bit GNU(/Hurd) system?"
+  (and (target-hurd?)
+       (target-64bit? target)))
+
+(define* (system-hurd64?)
+  "Is the current system the 64bit GNU(/Hurd) system?"
+  (and (system-hurd?)
+       (target-64bit? (%current-system))))
+
 (define* (target-mingw? #:optional (target (%current-target-system)))
   "Is the operating system of TARGET Windows?"
   (and target
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 06/31] gnu: cross-libc: Support cross-building for the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (4 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 05/31] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 07/31] gnu: bash-minimal: Fix build for " Janneke Nieuwenhuizen
                   ` (28 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/base.scm (glibc)[arguments]: When building for the Hurd, in
phase "create-machine-symlink", do not assume CPU is i386, also cater for
x86_64.
* gnu/packages/cross-base.scm (cross-libc*)[arguments]: Likewise.

Change-Id: Ib009b7bd301b543b8629382330cca9d963b7a812
---
 gnu/packages/base.scm       | 18 ++++++++++++------
 gnu/packages/cross-base.scm | 17 +++++++++++------
 2 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 4e8121ae2c..02ef71f20d 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1079,7 +1079,7 @@ (define-public glibc
                                (string-append locale "/C.UTF-8")))))
 
                  ,@(if (target-hurd?)
-                       '((add-after 'install 'augment-libc.so
+                       `((add-after 'install 'augment-libc.so
                            (lambda* (#:key outputs #:allow-other-keys)
                              (let ((out (assoc-ref outputs "out")))
                                (substitute* (string-append out "/lib/libc.so")
@@ -1088,11 +1088,17 @@ (define-public glibc
                                                  " libmachuser.so libhurduser.so"))))))
                          (add-after 'install 'create-machine-symlink
                            (lambda* (#:key outputs #:allow-other-keys)
-                             (let ((out (assoc-ref outputs "out"))
-                                   (cpu "i386"))
-                               (symlink cpu
-                                        (string-append out
-                                                       "/include/mach/machine"))))))
+                             (let* ((out (assoc-ref outputs "out"))
+                                    (cpu ,(match (or (%current-target-system)
+                                                     (%current-system))
+                                            ((? target-x86-32?)
+                                             "i386")
+                                            ((? target-x86-64?)
+                                             "x86_64")))
+                                    (machine (string-append
+                                              out "/include/mach/machine")))
+                               (unless (file-exists? machine)
+                                 (symlink cpu machine))))))
                        '()))))
 
    (inputs `(("static-bash" ,static-bash)))
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 7b32a6b64e..3827e87aec 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -738,7 +738,7 @@ (define* (cross-libc* target
                (delete 'install-utf8-c-locale)
 
                ,@(if (target-hurd? target)
-                     '((add-after 'install 'augment-libc.so
+                     `((add-after 'install 'augment-libc.so
                          (lambda* (#:key outputs #:allow-other-keys)
                            (let ((out (assoc-ref outputs "out")))
                              (substitute* (string-append out "/lib/libc.so")
@@ -747,11 +747,16 @@ (define* (cross-libc* target
                                                " libmachuser.so libhurduser.so"))))))
                        (add-after 'install 'create-machine-symlink
                          (lambda* (#:key outputs #:allow-other-keys)
-                           (let ((out (assoc-ref outputs "out"))
-                                 (cpu "i386"))
-                             (symlink cpu
-                                      (string-append out
-                                                     "/include/mach/machine"))))))
+                           (let* ((out (assoc-ref outputs "out"))
+                                  (cpu ,(match target
+                                          ((? target-x86-32?)
+                                           "i386")
+                                          ((? target-x86-64?)
+                                           "x86_64")))
+                                  (machine (string-append
+                                            out "/include/mach/machine")))
+                             (unless (file-exists? machine)
+                               (symlink cpu machine))))))
                      '())))))
 
       ;; Shadow the native "kernel-headers" because glibc's recipe expects the
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 07/31] gnu: bash-minimal: Fix build for 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (5 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 06/31] gnu: cross-libc: Support cross-building for the " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 08/31] gnu: elfutils: " Janneke Nieuwenhuizen
                   ` (27 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/bash-minimal.scm (bash)[arguments]: When building with gcc >=
14 use "CFLAGS=-Wno-implicit-function-declaration".

Change-Id: I3fd2da7a1d9011b155084dceadbad649dbb2a1b9
---
 gnu/packages/bash.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index 93641a78d5..1a3b014ad7 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
 ;;; Copyright © 2021 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2024 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -30,6 +31,7 @@ (define-module (gnu packages bash)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bootstrap)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages readline)
@@ -251,6 +253,13 @@ (define-public bash-minimal
                ;; modules and related code.
                "ac_cv_func_dlopen=no"
 
+               ,@(if (version>=? (package-version (current-gcc)) "14")
+                     ;; gcc-14 implictly uses -Wimplicit-function-declaration
+                     ;; which together with -Werror causes:
+                     ;; ./enable.def:492:11: error: implicit declaration of function ‘dlclose’;
+                     '("CFLAGS=-Wno-implicit-function-declaration")
+                     '())
+
                ,@(if (%current-target-system)
                      '("bash_cv_job_control_missing=no"
                        "bash_cv_getcwd_malloc=yes")
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 08/31] gnu: elfutils: Fix build for 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (6 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 07/31] gnu: bash-minimal: Fix build for " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 09/31] gnu: grep: Fix build for the " Janneke Nieuwenhuizen
                   ` (26 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/elf.scm (elfutils)[arguments]: When building for a 64bit Hurd,
set #:make-flags.

Change-Id: I00abf360a7de5b1f78c1e912f0dcf27c62c1af68
---
 gnu/packages/elf.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm
index 119f8d13dd..81a753a483 100644
--- a/gnu/packages/elf.scm
+++ b/gnu/packages/elf.scm
@@ -10,7 +10,7 @@
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2021 Leo Le Bouter <lle-bout@zaclys.net>
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -86,6 +86,10 @@ (define-public elfutils
                                "--disable-libdebuginfod"
                                "--disable-debuginfod")
 
+       ,@(if (target-hurd64?)
+             '(#:make-flags '("core-file_no_Werror=yes"))
+             '())
+
        ;; Disable tests on MIPS and PowerPC (without changing
        ;; the arguments list on other systems).
        ,@(if (any (cute string-prefix? <> (or (%current-target-system)
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 09/31] gnu: grep: Fix build for the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (7 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 08/31] gnu: elfutils: " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 10/31] gnu: patch: " Janneke Nieuwenhuizen
                   ` (25 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/base.scm (grep)[arguments]: When building for the 64bit Hurd,
add patch-sigsegv.h stage.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/packages/base.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 02ef71f20d..010be631d7 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -154,6 +154,13 @@ (define-public grep
                                        (string-append bin "/fgrep"))
                       (("^exec grep")
                        (string-append "exec " bin "/grep"))))))
+              #$@(if (target-hurd64?)
+                     #~((add-after 'unpack 'patch-sigsegv
+                          (lambda _
+                            ;; Stack overflow recovery does not compile
+                            (substitute* "lib/sigsegv.in.h"
+                              (("__GNU__") "__XGNU__")))))
+                     #~())
               #$@(if (system-hurd?)
                      #~((add-before 'check 'skip-test
                           (lambda _
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 10/31] gnu: patch: Fix build for the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (8 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 09/31] gnu: grep: Fix build for the " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 11/31] gnu: libxcrypt: Support " Janneke Nieuwenhuizen
                   ` (24 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/base.scm (patch)[arguments]: When building for the 64bit Hurd,
set #:configure-flags.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/packages/base.scm | 49 ++++++++++++++++++++++++-------------------
 1 file changed, 28 insertions(+), 21 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 010be631d7..83f8c0d9e9 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -339,27 +339,34 @@ (define-public patch
                   "1bk38169c0xh01b0q0zmnrjqz8k9byz3arp4q7q66sn6xwf94nvz"))
                 (patches (search-patches "patch-hurd-path-max.patch"))))
       (arguments
-       (substitute-keyword-arguments (package-arguments base)
-         ((#:phases phases '%standard-phases)
-          #~(modify-phases #$phases
-              (add-after 'unpack 'copy-gnulib-sources
-                (lambda _
-                  ;; XXX: We copy the source instead of using 'gnulib' as a
-                  ;; native input to avoid introducing a dependency cycle.
-                  (copy-recursively #+gnulib "gnulib")
-                  (setenv "GNULIB_SRCDIR"
-                          (string-append (getcwd) "/gnulib/src/gnulib"))))
-              (add-after 'copy-gnulib-sources 'update-bootstrap-script
-                (lambda _
-                  (copy-file "gnulib/src/gnulib/build-aux/bootstrap"
-                             "bootstrap")))
-              (add-after 'unpack 'patch-configure.ac
-                (lambda _
-                  (substitute* "configure.ac"
-                    ;; The gnulib-provided git-version-gen script has a plain
-                    ;; shebang of #!/bin/sh; avoid using it.
-                    (("build-aux/git-version-gen" all)
-                     (string-append "sh " all)))))))))
+       (let ((arguments
+         (substitute-keyword-arguments (package-arguments base)
+           ((#:phases phases '%standard-phases)
+            #~(modify-phases #$phases
+                (add-after 'unpack 'copy-gnulib-sources
+                  (lambda _
+                    ;; XXX: We copy the source instead of using 'gnulib' as a
+                    ;; native input to avoid introducing a dependency cycle.
+                    (copy-recursively #+gnulib "gnulib")
+                    (setenv "GNULIB_SRCDIR"
+                            (string-append (getcwd) "/gnulib/src/gnulib"))))
+                (add-after 'copy-gnulib-sources 'update-bootstrap-script
+                  (lambda _
+                    (copy-file "gnulib/src/gnulib/build-aux/bootstrap"
+                               "bootstrap")))
+                (add-after 'unpack 'patch-configure.ac
+                  (lambda _
+                    (substitute* "configure.ac"
+                      ;; The gnulib-provided git-version-gen script has a plain
+                      ;; shebang of #!/bin/sh; avoid using it.
+                      (("build-aux/git-version-gen" all)
+                       (string-append "sh " all))))))))))
+         (if (target-hurd64?)
+             (substitute-keyword-arguments arguments
+               ((#:configure-flags flags '())
+                #~(list "--disable-threads"
+                        "gl_cv_func_working_mktime=yes")))
+             arguments)))
       (native-inputs (list autoconf automake bison ed))
       (properties '()))))
 
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 11/31] gnu: libxcrypt: Support the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (9 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 10/31] gnu: patch: " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 12/31] gnu: libstdc++: " Janneke Nieuwenhuizen
                   ` (23 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/libxcrypt-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/crypto.scm (libxcrypt)[arguments]: When building for the 64bit
Hurd, use it in new phase `apply-patch'.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/local.mk                                |  1 +
 gnu/packages/crypto.scm                     | 15 ++++++++
 gnu/packages/patches/libxcrypt-hurd64.patch | 38 +++++++++++++++++++++
 3 files changed, 54 insertions(+)
 create mode 100644 gnu/packages/patches/libxcrypt-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 4d3ee9ea35..4b9fa95658 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1725,6 +1725,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libvpx-CVE-2016-2818.patch		\
   %D%/packages/patches/libvpx-CVE-2023-5217.patch		\
   %D%/packages/patches/libvpx-CVE-2023-44488.patch		\
+  %D%/packages/patches/libxcrypt-hurd64.patch			\
   %D%/packages/patches/libxml2-xpath0-Add-option-xpath0.patch	\
   %D%/packages/patches/libwpd-gcc-compat.patch			\
   %D%/packages/patches/libxslt-generated-ids.patch		\
diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index 2a298c4caf..94a98bb0ad 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -27,6 +27,7 @@
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;; Copyright © 2023 Ivan Vilata-i-Balaguer <ivan@selidor.net>
 ;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1661,6 +1662,20 @@ (define-public libxcrypt
     (build-system gnu-build-system)
     (native-inputs
      (list perl))
+    (arguments
+     (if (target-hurd64?)
+         (list
+          #:phases
+          #~(modify-phases %standard-phases
+              (add-after 'unpack 'apply-patch
+                (lambda _
+                  (let ((patch-file
+                         #$(local-file
+                            (search-patch
+                             "libxcrypt-hurd64.patch"))))
+                    (invoke "patch" "--force" "-p1" "-i"
+                            patch-file))))))
+              '()))
     (synopsis
      "Extended crypt library for descrypt, md5crypt, bcrypt, and others")
     (description
diff --git a/gnu/packages/patches/libxcrypt-hurd64.patch b/gnu/packages/patches/libxcrypt-hurd64.patch
new file mode 100644
index 0000000000..9fc3018539
--- /dev/null
+++ b/gnu/packages/patches/libxcrypt-hurd64.patch
@@ -0,0 +1,38 @@
+Upstream-status: Taken from upstream:
+    <https://github.com/besser82/libxcrypt/commit/b2c1da2e1ce2d3e72f511f5bc94a6ffa68b70917>
+
+From b2c1da2e1ce2d3e72f511f5bc94a6ffa68b70917 Mon Sep 17 00:00:00 2001
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date: Sun, 14 Jul 2024 13:13:07 +0200
+Subject: [PATCH] Add binary compatibility for x86_64 GNU/Hurd
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+
+diff --git a/lib/libcrypt.map.in b/lib/libcrypt.map.in
+index 88ea911..a56b7bf 100644
+--- a/lib/libcrypt.map.in
++++ b/lib/libcrypt.map.in
+@@ -43,5 +43,5 @@ fcrypt			-		GLIBC_2.0
+ %chain GLIBC_2.0 GLIBC_2.2 GLIBC_2.2.1 GLIBC_2.2.2 GLIBC_2.2.5 GLIBC_2.2.6
+ %chain GLIBC_2.3 GLIBC_2.4 GLIBC_2.12 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18
+ %chain GLIBC_2.21 GLIBC_2.27 GLIBC_2.29 GLIBC_2.32 GLIBC_2.33 GLIBC_2.35
+-%chain GLIBC_2.36
++%chain GLIBC_2.36 GLIBC_2.38
+ %chain OW_CRYPT_1.0 XCRYPT_2.0 XCRYPT_4.3 XCRYPT_4.4
+diff --git a/lib/libcrypt.minver b/lib/libcrypt.minver
+index 8478077..c5a5bf2 100644
+--- a/lib/libcrypt.minver
++++ b/lib/libcrypt.minver
+@@ -51,6 +51,7 @@
+ #VERSION     SYSTEM          CPU_FAMILY    PREPROCESSOR_CHECK
+ 
+ # GNU Hurd
++GLIBC_2.38   gnu             x86_64
+ GLIBC_2.2.6  gnu             i[3-9]86
+ ERROR        gnu             .
+ 
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 12/31] gnu: libstdc++: Support the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (10 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 11/31] gnu: libxcrypt: Support " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 13/31] gnu: gcc-13, gcc-14: Support being used as parent for gcc-static Janneke Nieuwenhuizen
                   ` (22 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/gcc.scm (make-libstdc++)[arguments]: When building for the
64bit Hurd, add stage patch-hurd64.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/packages/gcc.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index fc3746fb05..850a14cb1c 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -1033,7 +1033,15 @@ (define-public (make-libstdc++ gcc)
                   (("/lib64") "/lib")))))
           (add-before 'configure 'chdir
             (lambda _
-              (chdir "libstdc++-v3"))))
+              (chdir "libstdc++-v3")))
+          #$@(let ((version (package-version gcc)))
+               (if (target-hurd64?)
+                   #~((add-after 'unpack 'patch-hurd64
+                        (lambda _
+                          (substitute* "libstdc++-v3/src/c++20/tzdb.cc"
+                            (("#if ! defined _GLIBCXX_ZONEINFO_DIR")
+                             "#if __GNU__ || ! defined _GLIBCXX_ZONEINFO_DIR")))))
+                   '())))
 
       #:configure-flags '`("--disable-libstdcxx-pch"
                            ,(string-append "--with-gxx-include-dir="
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 13/31] gnu: gcc-13, gcc-14: Support being used as parent for gcc-static.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (11 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 12/31] gnu: libstdc++: " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 14/31] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (21 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/gcc.scm (gcc-13)[arguments]: Use quasiquote instead of
g-expressions.
(gcc-14)[arguments]: Likewise.

Change-Id: I22269b31d49868effe967d46247b189ed9a9d394
---
 gnu/packages/gcc.scm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 850a14cb1c..befbbda027 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -811,10 +811,10 @@ (define-public gcc-13
               (snippet gcc-canadian-cross-objdump-snippet)))
     (arguments
      (substitute-keyword-arguments (package-arguments gcc-11)
-       ((#:phases phases #~%standard-phases)
+       ((#:phases phases '%standard-phases)
        (if (target-hurd?)
-           #~(modify-phases #$phases
-               (delete 'patch-hurd-libpthread))
+           `(modify-phases ,phases
+              (delete 'patch-hurd-libpthread))
            phases))))
     (properties
      `((compiler-cpu-architectures
@@ -841,8 +841,8 @@ (define-public gcc-14
               (modules '((guix build utils)))
               (snippet gcc-canadian-cross-objdump-snippet)))
     (arguments (substitute-keyword-arguments (package-arguments gcc-13)
-                 ((#:phases phases #~%standard-phases)
-                  #~(modify-phases #$phases
+                 ((#:phases phases '%standard-phases)
+                  `(modify-phases ,phases
                       (add-before 'configure 'pre-x86-configure
                         (lambda _
                           (substitute* "gcc/config/i386/t-linux64"
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 14/31] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (12 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 13/31] gnu: gcc-13, gcc-14: Support being used as parent for gcc-static Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-11 18:05   ` janneke
  2024-11-10 10:38 ` [bug#74290] [PATCH 15/31] system: image: Add hurd64 image types Janneke Nieuwenhuizen
                   ` (20 subsequent siblings)
  34 siblings, 1 reply; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290
  Cc: Andreas Enge, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Maxim Cournoyer,
	Simon Tournier, Tobias Geerinckx-Rice

XXX TODO:

   v Boot a 64bit hurd and guix build hello,
   o Push the commit below,
   o Re-check the bootstrap-tarballs build/hash,
   o Update this commit message with new commit hash,
   o Push it with remainder of hurd-team branch,
   o Update blog post.

On commit:
    7a8acd375aa807b7d4386ed8052aa743261c42ce
    gnu: gcc-13, gcc-14: Support being used as parent for gcc-static.

Run:
    ./pre-inst-env guix build --target=x86_64-gnu bootstrap-tarballs

Producing:
    /gnu/store/sm23f2g91k554w2clcm9l9airwn9gqmz-bootstrap-tarballs-0

With guix hash -r:
    1v9ld86vw76drrxlqf0b930644mgj6mgxqak9ybx4h0xsiczxisw

* gnu/packages/bootstrap.scm (%bootstrap-executables): Add entries for
x86_64-gnu.
(%bootstrap-guile-hash, %bootstrap-coreutils&co, %bootstrap-binutils,
%bootstrap-glibc, %bootstrap-gcc): Add entry for x86_64-gnu.
* guix/packages.scm (%supported-systems, %hurd-systems): Add x86_64-gnu.
(%cuirass-supported-systems): Remove x86_64-gnu.
* guix/utils.scm (target-64bit?): Add x86_64-gnu.
* m4/guix.m4: Add x86_64-gnu as a supported system.
* doc/guix.texi (GNU Distribution): Add x86_64-gnu.

Change-Id: Ic0e09d5b3b035aec27c7274e57cccedee9c0611c
---
 doc/guix.texi              |  9 +++++++-
 gnu/packages/bootstrap.scm | 42 ++++++++++++++++++++++++++++++++++----
 guix/packages.scm          |  8 +++++---
 m4/guix.m4                 | 12 ++++++++---
 4 files changed, 60 insertions(+), 11 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 187bae6898..73692d73d6 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -36,7 +36,7 @@
 Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Efraim Flashner@*
 Copyright @copyright{} 2016 John Darrington@*
 Copyright @copyright{} 2016, 2017 Nikita Gillmann@*
-Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Jan Nieuwenhuizen@*
+Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Janneke Nieuwenhuizen@*
 Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021 Julien Lepiller@*
 Copyright @copyright{} 2016 Alex ter Weele@*
 Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021 Christopher Baines@*
@@ -637,6 +637,13 @@ GNU Distribution
 (@pxref{transparent-emulation-qemu, @code{hurd-vm-service-type}}).
 @xref{Contributing}, on how to help!
 
+@item x86_64-gnu
+@uref{https://hurd.gnu.org, GNU/Hurd} on the @code{x86_64} Intel/AMD
+64-bit architecture.
+
+This configuration is even more experimental and under heavy upstream
+development.
+
 @item mips64el-linux (unsupported)
 little-endian 64-bit MIPS processors, specifically the Loongson series,
 n32 ABI, and Linux-Libre kernel.  This configuration is no longer fully
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index c4640b62e1..eb6a4f1917 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -118,13 +118,22 @@ (define %bootstrap-executables
       ,(base32 "0i9kxdi17bm5gxfi2xzm0y73p3ii0cqxli1sbljm6rh2fjgyn90k")))
     ("i586-gnu"
      ("bash"
-      ,(base32 "1as8649aqaibahhhrvkj10ci8shpi4hq5n7gnik8rhhy0dc1jarg"))
+      ,(base32 "0nb8ga2j7a4kf6j7pnavq8zf68mj8mhqh26nwkilz1ykj86vg9ml"))
      ("mkdir"
-      ,(base32 "1snqgpfrl00hfn82lm29jqylzjsfb9jd6ha74dp12phwb8fpbmb9"))
+      ,(base32 "0ldsx9pwan40fx2hf4s9d10sfkhvkljvl20hksvm4192p7jb4shp"))
      ("tar"
-      ,(base32 "0nq2c1zb3wv5bf7kd83sziaashydazrn7xgq6kijlk0zj2syzc2m"))
+      ,(base32 "1z6kfvpwhy14vc52i61v1vzzk3gzxka3db5rlg1jsq6kli35s2ab"))
      ("xz"
-      ,(base32 "033rhpk6zrpxpd6ffjyg5y2zwq9x9cnq0zljb7k8jlncbalsayq5")))
+      ,(base32 "1f7g40sk5a6k6qf65k58vlybnnmhyyzczdxy60m3jgcsp674wfcr")))
+    ("x86_64-gnu"
+     ("bash"
+      ,(base32 "0l0dnighcipvdfbk14q834n57q859i2b9ssiq4bnbh0jpxvvqp1l"))
+     ("mkdir"
+      ,(base32 "1nd17k8pwwi7zsqi685w4rn1p2cvfcalrzdhfgwpsk1ilxnmdvsq"))
+     ("tar"
+      ,(base32 "0lf94y22ngmxdwhsp0cvj33m23p33r999xnlrff0s1yvlf20w3ks"))
+     ("xz"
+      ,(base32 "145aq65rx7w0qk1sw9239888id5ri60ha0xp1kyp6ir3pvizh6by")))
     ("mips64el-linux"
      ("bash"
       ,(base32 "1aw046dhda240k9pb9iaj5aqkm23gkvxa9j82n4k7fk87nbrixw6"))
@@ -165,6 +174,7 @@ (define (bootstrap-executable-file-name system program)
   (match system
     ("powerpc64le-linux" (string-append system "/20210106/" program))
     ("i586-gnu" (string-append system "/20200326/" program))
+    ("x86_64-gnu" (string-append system "/20241110/" program))
     ("powerpc-linux" (string-append system "/20200923/bin/" program))
     ("riscv64-linux" (string-append system "/20210725/bin/" program))
     (_ (string-append system "/" program
@@ -366,6 +376,8 @@ (define (bootstrap-guile-url-path system)
                     "/20150101/guile-2.0.11.tar.xz")
                    ("i586-gnu"
                     "/20200326/guile-static-stripped-2.0.14-i586-pc-gnu.tar.xz")
+                   ("x86_64-gnu"
+                    "/20241110/guile-static-stripped-3.0.9-x86_64-pc-gnu.tar.xz")
                    ("powerpc64le-linux"
                     "/20210106/guile-static-stripped-2.0.14-powerpc64le-linux-gnu.tar.xz")
                    ("riscv64-linux"
@@ -390,6 +402,8 @@ (define (bootstrap-guile-hash system)
      (base32 "1giy2aprjmn5fp9c4s9r125fljw4wv6ixy5739i5bffw4jgr0f9r"))
     ("i586-gnu"
      (base32 "0wgqpsmvg25rnqn49ap7kwd2qxccd8dr4lllzp7i3rjvgav27vac"))
+    ("x86_64-gnu"
+     (base32 "0fgasmbidp584ibr5fbirmp3wr8qchv84a50i4bichysp00gg26p"))
     ("powerpc-linux"
      (base32 "1by2p7s27fbyjzfkcw8h65h4kkqh7d23kv4sgg5jppjn2qx7swq4"))
     ("riscv64-linux"
@@ -598,6 +612,8 @@ (define %bootstrap-coreutils&co
                                              "/20210106/static-binaries-0-powerpc64le-linux-gnu.tar.xz")
                                             ("i586-gnu"
                                              "/20200326/static-binaries-0-i586-pc-gnu.tar.xz")
+                                            ("x86_64-gnu"
+                                             "/20241110/static-binaries-0-x86_64-pc-gnu.tar.xz")
                                             ("powerpc-linux"
                                              "/20200923/static-binaries.tar.xz")
                                             ("riscv64-linux"
@@ -625,6 +641,9 @@ (define %bootstrap-coreutils&co
                               ("i586-gnu"
                                (base32
                                 "17kllqnf3fg79gzy9ansgi801c46yh9c23h4d923plvb0nfm1cfn"))
+                              ("x86_64-gnu"
+                               (base32
+                                "118s161df8hgrdfph2w5spnrms02rh1dk7mzfvx1k1prvgngpm9p"))
                               ("powerpc-linux"
                                (base32
                                 "0kspxy0yczan2vlih6aa9hailr2inz000fqa0gn5x9d1fxxa5y8m"))
@@ -681,6 +700,8 @@ (define %bootstrap-binutils
                                              "/20210106/binutils-static-stripped-2.34-powerpc64le-linux-gnu.tar.xz")
                                             ("i586-gnu"
                                              "/20200326/binutils-static-stripped-2.34-i586-pc-gnu.tar.xz")
+                                            ("x86_64-gnu"
+                                             "/20241110/binutils-static-stripped-2.41-x86_64-pc-gnu.tar.xz")
                                             ("powerpc-linux"
                                              "/20200923/binutils-2.35.1.tar.xz")
                                             ("riscv64-linux"
@@ -711,6 +732,9 @@ (define %bootstrap-binutils
                               ("i586-gnu"
                                (base32
                                 "11kykv1kmqc5wln57rs4klaqa13hm952smkc57qcsyss21kfjprs"))
+                              ("x86_64-gnu"
+                               (base32
+                                "07r74sa7341frhf5a7h1p3pklsrmfpfrf5s8dxm3yz2kqzhish48"))
                               ("powerpc-linux"
                                (base32
                                 "0asbg1c4avkrvh057mx0942xwddd136jni382zqsxzn79ls42yq8"))
@@ -771,6 +795,8 @@ (define %bootstrap-glibc
                                        "/20210106/glibc-stripped-2.31-powerpc64le-linux-gnu.tar.xz")
                                       ("i586-gnu"
                                        "/20240816/glibc-stripped-2.39-i586-pc-gnu.tar.xz")
+                                      ("x86_64-gnu"
+                                       "/20241110/glibc-stripped-2.39-x86_64-pc-gnu.tar.xz")
                                       ("powerpc-linux"
                                        "/20200923/glibc-2.32.tar.xz")
                                       ("riscv64-linux"
@@ -801,6 +827,9 @@ (define %bootstrap-glibc
                         ("i586-gnu"
                          (base32
                           "0x2x6w611k6v9qdabacawamw2475p04hm3s0q95xcg063wjq4ig2"))
+                        ("x86_64-gnu"
+                         (base32
+                          "1dcgrnlxbsdic0xmmrjbr8gl6ra5y2xbj8f8jr6y0zvpdyi12ldd"))
                         ("powerpc-linux"
                          (base32
                           "0smmssyjrlk5cvx49586smmk81gkwff0i6r91n4rir4jm6ba25sb"))
@@ -877,6 +906,8 @@ (define %bootstrap-gcc
                                         "/20210106/gcc-stripped-5.5.0-powerpc64le-linux-gnu.tar.xz")
                                        ("i586-gnu"
                                         "/20200326/gcc-stripped-5.5.0-i586-pc-gnu.tar.xz")
+                                       ("x86_64-gnu"
+                                        "/20241110/gcc-stripped-14.2.0-x86_64-pc-gnu.tar.xz")
                                        ("powerpc-linux"
                                         "/20200923/gcc-5.5.0.tar.xz")
                                        ("riscv64-linux"
@@ -907,6 +938,9 @@ (define %bootstrap-gcc
                          ("i586-gnu"
                           (base32
                            "1j2zc58wzil71a34h7c70sd68dmqvcscrw3rmn2whq79vd70zvv5"))
+                         ("x86_64-gnu"
+                          (base32
+                           "0vqvjvw6xi16lihiqz4mhisfwx3dgs15y60q07ksdkgvi1wdli2w"))
                          ("powerpc-linux"
                           (base32
                            "1p7df3yixhm87dw5sccc6yn1i9db1r9hnmsg87wq5xi4rfmirq7w"))
diff --git a/guix/packages.scm b/guix/packages.scm
index f373136d22..403217d711 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -419,7 +420,7 @@ (define %32bit-supported-systems
 (define %64bit-supported-systems
   ;; This is the list of 64-bit system types that are supported.
   '("x86_64-linux" "mips64el-linux" "aarch64-linux" "powerpc64le-linux"
-    "riscv64-linux"))
+    "riscv64-linux" "x86_64-gnu"))
 
 (define %supported-systems
   ;; This is the list of system types that are supported.  By default, we
@@ -428,14 +429,15 @@ (define %supported-systems
 
 (define %hurd-systems
   ;; The GNU/Hurd systems for which support is being developed.
-  '("i586-gnu"))
+  '("i586-gnu" "x86_64-gnu"))
 
 (define %cuirass-supported-systems
   ;; This is the list of system types for which build machines are available.
   ;;
   ;; XXX: MIPS is unavailable in CI:
   ;; <https://lists.gnu.org/archive/html/guix-devel/2017-03/msg00790.html>.
-  (fold delete %supported-systems '("mips64el-linux" "powerpc-linux" "riscv64-linux")))
+  (fold delete %supported-systems '("mips64el-linux" "powerpc-linux"
+                                    "riscv64-linux" "x86_64-gnu")))
 
 (define (maybe-add-input-labels inputs)
   "Add labels to INPUTS unless it already has them."
diff --git a/m4/guix.m4 b/m4/guix.m4
index b93daba5c3..8c2757a8b7 100644
--- a/m4/guix.m4
+++ b/m4/guix.m4
@@ -3,6 +3,7 @@ dnl Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020, 2021 Ludovic Co
 dnl Copyright © 2014 Mark H Weaver <mhw@netris.org>
 dnl Copyright © 2017, 2020, 2021, 2023 Efraim Flashner <efraim@flashner.co.il>
 dnl Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
+dnl Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 dnl
 dnl This file is part of GNU Guix.
 dnl
@@ -61,8 +62,13 @@ AC_DEFUN([GUIX_SYSTEM_TYPE], [
        linux-musl*)
 	  guix_system="$machine_name-linux";;
        gnu*)
-          # Always use i586 for GNU/Hurd.
-          guix_system="i586-gnu";;
+          case "$machine_name" in
+            i386|i486|i586|i686)
+              # Always use i586 for 32bit GNU/Hurd.
+              guix_system="i586-gnu";;
+            *)
+	      guix_system="$machine_name-gnu";;
+          esac;;
        *)
 	  # Strip the version number from names such as `gnu0.3',
 	  # `darwin10.2.0', etc.
@@ -91,7 +97,7 @@ courageous and port the GNU System distribution to it (see
   # Currently only Linux-based systems are supported, and only on some
   # platforms.
   case "$guix_system" in
-    x86_64-linux|i686-linux|armhf-linux|aarch64-linux|powerpc64le-linux|riscv64-linux|i586-gnu)
+    x86_64-linux|i686-linux|armhf-linux|aarch64-linux|powerpc64le-linux|riscv64-linux|i586-gnu|x86_64-gnu)
       ;;
     mips64el-linux|powerpc-linux)
       AC_MSG_WARN([building Guix on `$guix_system', which is not supported])
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 15/31] system: image: Add hurd64 image types.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (13 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 14/31] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 16/31] gnu: Add libgpg-error-1.50 Janneke Nieuwenhuizen
                   ` (19 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/system/images/hurd.scm (hurd64-disk-image, hurd64-image-type,
hurd64-qcow2-image-type, hurd64-barebones-disk-image,
hurd64-barebones-qcow2-image): New variables.

Change-Id: I68834a4c5c18b0e154d06082824008d13ca52214
---
 gnu/system/images/hurd.scm | 47 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 45 insertions(+), 2 deletions(-)

diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm
index 01c422a54f..75f255ed94 100644
--- a/gnu/system/images/hurd.scm
+++ b/gnu/system/images/hurd.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,7 +36,13 @@ (define-module (gnu system images hurd)
             hurd-image-type
             hurd-qcow2-image-type
             hurd-barebones-disk-image
-            hurd-barebones-qcow2-image))
+            hurd-barebones-qcow2-image
+
+            hurd64-disk-image
+            hurd6-image-type
+            hurd64-qcow2-image-type
+            hurd64-barebones-disk-image
+            hurd64-barebones-qcow2-image))
 
 (define hurd-barebones-os
   (operating-system
@@ -115,5 +121,42 @@ (define hurd-barebones-qcow2-image
                         #:type hurd-qcow2-image-type))
    (name 'hurd-barebones.qcow2)))
 
+\f
+;;;
+;;; 64bit Hurd
+;;;
+(define hurd64-disk-image
+  (image
+   (inherit hurd-disk-image)
+   (platform x86_64-gnu)))
+
+(define hurd64-image-type
+  (image-type
+   (name 'hurd64-raw)
+   (constructor (cut image-with-os hurd64-disk-image <>))))
+
+(define hurd64-qcow2-image-type
+  (image-type
+   (name 'hurd64-qcow2)
+   (constructor (lambda (os)
+                  (image
+                   (inherit hurd64-disk-image)
+                   (format 'compressed-qcow2)
+                   (operating-system os))))))
+
+(define hurd64-barebones-disk-image
+  (image
+   (inherit
+    (os+platform->image hurd-barebones-os x86_64-gnu
+                        #:type hurd64-image-type))
+   (name 'hurd64-barebones-disk-image)))
+
+(define hurd64-barebones-qcow2-image
+  (image
+   (inherit
+    (os+platform->image hurd-barebones-os x86_64-gnu
+                        #:type hurd64-qcow2-image-type))
+   (name 'hurd64-barebones.qcow2)))
+
 ;; Return the default image.
 hurd-barebones-qcow2-image
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 16/31] gnu: Add libgpg-error-1.50.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (14 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 15/31] system: image: Add hurd64 image types Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 17/31] gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd Janneke Nieuwenhuizen
                   ` (18 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/gnupg.scm (libgpg-error-1.50): New variable.

Change-Id: Ia34c0f339f331420d76b2c840205f29e511d1dcc
---
 gnu/packages/gnupg.scm | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index 2e97c2244a..a4863542f2 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -22,7 +22,7 @@
 ;;; Copyright © 2021 Nikita Domnitskii <nikita@domnitskii.me>
 ;;; Copyright © 2021 Aleksandr Vityazev <avityazev@posteo.org>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -164,6 +164,19 @@ (define-public libgpg-error
     (properties '((ftp-server . "ftp.gnupg.org")
                   (ftp-directory . "/gcrypt/libgpg-error")))))
 
+(define-public libgpg-error-1.50
+  (package
+    (inherit libgpg-error)
+    (version "1.50")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "mirror://gnupg/libgpg-error/libgpg-error-"
+                          version ".tar.bz2"))
+      (sha256
+       (base32
+        "02p2jgz95688ib28sl4aa624cj0liz73anwcl92f8cx6w14m6h39"))))))
+
 (define-public libgcrypt
   (package
     (name "libgcrypt")
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 17/31] gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (15 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 16/31] gnu: Add libgpg-error-1.50 Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 18/31] gnu: perl: Support cross-building " Janneke Nieuwenhuizen
                   ` (17 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/gnupg.scm (libgcrypt)[propagated-inputs]: When building for the
64bit Hurd, use libgcrypt-1.50.

Change-Id: I608d283a4a307527d5b09a81fa1a53cec5d6bb76
---
 gnu/packages/gnupg.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index a4863542f2..6c6efff026 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -190,7 +190,9 @@ (define-public libgcrypt
                "1pp9zyx02bzgzjzldxf0mx9kp3530xgaaqcz4n2cv100ddaaw57g"))))
     (build-system gnu-build-system)
     (propagated-inputs
-     `(("libgpg-error-host" ,libgpg-error)))
+     `(("libgpg-error-host" ,(if (target-hurd64?)
+                                 libgpg-error-1.50
+                                 libgpg-error))))
     (native-inputs
      ;; Needed here for the 'gpg-error' program.
      `(("libgpg-error-native" ,libgpg-error)))
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 18/31] gnu: perl: Support cross-building for the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (16 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 17/31] gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 19/31] gnu: openssl-3.0: Support " Janneke Nieuwenhuizen
                   ` (16 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/cross-base.scm (perl)[native-inputs]: When cross-building for
the 64bit Hurd, use perl-cross-1.6.

Change-Id: I4a77f51a6757ad4aed9bcca8f9bbbf2cbd162e15
---
 gnu/packages/perl.scm | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index faaac13bf1..2ea7c49419 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -248,14 +248,18 @@ (define-public perl
     (native-inputs
      (if (%current-target-system)
          `(("perl-cross"
-            ,(origin
-               (method git-fetch)
-               (uri (git-reference
-                     (url "https://github.com/arsv/perl-cross")
-                     (commit "1.4")))
-               (file-name (git-file-name "perl-cross" "1.4"))
-               (sha256
-                (base32 "1ydjvlhrk06ccyj4bm8by7xk90krsll2k380mc3x1mhfrc7r9gzy")))))
+            ,(let ((version (if (target-hurd64?) "1.6" "1.4"))
+                   (hash
+                    (if (target-hurd64?)
+                        "0s06lkx5b79r9cn6pm5p6d4jbdjq7wg7rjr75nw5xdhw1z3wnl2d"
+                        "1ydjvlhrk06ccyj4bm8by7xk90krsll2k380mc3x1mhfrc7r9gzy")))
+               (origin
+                 (method git-fetch)
+                 (uri (git-reference
+                       (url "https://github.com/arsv/perl-cross")
+                       (commit version)))
+                 (file-name (git-file-name "perl-cross" version))
+                 (sha256 (base32 hash))))))
          '()))
     (native-search-paths (list (search-path-specification
                                 (variable "PERL5LIB")
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 19/31] gnu: openssl-3.0: Support the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (17 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 18/31] gnu: perl: Support cross-building " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 20/31] gnu: pciutils: " Janneke Nieuwenhuizen
                   ` (15 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/openssl-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/tls.scm (openssl-3.0)[arguments]: When building for
the 64bit Hurd, use it in new "apply-hurd-patch" phase.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/local.mk                              |  1 +
 gnu/packages/patches/openssl-hurd64.patch | 99 +++++++++++++++++++++++
 gnu/packages/tls.scm                      |  9 +++
 3 files changed, 109 insertions(+)
 create mode 100644 gnu/packages/patches/openssl-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 4b9fa95658..576f60579e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1891,6 +1891,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/opensles-add-license-file.patch			\
   %D%/packages/patches/openssl-1.1-c-rehash-in.patch		\
   %D%/packages/patches/openssl-3.0-c-rehash-in.patch		\
+  %D%/packages/patches/openssl-hurd64.patch			\
   %D%/packages/patches/opentaxsolver-file-browser-fix.patch     \
   %D%/packages/patches/open-zwave-hidapi.patch			\
   %D%/packages/patches/orangeduck-mpc-fix-pkg-config.patch	\
diff --git a/gnu/packages/patches/openssl-hurd64.patch b/gnu/packages/patches/openssl-hurd64.patch
new file mode 100644
index 0000000000..372fda834a
--- /dev/null
+++ b/gnu/packages/patches/openssl-hurd64.patch
@@ -0,0 +1,99 @@
+Upstream-status: Taken from upstream:
+
+<https://github.com/openssl/openssl/commit/7c729851d169f30d9e0c0ad6e7c1cf6cefb37935>.
+
+From 795699363be8f717e36802c3ac503011b74ad752 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Thu, 7 Nov 2024 14:08:05 +0100
+Subject: [PATCH] Add support for the 64bit Hurd.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+Taken from <https://salsa.debian.org/debian/openssl>.
+---
+ Configurations/10-main.conf | 45 ++++++++++++++++++++++++++++++++-----
+ util/perl/OpenSSL/config.pm |  3 ++-
+ 2 files changed, 41 insertions(+), 7 deletions(-)
+
+diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
+index b578a3c2a8..740460ebd3 100644
+--- a/Configurations/10-main.conf
++++ b/Configurations/10-main.conf
+@@ -1685,20 +1685,53 @@ my %targets = (
+     },
+ 
+ ##### GNU Hurd
+-    "hurd-x86" => {
++    "hurd-generic32" => {
+         inherit_from     => [ "BASE_unix" ],
+         CC               => "gcc",
+-        CFLAGS           => "-O3 -fomit-frame-pointer -Wall",
++        CXX              => "g++",
++        CFLAGS           => picker(default => "-Wall",
++                                   debug   => "-O0 -g",
++                                   release => "-O3"),
++        CXXFLAGS         => picker(default => "-Wall",
++                                   debug   => "-O0 -g",
++                                   release => "-O3"),
+         cflags           => threads("-pthread"),
+-        lib_cppflags     => "-DL_ENDIAN",
++        cxxflags         => combine("-std=c++11", threads("-pthread")),
+         ex_libs          => add("-ldl", threads("-pthread")),
+-        bn_ops           => "BN_LLONG",
+-        asm_arch         => 'x86',
+-        perlasm_scheme   => 'elf',
++        bn_ops           => "BN_LLONG RC4_CHAR",
+         thread_scheme    => "pthreads",
+         dso_scheme       => "dlfcn",
+         shared_target    => "linux-shared",
+         shared_cflag     => "-fPIC",
++        shared_ldflag    => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
++    },
++
++    "hurd-generic64" => {
++        inherit_from     => [ "hurd-generic32" ],
++        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
++    },
++
++    #### X86 / X86_64 targets
++    "hurd-x86" => {
++        inherit_from     => [ "hurd-generic32" ],
++        CFLAGS           => add(picker(release => "-fomit-frame-pointer")),
++        cflags           => add("-m32"),
++        cxxflags         => add("-m32"),
++        lib_cppflags     => add("-DL_ENDIAN"),
++        bn_ops           => "BN_LLONG",
++        asm_arch         => 'x86',
++        perlasm_scheme   => 'elf',
++    },
++
++    "hurd-x86_64" => {
++        inherit_from     => [ "hurd-generic64" ],
++        cflags           => add("-m64"),
++        cxxflags         => add("-m64"),
++        lib_cppflags     => add("-DL_ENDIAN"),
++        bn_ops           => "SIXTY_FOUR_BIT_LONG",
++        asm_arch         => 'x86_64',
++        perlasm_scheme   => 'elf',
++        multilib         => "64",
+     },
+ 
+ ##### VxWorks for various targets
+diff --git a/util/perl/OpenSSL/config.pm b/util/perl/OpenSSL/config.pm
+index 2f1edcafb6..707db71537 100755
+--- a/util/perl/OpenSSL/config.pm
++++ b/util/perl/OpenSSL/config.pm
+@@ -92,7 +92,8 @@ my $guess_patterns = [
+     [ 'IRIX64:.*',                  'mips4-sgi-irix64' ],
+     [ 'Linux:[2-9]\..*',            '${MACHINE}-whatever-linux2' ],
+     [ 'Linux:1\..*',                '${MACHINE}-whatever-linux1' ],
+-    [ 'GNU.*',                      'hurd-x86' ],
++    [ 'GNU:.*86-AT386',             'hurd-x86' ],
++    [ 'GNU:.*86_64-AT386',          'hurd-x86_64' ],
+     [ 'LynxOS:.*',                  '${MACHINE}-lynx-lynxos' ],
+     # BSD/OS always says 386
+     [ 'BSD\/OS:4\..*',              'i486-whatever-bsdi4' ],
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 1a1ce0d215..261a063090 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -589,6 +589,15 @@ (define-public openssl-3.0
                                            "/bin/perl"))))
             #$@(if (target-hurd?)
                    #~((delete 'patch-configure))
+                   #~())
+            #$@(if (target-hurd64?)
+                   #~((add-after 'unpack 'apply-hurd-patch
+                        (lambda _
+                          (let ((patch-file
+                                 #$(local-file
+                                    (search-patch "openssl-hurd64.patch"))))
+                            (invoke "patch" "--force" "-p1" "-i"
+                                    patch-file)))))
                    #~())))
        ((#:configure-flags flags #~'())
         (if (system-hurd?)
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 20/31] gnu: pciutils: Support the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (18 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 19/31] gnu: openssl-3.0: Support " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 21/31] gnu: libpciaccess: " Janneke Nieuwenhuizen
                   ` (14 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/pciutils-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/pciutils.scm (pciutils)[arguments]: Use g-expressions.  When
building for the 64bit Hurd, use it in new "apply-hurd64-patch" phase.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/local.mk                               |  1 +
 gnu/packages/patches/pciutils-hurd64.patch | 31 ++++++++++++++++++++++
 gnu/packages/pciutils.scm                  | 25 +++++++++++------
 3 files changed, 49 insertions(+), 8 deletions(-)
 create mode 100644 gnu/packages/patches/pciutils-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 576f60579e..ad18f62eb6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1906,6 +1906,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/pam-krb5-CVE-2020-10595.patch		\
   %D%/packages/patches/pango-skip-libthai-test.patch		\
   %D%/packages/patches/password-store-tree-compat.patch		\
+  %D%/packages/patches/pciutils-hurd64.patch			\
   %D%/packages/patches/pdfpc-build-with-vala-0.56.patch         \
   %D%/packages/patches/petri-foo-0.1.87-fix-recent-file-not-exist.patch			\
   %D%/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch \
diff --git a/gnu/packages/patches/pciutils-hurd64.patch b/gnu/packages/patches/pciutils-hurd64.patch
new file mode 100644
index 0000000000..316f12e131
--- /dev/null
+++ b/gnu/packages/patches/pciutils-hurd64.patch
@@ -0,0 +1,31 @@
+Upstream-status: Not presented upstream.
+
+--- pciutils-3.8.0/lib/hurd.c.orig	2024-11-07 15:09:20.728973822 +0100
++++ pciutils-3.8.0/lib/hurd.c	2024-11-07 15:05:08.524682813 +0100
+@@ -213,7 +213,7 @@
+ hurd_read(struct pci_dev *d, int pos, byte * buf, int len)
+ {
+   int err;
+-  size_t nread;
++  mach_msg_type_number_t nread;
+   char *data;
+   mach_port_t device_port = device_port_lookup(d);
+ 
+@@ -266,7 +266,7 @@
+   mach_port_t device_port = device_port_lookup(d);
+   struct pci_bar regions[6];
+   char *buf = (char *) &regions;
+-  size_t size = sizeof(regions);
++  mach_msg_type_number_t size = sizeof(regions);
+ 
+   int err = pci_get_dev_regions(device_port, &buf, &size);
+   if (err)
+@@ -305,7 +305,7 @@
+   struct pci_xrom_bar rom;
+   mach_port_t device_port = device_port_lookup(d);
+   char *buf = (char *) &rom;
+-  size_t size = sizeof(rom);
++  mach_msg_type_number_t size = sizeof(rom);
+ 
+   int err = pci_get_dev_rom(device_port, &buf, &size);
+   if (err)
diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index d2a352eb6b..08f1634113 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2022 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
 ;;;
@@ -81,25 +81,34 @@ (define-public pciutils
                 "01aglgw9ds9qiswcbi2lx90lswncikrlyv8mmp4haix8542bvvci"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
          (add-after 'unpack 'unbundle-pci.ids
            (lambda* (#:key native-inputs inputs #:allow-other-keys)
              (copy-file (search-input-file (or native-inputs inputs)
                                            "share/hwdata/pci.ids")
                         "pci.ids")))
+         #$@(if (target-hurd64?)
+               #~((add-after 'unpack 'apply-hurd64-patch
+                    (lambda _
+                      (let ((patch-file
+                             #$(local-file
+                                (search-patch "pciutils-hurd64.patch"))))
+                        (invoke "patch" "--force" "-p1" "-i" patch-file)))))
+               #~())
          (replace 'configure
            (lambda* (#:key outputs #:allow-other-keys)
              ;; There's no 'configure' script, just a raw makefile.
              (substitute* "Makefile"
-               ,@(if (%current-target-system)
-                     `((("^CROSS_COMPILE=.*$")
+               #$@(if (%current-target-system)
+                     #~((("^CROSS_COMPILE=.*$")
                         (string-append "CROSS_COMPILE="
-                                       ,(%current-target-system) "-"
+                                       #$(%current-target-system) "-"
                                        "\n"))
                        (("^HOST=.*$")
                         (string-append "HOST="
-                                       ,(gnu-triplet->nix-system
+                                       #$(gnu-triplet->nix-system
                                          (%current-target-system)) "\n"))
                        ;; Disable 'install' strip option, that would fail when
                        ;; we are cross-compiling.
@@ -139,7 +148,7 @@ (define-public pciutils
              (invoke "make" "install" "install-lib"))))
 
        ;; Make sure programs have an RPATH so they can find libpciutils.so.
-       #:make-flags (list ,(string-append "CC="
+       #:make-flags #~(list #$(string-append "CC="
                                           (if (%current-target-system)
                                               (cc-for-target)
                                               "gcc"))
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 21/31] gnu: libpciaccess: Support the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (19 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 20/31] gnu: pciutils: " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 22/31] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df Janneke Nieuwenhuizen
                   ` (13 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/libpciaccess-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/xorg.scm (libpciaccess) [arguments]: Use g-expressions.  When
building for the 64bit Hurd, use it in new "apply-hurd64-patch" phase.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/local.mk                                  |  1 +
 .../patches/libpciaccess-hurd64.patch         | 58 +++++++++++++++++++
 gnu/packages/xorg.scm                         | 23 +++++---
 3 files changed, 75 insertions(+), 7 deletions(-)
 create mode 100644 gnu/packages/patches/libpciaccess-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ad18f62eb6..1e81c16979 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1701,6 +1701,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libmpeg2-global-symbol-test.patch	\
   %D%/packages/patches/libmygpo-qt-fix-qt-5.11.patch		\
   %D%/packages/patches/libmygpo-qt-missing-qt5-modules.patch	\
+  %D%/packages/patches/libpciaccess-hurd64.patch		\
   %D%/packages/patches/libphonenumber-reproducible-build.patch	\
   %D%/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch	\
   %D%/packages/patches/libquicktime-ffmpeg.patch 		\
diff --git a/gnu/packages/patches/libpciaccess-hurd64.patch b/gnu/packages/patches/libpciaccess-hurd64.patch
new file mode 100644
index 0000000000..f7e11059b1
--- /dev/null
+++ b/gnu/packages/patches/libpciaccess-hurd64.patch
@@ -0,0 +1,58 @@
+Upstream-status: Taken from upstream:
+
+<https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/commit/6cd5a4afbb70868c7746de8d50dea59e02e9acf2>.
+
+From 6cd5a4afbb70868c7746de8d50dea59e02e9acf2 Mon Sep 17 00:00:00 2001
+From: Flavio Cruz <flaviocruz@gmail.com>
+Date: Wed, 28 Jun 2023 01:02:34 -0400
+Subject: [PATCH] Fix compilation warnings when building against hurd-amd64.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+Passes mach_msg_type_number_t instead of size_t which have different
+sizes. Example warning:
+
+/hurd_pci.c:101:53: warning: passing argument 3 of 'pci_get_dev_regions' from incompatible pointer type [-Wincompatible-pointer-types]
+  101 |     err = pci_get_dev_regions(d->device_port, &buf, &size);
+      |                                                     ^~~~~
+      |                                                     |
+      |                                                     size_t * {aka long unsigned int *}
+---
+ src/hurd_pci.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/hurd_pci.c b/src/hurd_pci.c
+index 8653e1b..9ac3813 100644
+--- a/src/hurd_pci.c
++++ b/src/hurd_pci.c
+@@ -82,7 +82,7 @@ pci_device_hurd_probe(struct pci_device *dev)
+     struct pci_bar regions[6];
+     struct pci_xrom_bar rom;
+     struct pci_device_private *d;
+-    size_t size;
++    mach_msg_type_number_t size;
+     char *buf;
+ 
+     /* Many of the fields were filled in during initial device enumeration.
+@@ -323,7 +323,7 @@ pciclient_cfg_read(mach_port_t device_port, int reg, char *buf,
+                    size_t * nbytes)
+ {
+     int err;
+-    size_t nread;
++    mach_msg_type_number_t nread;
+     char *data;
+ 
+     data = buf;
+@@ -473,7 +473,7 @@ simple_readdir(mach_port_t port, uint32_t *first_entry)
+ {
+     char *data;
+     int nentries = 0;
+-    vm_size_t size;
++    mach_msg_type_number_t size;
+ 
+     dir_readdir (port, &data, &size, *first_entry, 1, 0, &nentries);
+ 
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 0de08a4ad1..b106a604a7 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -36,7 +36,7 @@
 ;;; Copyright © 2021 Lu Hui <luhux76@gmail.com>
 ;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
 ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2023, 2024 John Kehayias <john.kehayias@protonmail.com>
 ;;; Copyright © 2023, 2024 Kaelyn Takata <kaelyn.alexi@protonmail.com>
 ;;;
@@ -1157,16 +1157,17 @@ (define-public libpciaccess
             "12glp4w1kgvmqn89lk19cgr6jccd3awxra4dxisp7pagi06rsk11"))))
     (build-system gnu-build-system)
     (arguments
-     '(;; Make sure libpciaccess can read compressed 'pci.ids' files as
-       ;; provided by pciutils.
-       #:configure-flags
-       (list "--with-zlib"
+     (list
+      ;; Make sure libpciaccess can read compressed 'pci.ids' files as
+      ;; provided by pciutils.
+      #:configure-flags
+      #~(list "--with-zlib"
              (string-append "--with-pciids-path="
                             (assoc-ref %build-inputs "pciutils")
                             "/share/hwdata"))
 
        #:phases
-       (modify-phases %standard-phases
+       #~(modify-phases %standard-phases
          (add-after 'install 'add-L-zlib
            (lambda* (#:key inputs outputs #:allow-other-keys)
              ;; Provide '-LZLIB/lib' next to '-lz' in the .la file.
@@ -1175,7 +1176,15 @@ (define-public libpciaccess
                (substitute* (string-append out "/lib/libpciaccess.la")
                  (("-lz")
                   (string-append "-L" zlib "/lib -lz")))
-               #t))))))
+               #t)))
+         #$@(if (target-hurd64?)
+                #~((add-after 'unpack 'apply-hurd64-patch
+                     (lambda _
+                       (let ((patch-file
+                              #$(local-file
+                                 (search-patch "libpciaccess-hurd64.patch"))))
+                         (invoke "patch" "--force" "-p1" "-i" patch-file)))))
+                #~()))))
     (inputs
      (list zlib pciutils))                   ;for 'pci.ids.gz'
     (native-inputs
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 22/31] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (20 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 21/31] gnu: libpciaccess: " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 23/31] gnu: netdde: Support the 64bit Hurd Janneke Nieuwenhuizen
                   ` (12 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (netdde): Update to
c0ef248dc7c5ccc1273e2a796f3ece30c5b645df.
(dde-sources): Update to b6c8526c703f3ba76294d9002f195c63897ec661.

Change-Id: Id03f5c5124f16e9ffd6a77cbb2507d274e0f325a
---
 gnu/packages/hurd.scm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 06fae1bd3b..f9d8b28b8c 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -294,7 +294,7 @@ (define unifont
 
 (define dde-sources
   ;; This is the current tip of the dde branch
-  (let ((commit "066797b576ebf8364ad157f50bef2a655597deeb"))
+  (let ((commit "b6c8526c703f3ba76294d9002f195c63897ec661"))
     (origin
       (method git-fetch)
       (uri (git-reference
@@ -302,7 +302,7 @@ (define dde-sources
             (commit commit)))
       (sha256
        (base32
-        "19f2awlfnar5gyhi0w5zawla5brzck2s88iv0f20022pd1l5v9hl"))
+        "0k1ilj8ghli8x43xaksbc4y419pqh0w16k374914c07svq419bbr"))
       (file-name (git-file-name "dde" (string-take commit 7))))))
 
 (define %import-from-dde
@@ -561,8 +561,8 @@ (define-public hurd
     (license gpl2+)))
 
 (define-public netdde
-  (let ((commit "e67c284ac113d939b10b4578334f27dab29d5b08")
-        (revision "2"))
+  (let ((commit "c0ef248dc7c5ccc1273e2a796f3ece30c5b645df")
+        (revision "3"))
     (package
       (name "netdde")
       ;; The version prefix corresponds to the version of Linux from which the
@@ -576,7 +576,7 @@ (define-public netdde
                 (patches (list (search-patch "netdde-build-fix.patch")))
                 (sha256
                  (base32
-                  "0vnkls7sr7srzib5mnw6gybzl5qa8c5a4zf3h08w6gdr7zqbndh0"))
+                  "070fpmd4nvn3mp8dj9w4if63iwz7j2m0h6ywq888znw70wlrc6sh"))
                 (file-name (git-file-name name commit))))
       (build-system gnu-build-system)
       (arguments
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 23/31] gnu: netdde: Support the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (21 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 22/31] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 24/31] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337 Janneke Nieuwenhuizen
                   ` (11 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/netdde-csum.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hurd.scm (netdde)[source]: Use it.
[arguments]: Do not assume x86, rather use actual ARCH in #:make-flags,
disable -Wstrict-prototypes and -Wint-conversion, and follow upstream's
"amd64" symlinking voodoo.

Change-Id: Ie825e56779dae2f489066569dc3c4405bac778c1
---
 gnu/local.mk                           |  1 +
 gnu/packages/hurd.scm                  | 22 ++++++++++++++++++++--
 gnu/packages/patches/netdde-csum.patch | 18 ++++++++++++++++++
 3 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/netdde-csum.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 1e81c16979..9a4715df86 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1816,6 +1816,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ncftp-reproducible.patch			\
   %D%/packages/patches/netcdf-date-time.patch			\
   %D%/packages/patches/netdde-build-fix.patch			\
+  %D%/packages/patches/netdde-csum.patch			\
   %D%/packages/patches/netpbm-CVE-2017-2586.patch		\
   %D%/packages/patches/netpbm-CVE-2017-2587.patch		\
   %D%/packages/patches/netsurf-message-timestamp.patch		\
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index f9d8b28b8c..973564ee33 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -573,7 +573,8 @@ (define-public netdde
                 (uri (git-reference
                       (url "https://git.savannah.gnu.org/git/hurd/incubator.git")
                       (commit commit)))
-                (patches (list (search-patch "netdde-build-fix.patch")))
+                (patches (search-patches "netdde-build-fix.patch"
+                                         "netdde-csum.patch"))
                 (sha256
                  (base32
                   "070fpmd4nvn3mp8dj9w4if63iwz7j2m0h6ywq888znw70wlrc6sh"))
@@ -586,7 +587,13 @@ (define-public netdde
                               (search-input-file %build-inputs "/bin/bash"))
                "PKGDIR=libdde_linux26"
                (string-append "CC=" ,(cc-for-target))
-               "ARCH=x86")
+               (let ((arch ,(match (or (%current-target-system)
+                                       (%current-system))
+                              ((? target-x86-32?)
+                               "x86")
+                              ((? target-x86-64?)
+                               "amd64"))))
+                 (string-append "ARCH=" arch)))
          #:configure-flags
          ,#~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
          #:phases
@@ -604,8 +611,19 @@ (define-public netdde
                  (("/bin/bash") (which "bash")))))
            (add-after 'patch-generated-file-shebangs 'build-libdde-linux26
              (lambda* (#:key make-flags #:allow-other-keys)
+               (when ,(target-hurd64?)
+                 (let ((dir "libdde_linux26/build/include"))
+                   (mkdir-p (string-append dir "/x86"))
+                   (format #t "symlink ~a -> ~a\n"
+                           (string-append dir "/x86/amd64") "x86")
+                   (symlink "x86" (string-append dir "/amd64"))
+                   (format #t "symlink ~a -> ~a\n"
+                           (string-append dir "/amd64/asm-x86_64") "asm-x86")
+                   (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64"))))
                (with-directory-excursion "libdde_linux26"
                  (apply invoke "make"
+                        (string-append "WARNINGS=-Wno-strict-prototypes"
+                                       " -Wno-int-conversion")
                         (delete "PKGDIR=libdde_linux26" make-flags)))))
            (add-after 'build-libdde-linux26 'convert
              (lambda* (#:key make-flags #:allow-other-keys)
diff --git a/gnu/packages/patches/netdde-csum.patch b/gnu/packages/patches/netdde-csum.patch
new file mode 100644
index 0000000000..4fdd004898
--- /dev/null
+++ b/gnu/packages/patches/netdde-csum.patch
@@ -0,0 +1,18 @@
+Upstream-status: Taken from debian.
+
+<https://salsa.debian.org/hurd-team/netdde/raw/master/debian/patches/csum>.
+
+---
+ linux/drivers/net/vmxnet3/vmxnet3_drv.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/linux/drivers/net/vmxnet3/vmxnet3_drv.c
++++ b/linux/drivers/net/vmxnet3/vmxnet3_drv.c
+@@ -25,6 +25,7 @@
+  */
+ 
+ #include "vmxnet3_int.h"
++#include <net/ip6_checksum.h>
+ 
+ char vmxnet3_driver_name[] = "vmxnet3";
+ #define VMXNET3_DRIVER_DESC "VMware vmxnet3 virtual NIC driver"
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 24/31] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (22 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 23/31] gnu: netdde: Support the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 25/31] gnu: rumpkernel: Support the 64bit Hurd Janneke Nieuwenhuizen
                   ` (10 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (rumpkernel): Update to
f1ffd6405f225336e595a0f99f01095ed7438337.
[arguments]: In stage "build", add "-Wno-error=sign-compare" to CWARNFLAGS.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/packages/hurd.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 973564ee33..b156fcea4c 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -665,8 +665,8 @@ (define-public netdde
       (license gpl2))))
 
 (define-public rumpkernel
-  (let ((commit "81043d42fabda9baed7ac9ca36e3f3f5ed11ba81")
-        (revision "3"))
+  (let ((commit "f1ffd6405f225336e595a0f99f01095ed7438337")
+        (revision "0"))
     (package
       (name "rumpkernel")
       (version (git-version "0-20211031" revision commit))
@@ -680,7 +680,7 @@ (define-public rumpkernel
                       (commit commit)))
                 (sha256
                  (base32
-                  "0fv0k52qqcg3nq9012hibgsamvsd7mnvn2ikdasmzjhsp8qh5q3r"))
+                  "1ygn3ysji06ik3k44sf906fjpdmabznkspw70llldbk2zkrcdw7i"))
                 (file-name (git-file-name name version))))
       (build-system gnu-build-system)
       (arguments
@@ -800,7 +800,8 @@ (define-public rumpkernel
                            " -Wno-error=stack-protector"
                            " -Wno-error=array-parameter"
                            " -Wno-error=array-bounds"
-                           " -Wno-error=stringop-overflow")
+                           " -Wno-error=stringop-overflow"
+                           " -Wno-error=sign-compare")
                      "-V" "LIBCRTBEGIN="
                      "-V" "LIBCRTEND="
                      "-V" "LIBCRT0="
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 25/31] gnu: rumpkernel: Support the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (23 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 24/31] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337 Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 26/31] gnu: hurd: Build fixes for " Janneke Nieuwenhuizen
                   ` (9 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (rumpkernel)[argument]: In stage "build", follow
Debian upstream to use -DPAE disable the DTRACE and ZFS builds.

Change-Id: I534da31eefb378c72b4896d64a51a73109e38aa6
---
 gnu/packages/hurd.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index b156fcea4c..d29ec22cd7 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -781,6 +781,9 @@ (define-public rumpkernel
                      "-V" "MKBINUTILS=no"
                      "-V" "MKGDB=no"
                      "-V" "MKGROFF=no"
+                     "-V" "MKDTRACE=no"
+                     "-V" "MKZFS=no"
+
                      "-V" (string-append "TOPRUMP=" toprump)
                      "-V" "BUILDRUMP_CPPFLAGS=-Wno-error=stringop-overread"
                      "-V" "RUMPUSER_EXTERNAL_DPLIBS=pthread"
@@ -791,7 +794,8 @@ (define-public rumpkernel
                            " -DRUMP_REGISTER_T=int"
                            " -DRUMPUSER_CONFIG=yes"
                            " -DNO_PCI_MSI_MSIX=yes"
-                           " -DNUSB_DMA=1")
+                           " -DNUSB_DMA=1"
+                           " -DPAE")
                      "-V" (string-append
                            "CWARNFLAGS="
                            " -Wno-error=maybe-uninitialized"
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 26/31] gnu: hurd: Build fixes for the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (24 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 25/31] gnu: rumpkernel: Support the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 27/31] gnu: git-minimal: Support " Janneke Nieuwenhuizen
                   ` (8 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/hurd-64bit.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hurd.scm (hurd)[source]: Use it.
[arguments]: When building for the 64bit Hurd, add "create-machine-symlink"
phase.  In phases "build-libdde-linux" and "install-goodies", do not assume
x86, rather use actual ARCH, disable -Wstrict-prototypes and -Wint-conversion,
and follow upstream's "amd64" symlinking voodoo.

Change-Id: If264a91b2433add13f9121c482f0abe67ae5f1e9
---
 gnu/local.mk                          |   1 +
 gnu/packages/hurd.scm                 | 115 +++++++++++++++++---------
 gnu/packages/patches/hurd-64bit.patch |  56 +++++++++++++
 3 files changed, 131 insertions(+), 41 deletions(-)
 create mode 100644 gnu/packages/patches/hurd-64bit.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 9a4715df86..cf0de3d92e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1545,6 +1545,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/htslib-for-stringtie.patch		\
   %D%/packages/patches/hubbub-sort-entities.patch		\
   %D%/packages/patches/hueplusplus-mbedtls.patch		\
+  %D%/packages/patches/hurd-64bit.patch				\
   %D%/packages/patches/hurd-rumpdisk-no-hd.patch		\
   %D%/packages/patches/hurd-startup.patch			\
   %D%/packages/patches/hwloc-1-test-btrfs.patch			\
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index d29ec22cd7..7aed0ebe1d 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -317,7 +317,8 @@ (define-public hurd
     (source (origin
               (inherit (package-source hurd-headers))
               (patches (search-patches "hurd-rumpdisk-no-hd.patch"
-                                       "hurd-startup.patch"))))
+                                       "hurd-startup.patch"
+                                       "hurd-64bit.patch"))))
     (version (package-version hurd-headers))
     (arguments
      `(#:tests? #f                      ;no "check" target
@@ -467,48 +468,80 @@ (define-public hurd
                          (find-files (string-append out "/libexec")))
                #t)))
          (add-after 'build 'build-libdde-linux
-           (lambda* (#:key inputs native-inputs #:allow-other-keys)
-             (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
-                                    "/bin/make")
-                     ;; XXX There can be a race condition because subdirs
-                     ;; aren't interdependent targets in the Makefile.
-                     "-j1" "-C" "libdde_linux26"
-                     (string-append "SHELL="
-                                    (assoc-ref (or native-inputs inputs) "bash")
-                                    "/bin/bash")
-                     (string-append "CC="
-                                    ,(cc-for-target))
-                     "ARCH=x86")))
+          (lambda* (#:key inputs native-inputs #:allow-other-keys)
+            (let ((arch ,(match (or (%current-target-system)
+                                    (%current-system))
+                           ((? target-x86-32?)
+                            "x86")
+                           ((? target-x86-64?)
+                            "amd64"))))
+              (when ,(target-hurd64?)
+                (let ((dir "libdde_linux26/build/include"))
+                  (mkdir-p (string-append dir "/x86"))
+                  (format #t "symlink ~a -> ~a\n"
+                          (string-append dir "/x86/amd64") "x86")
+                  (symlink "x86" (string-append dir "/amd64"))
+                  (format #t "symlink ~a -> ~a\n"
+                          (string-append dir "/amd64/asm-x86_64") "asm-x86")
+                  (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64"))))
+              (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
+                                     "/bin/make")
+                      ;; XXX There can be a race condition because subdirs
+                      ;; aren't interdependent targets in the Makefile.
+                      "-j1" "-C" "libdde_linux26"
+                      (string-append "SHELL="
+                                     (assoc-ref (or native-inputs inputs) "bash")
+                                     "/bin/bash")
+                      (string-append "CC="
+                                     ,(cc-for-target))
+                      (string-append "WARNINGS=-Wno-int-conversion"
+                                     " -Wno-strict-prototypes")
+                      (string-append "ARCH=" arch)))))
          (add-after 'install 'install-goodies
-           (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
-             ;; Install additional goodies.
-             ;; TODO: Build & install *.msgids for rpctrace.
-             (let* ((out (assoc-ref outputs "out"))
-                    (datadir (string-append out "/share/hurd")))
-               ;; Install libdde_linux26.
-               (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
-                                      "/bin/make")
-                       "-C" "libdde_linux26" "install"
-                       (string-append "SHELL="
-                                      (assoc-ref (or native-inputs inputs) "bash")
-                                      "/bin/bash")
-                       (string-append "INSTALLDIR="
-                                      out
-                                      "/share/libdde_linux26/build/include")
-                       "ARCH=x86")
-               ;; Install the fancy UTF-8 motd.
-               (mkdir-p (string-append out "/etc"))
-               (copy-file "console/motd.UTF8"
-                          (string-append out "/etc/motd"))
+          (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
+            ;; Install additional goodies.
+            ;; TODO: Build & install *.msgids for rpctrace.
+            (let* ((out (assoc-ref outputs "out"))
+                   (datadir (string-append out "/share/hurd"))
+                   (arch ,(match (or (%current-target-system)
+                                     (%current-system))
+                            ((? target-x86-32?)
+                             "x86")
+                            ((? target-x86-64?)
+                             "amd64")))
+                   (dir (string-append out "/share/libdde_linux26/build/include")))
+              (mkdir-p dir)
+              (when ,(target-hurd64?)
+                (mkdir-p (string-append dir "/amd64"))
+                (format #t "symlink ~a -> ~a\n"
+                        (string-append dir "/amd64/asm-x86_64")
+                        "x86")
+                (symlink "x86" (string-append dir "/amd46")))
+              (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
+                                     "/bin/make")
+                      "-C" "libdde_linux26" "install"
+                      (string-append "SHELL="
+                                     (assoc-ref (or native-inputs inputs) "bash")
+                                     "/bin/bash")
+                      (string-append "INSTALLDIR=" dir)
+                      (string-append "ARCH=" arch))
+              (when ,(target-hurd64?)
+                (format #t "symlink ~a -> ~a\n"
+                        (string-append dir "/amd64/asm-x86_64")
+                        "asm-x86")
+                (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64")))
+              ;; Install the fancy UTF-8 motd.
+              (mkdir-p (string-append out "/etc"))
+              (copy-file "console/motd.UTF8"
+                         (string-append out "/etc/motd"))
 
-               ;; Install the BDF font for use by the console client.
-               (copy-file (assoc-ref inputs "unifont")
-                          "unifont.gz")
-               (invoke "gunzip" "unifont.gz")
-               (mkdir-p datadir)
-               (copy-file "unifont"
-                          (string-append datadir "/vga-system.bdf"))
-               #t))))
+              ;; Install the BDF font for use by the console client.
+              (copy-file (assoc-ref inputs "unifont")
+                         "unifont.gz")
+              (invoke "gunzip" "unifont.gz")
+              (mkdir-p datadir)
+              (copy-file "unifont"
+                         (string-append datadir "/vga-system.bdf"))))))
        #:configure-flags
        ,#~(list (string-append "LDFLAGS=-Wl,-rpath="
                                #$output "/lib")
diff --git a/gnu/packages/patches/hurd-64bit.patch b/gnu/packages/patches/hurd-64bit.patch
new file mode 100644
index 0000000000..643550ad68
--- /dev/null
+++ b/gnu/packages/patches/hurd-64bit.patch
@@ -0,0 +1,56 @@
+Upstream-status: Taken from upstream:
+    <https://git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=d494333e7607ea03819adcfb69d89f8248ec2044>.
+
+From d494333e7607ea03819adcfb69d89f8248ec2044 Mon Sep 17 00:00:00 2001
+From: Flavio Cruz <flaviocruz@gmail.com>
+Date: Sun, 21 Jul 2024 17:20:55 -0400
+Subject: [PATCH] nfsd: fix -Werror=incompatible-pointer-types issues for
+ x86_64
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+Message-ID: <3pmgbk2myx4phdb6wcso54solmybulrvbytols5md3nri2p2qp@xjmfmpvwjp6t>
+---
+ nfsd/cache.c | 2 +-
+ nfsd/ops.c   | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/nfsd/cache.c b/nfsd/cache.c
+index cd5524af..864739c0 100644
+--- a/nfsd/cache.c
++++ b/nfsd/cache.c
+@@ -387,7 +387,7 @@ create_cached_handle (int fs, struct cache_handle *credc, file_t userport)
+   struct cache_handle *c;
+   int hash;
+   char *bp = fhandle.array + sizeof (int);
+-  size_t handlelen = NFS2_FHSIZE - sizeof (int);
++  mach_msg_type_number_t handlelen = NFS2_FHSIZE - sizeof (int);
+   mach_port_t newport, ref;
+ 
+   /* Authenticate USERPORT so that we can call file_getfh on it.  */
+diff --git a/nfsd/ops.c b/nfsd/ops.c
+index 463a9c87..64e94b93 100644
+--- a/nfsd/ops.c
++++ b/nfsd/ops.c
+@@ -292,7 +292,7 @@ op_write (struct cache_handle *c,
+   off_t offset;
+   size_t count;
+   error_t err;
+-  mach_msg_type_number_t amt;
++  vm_size_t amt;
+   char *bp;
+   struct stat st;
+ 
+@@ -583,7 +583,7 @@ op_readdir (struct cache_handle *c,
+   error_t err;
+   char *buf;
+   struct dirent *dp;
+-  size_t bufsize;
++  mach_msg_type_number_t bufsize;
+   int nentries;
+   int i;
+   int *replystart;
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 27/31] gnu: git-minimal: Support the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (25 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 26/31] gnu: hurd: Build fixes for " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 28/31] gnu: inetutils: Fix build for " Janneke Nieuwenhuizen
                   ` (7 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/version-control.scm (git-minimal)[arguments]: When using gcc >=
14, use "-Wno-implicit-function-declaration" in #:make-flags.
Use target-hurd? instead of comparing with "i586-pc-gnu" in "use-host-uname_S"
phase.

Change-Id: Ib9836be8a1e389a82c8a89adf22aaeac0d85bd14
---
 gnu/packages/version-control.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 6bd37fee82..136d52af51 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -111,6 +111,7 @@ (define-module (gnu packages version-control)
   #:use-module (gnu packages file)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
@@ -292,7 +293,10 @@ (define-public git-minimal
               ;; By default 'make install' creates hard links for
               ;; things in 'libexec/git-core', which leads to huge
               ;; nars; see <https://bugs.gnu.org/21949>.
-              "NO_INSTALL_HARDLINKS=indeed")
+              "NO_INSTALL_HARDLINKS=indeed"
+              #$@(if (version>=? (package-version (current-gcc)) "14")
+                     #~("-Wno-implicit-function-declaration")
+                     #~()))
       #:phases
       #~(modify-phases %standard-phases
           #$@(if (%current-target-system)
@@ -301,7 +305,7 @@ (define-public git-minimal
                       (lambda _
                         (substitute* "config.mak.uname"
                           (("uname_S := .*" all)
-                           (if (equal? #$(%current-target-system) "i586-pc-gnu")
+                           (if #$(target-hurd?)
                                "uname_S := GNU\n"
                                all))))))
                  ;; We do not have a full bash when cross-compiling.
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 28/31] gnu: inetutils: Fix build for the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (26 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 27/31] gnu: git-minimal: Support " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 29/31] gnu: grub: " Janneke Nieuwenhuizen
                   ` (6 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/inetutils-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/admin.scm (inetutils)[arguments]: When building for the 64bit
Hurd, use it in new "apply-hurd64-patch" stage.

Change-Id: I780f6a92418b49e5fe0d23eb1c90e155216f1428
---
 gnu/local.mk                                |  1 +
 gnu/packages/admin.scm                      | 14 ++++-
 gnu/packages/patches/inetutils-hurd64.patch | 65 +++++++++++++++++++++
 3 files changed, 78 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/inetutils-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index cf0de3d92e..6a46241e5f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1568,6 +1568,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ilmbase-fix-tests.patch			\
   %D%/packages/patches/instead-use-games-path.patch		\
   %D%/packages/patches/intltool-perl-compatibility.patch	\
+  %D%/packages/patches/inetutils-hurd64.patch			\
   %D%/packages/patches/irrlicht-use-system-libs.patch		\
   %D%/packages/patches/irrlicht-link-against-needed-libs.patch	\
   %D%/packages/patches/isl-0.11.1-aarch64-support.patch	\
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index db9aea31a5..f0dde60d6a 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -31,7 +31,7 @@
 ;;; Copyright © 2019, 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2019, 2020, 2021 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
@@ -1000,7 +1000,17 @@ (define-public inetutils
                              "\\\""))
       ;; On some systems, 'libls.sh' may fail with an error such as:
       ;; "Failed to tell switch -a apart from -A".
-      #:parallel-tests? #f))
+      #:parallel-tests? #f
+      #:phases (if (target-hurd64?)
+                   #~(modify-phases %standard-phases
+                       (add-after 'unpack 'apply-hurd64-patch
+                         (lambda _
+                           (let ((patch
+                                  #$(local-file
+                                     (search-patch
+                                      "inetutils-hurd64.patch"))))
+                             (invoke "patch" "--force" "-p1" "-i" patch)))))
+                   #~%standard-phases)))
     (inputs
      (list coreutils
            shadow                     ;for login (used in telnetd and rlogind)
diff --git a/gnu/packages/patches/inetutils-hurd64.patch b/gnu/packages/patches/inetutils-hurd64.patch
new file mode 100644
index 0000000000..3fb238bcdc
--- /dev/null
+++ b/gnu/packages/patches/inetutils-hurd64.patch
@@ -0,0 +1,65 @@
+Upstream-status: Not presented upstream.
+
+From 0804e655a7abfd22dc3a053f03fab8f811405f84 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Fri, 8 Nov 2024 11:07:56 +0100
+Subject: [PATCH] ifconfig hurd: Build fix for the 64bit HUrd.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+* ifconfig/system/hurd.c (check_driving): Use mach_msg_type_number_t
+instead of size_t for file_get_fs_options.
+---
+ ifconfig/system/hurd.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/ifconfig/system/hurd.c b/ifconfig/system/hurd.c
+index 70b2ed27..86fe6375 100644
+--- a/ifconfig/system/hurd.c
++++ b/ifconfig/system/hurd.c
+@@ -47,7 +47,7 @@ check_driving (const char *name)
+   error_t err;
+ 
+   char *argz = 0, *new_argz = 0;
+-  size_t argz_len = 0;
++  mach_msg_type_number_t argz_len = 0;
+   char *entry = 0;
+   const char *socket = _SERVERS_SOCKET "/2";
+ 
+@@ -106,7 +106,9 @@ check_driving (const char *name)
+   new_argz = malloc (argz_len);
+   memcpy (new_argz, argz, argz_len);
+ 
+-  err = argz_insert (&new_argz, &argz_len, new_argz, name);
++  size_t new_argz_len = 0;
++
++  err = argz_insert (&new_argz, &new_argz_len, new_argz, name);
+   if (err)
+     {
+       error (0, err, "Could not prepend name %s to '%s' for %s", name,
+@@ -114,7 +116,7 @@ check_driving (const char *name)
+       goto out;
+     }
+ 
+-  err = argz_insert (&new_argz, &argz_len, new_argz, "-i");
++  err = argz_insert (&new_argz, &new_argz_len, new_argz, "-i");
+   if (err)
+     {
+       argz_stringify (new_argz, argz_len, ' ');
+@@ -122,10 +124,10 @@ check_driving (const char *name)
+       goto out;
+     }
+ 
+-  err = fsys_set_options (fsys, new_argz, argz_len, 1);
++  err = fsys_set_options (fsys, new_argz, new_argz_len, 1);
+   if (err)
+     {
+-      argz_stringify (new_argz, argz_len, ' ');
++      argz_stringify (new_argz, new_argz_len, ' ');
+       error (0, err, "Could not make pfinet %s drive %s with '%s'", socket,
+ 	     name, new_argz);
+       goto out;
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 29/31] gnu: grub: Fix build for the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (27 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 28/31] gnu: inetutils: Fix build for " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 30/31] gnu: guile-fibers: " Janneke Nieuwenhuizen
                   ` (5 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290; +Cc: Efraim Flashner, Vagrant Cascadian

* gnu/packages/patches/grub-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/bootloaders.scm (grub)[arguments]: When building for the 64bit
Hurd, use it in new "apply-hurd64-patch" stage.

Change-Id: I780f6a92418b49e5fe0d23eb1c90e155216f1428
---
 gnu/local.mk                           |  1 +
 gnu/packages/bootloaders.scm           |  8 +++++++
 gnu/packages/patches/grub-hurd64.patch | 32 ++++++++++++++++++++++++++
 3 files changed, 41 insertions(+)
 create mode 100644 gnu/packages/patches/grub-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 6a46241e5f..11955c7a49 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1487,6 +1487,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gromacs-tinyxml2.patch			\
   %D%/packages/patches/groovy-add-exceptionutilsgenerator.patch	\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
+  %D%/packages/patches/grub-hurd64.patch			\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 8ae9621e5b..781000af1b 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -192,6 +192,14 @@ (define-public grub
                        (setenv "BUILD_FREETYPE_CFLAGS"
                                (string-append "-I" freetype
                                               "/include/freetype2"))))))
+               #$@(if (target-hurd64?)
+                      #~((add-after 'unpack 'apply-hurd64-patch
+                           (lambda _
+                             (let ((patch
+                                    #$(local-file
+                                       (search-patch "grub-hurd64.patch"))))
+                               (invoke "patch" "--force" "-p1" "-i" patch)))))
+                      #~())
                (add-before 'check 'disable-flaky-test
                  (lambda _
                    ;; This test is unreliable. For more information, see:
diff --git a/gnu/packages/patches/grub-hurd64.patch b/gnu/packages/patches/grub-hurd64.patch
new file mode 100644
index 0000000000..d5acd99eb8
--- /dev/null
+++ b/gnu/packages/patches/grub-hurd64.patch
@@ -0,0 +1,32 @@
+Upstream-status: Not presented upstream.
+
+From a4eb7d1f2cbd02132a9f5512f1294182576d4653 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Fri, 8 Nov 2024 11:47:49 +0100
+Subject: [PATCH] osdep/hurd: Support the 64bit Hurd.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+* grub-core/osdep/hurd/getroot.c (grub_util_find_hurd_root_device):
+Use mach_msg_type_number_t instead of size_t.
+---
+ grub-core/osdep/hurd/getroot.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/grub-core/osdep/hurd/getroot.c b/grub-core/osdep/hurd/getroot.c
+index 0efefdab4..b849700e6 100644
+--- a/grub-core/osdep/hurd/getroot.c
++++ b/grub-core/osdep/hurd/getroot.c
+@@ -58,7 +58,7 @@ grub_util_find_hurd_root_device (const char *path)
+   file_t file;
+   error_t err;
+   char *argz = NULL, *name = NULL, *ret;
+-  size_t argz_len = 0;
++  mach_msg_type_number_t argz_len = 0;
+   int i;
+ 
+   file = file_name_lookup (path, 0, 0);
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 30/31] gnu: guile-fibers: Fix build for the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (28 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 29/31] gnu: grub: " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 10:38 ` [bug#74290] [PATCH 31/31] system: hurd: Use 64bit gnumach " Janneke Nieuwenhuizen
                   ` (4 subsequent siblings)
  34 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* gnu/packages/guile-xyz.scm (guile-fibers)[arguments]: Also modify phases for
the 64bit Hurd.

Change-Id: I780f6a92418b49e5fe0d23eb1c90e155216f1428
---
 gnu/packages/guile-xyz.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index ea192c2c03..a874ab908d 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -855,7 +855,7 @@ (define-public guile-fibers
      (list #:make-flags
            #~(list "GUILE_AUTO_COMPILE=0")
            #:phases
-           (if (target-x86-64?)
+           (if (and (target-x86-64?) (not (target-hurd?)))
                #~%standard-phases
                #~(modify-phases %standard-phases
                    (add-before 'check 'disable-some-tests
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 31/31] system: hurd: Use 64bit gnumach for the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (29 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 30/31] gnu: guile-fibers: " Janneke Nieuwenhuizen
@ 2024-11-10 10:38 ` Janneke Nieuwenhuizen
  2024-11-10 14:40   ` janneke
  2024-11-10 14:15 ` [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka " janneke
                   ` (3 subsequent siblings)
  34 siblings, 1 reply; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-10 10:38 UTC (permalink / raw)
  To: 74290

* 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))))
 
 (define %base-packages/hurd
   ;; Note: the Shepherd comes before the Hurd, not just because its duty is to
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 02/31] gnu: gnumach: Update to v1.8+git20240714.
  2024-11-10 10:37 ` [bug#74290] [PATCH 02/31] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
@ 2024-11-10 11:45   ` janneke
  0 siblings, 0 replies; 206+ messages in thread
From: janneke @ 2024-11-10 11:45 UTC (permalink / raw)
  To: 74290

[-- Attachment #1: Type: text/plain, Size: 973 bytes --]

Janneke Nieuwenhuizen writes:

> * gnu/packages/patches/gnumach-version.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Register it.
> * gnu/packages/hurd.scm (gnumach-headers): Update to v1.8+git20240714 and use
> it.

Err, this needs

--8<---------------cut here---------------start------------->8---
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 682deb89cf..a000cbfdc5 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2640,6 +2640,7 @@ (define gnumach-headers-boot0
      (source
       (origin
         (inherit (package-source gnumach-headers))
+        (patches '())
         (method
          (git-fetch-from-tarball
           (origin

--8<---------------cut here---------------end--------------->8---

in order for `guix build --system=x86_64-gnu' (checking bootstrap
hashes) not to hang.

Oops, caused by a last minute adding of "nice cosmetic" version number
patch from Debian.

Janneke


[-- Attachment #2: 0001-squash-gnu-gnumach-Update-to-v1.8-git20240714.patch --]
[-- Type: text/x-patch, Size: 1247 bytes --]

From efb58c8deb6693aaa9dcec6d616289d36c3967b3 Mon Sep 17 00:00:00 2001
Message-ID: <efb58c8deb6693aaa9dcec6d616289d36c3967b3.1731238981.git.janneke@gnu.org>
From: Janneke Nieuwenhuizen <janneke@gnu.org>
Date: Sun, 10 Nov 2024 12:31:13 +0100
Subject: [PATCH] squash! gnu: gnumach: Update to v1.8+git20240714.
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8

* gnu/packages/commencement.scm (gnumach-headers-boot0)[origin]: Reset
patches.

Change-Id: I5186c6c0e4f8df6ea55a74943b919bd13530d4d3
---
 gnu/packages/commencement.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 682deb89cf..a000cbfdc5 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2640,6 +2640,7 @@ (define gnumach-headers-boot0
      (source
       (origin
         (inherit (package-source gnumach-headers))
+        (patches '())
         (method
          (git-fetch-from-tarball
           (origin

base-commit: 52f615e031e134f37d20b5bda18e24391c6654c0
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com


[-- Attachment #3: Type: text/plain, Size: 164 bytes --]


-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com

^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (30 preceding siblings ...)
  2024-11-10 10:38 ` [bug#74290] [PATCH 31/31] system: hurd: Use 64bit gnumach " Janneke Nieuwenhuizen
@ 2024-11-10 14:15 ` janneke
  2024-11-12  1:17   ` Maxim Cournoyer
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                   ` (2 subsequent siblings)
  34 siblings, 1 reply; 206+ messages in thread
From: janneke @ 2024-11-10 14:15 UTC (permalink / raw)
  To: 74290
  Cc: Vagrant Cascadian, Josselin Poiret, Tobias Geerinckx-Rice,
	Sharlatan Hellseher, Maxim Cournoyer, Ekaitz Zarraga,
	Simon Tournier, Guillaume Le Vaillant, Mathieu Othacehe,
	Ludovic Courtès, Katherine Cox-Buday, Efraim Flashner,
	Munyoki Kilyungi, Andreas Enge, jgart, Christopher Baines

Janneke Nieuwenhuizen writes:

From running etc/teams.scm by hand I found that you should have been
CC'd on this patch series, sorry.  Working from a backup laptop that
missed the ../etc/git/gitconfig teams include.

> Hi,
>
> Lo and behold, the 64bit Hurd boots!  Again, thanks to the help from the
> kind folks over at libera #hurd and their excellent work.  Do something like:
>
> ./pre-inst-env guix system image --image-type=hurd64-qcow2 \
>   gnu/system/examples/bare-hurd.tmpl
>
>
> producing something like: /gnu/store/...-disk-image.
>
> Run the image in QEMU:
>
> guix shell qemu@7 -- qemu-system-x86_64                 \
> --machine q35                                           \
> -m 4096                                                 \
> --enable-kvm                                            \
> --device rtl8139,netdev=net0                            \
> --netdev user,id=net0,hostfwd=tcp:0.0.0.0:11022-:2222   \
> --snapshot                                              \
> --hda /gnu/store/...-disk-image
>
>
> and login
>
> 11:03:20 janneke@dundal:~/src/guix/hurd-team 
> $ ssh -p 11022 root@localhost
> Last login: Sun Nov 10 10:09:00 2024 from 10.0.2.2
> 
> 
>   This is the GNU Hurd.  Welcome.
>
> root@guixygnu ~# uname -a
> GNU guixygnu 0.9 GNU-Mach 1.8/Hurd-0.9 x86_64 GNU
>
> Most notably, besides the expected updates, this series adds an indirection
> for gcc and gcc-toolchain, (current-gcc) and (current-gcc-toolchain)
> respectively, as the 64bit Hurd needs gcc-14.  We may also want to think about
> image names hurd64-qcow2 etc. and their defaults, vs hurd-qcow2/hurd32-qcow2.
> We'll probably also want a 64bit childhurd service, etc, etc...
>
> This series builds on/waits for #73927, which I intend to rebase and push
> later this weekend if there are no further comments.  And I guess that the
> pending blog post will also need an update :)
>
> For your hacking convenience I have reset and updated the `hurd-team' branch.
>
> Greetings,
> Janneke
>
> Janneke Nieuwenhuizen (31):
>   gnu: mig: Update to v1.8+git20231217.
>   gnu: gnumach: Update to v1.8+git20240714.
>   gnu: hurd: Update to v0.9.git20240714.
>   gnu: gcc: Add indirections current-gcc, current-gcc-toolchain.
>   gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
>   gnu: cross-libc: Support cross-building for the 64bit Hurd.
>   gnu: bash-minimal: Fix build for 64bit Hurd.
>   gnu: elfutils: Fix build for 64bit Hurd.
>   gnu: grep: Fix build for the 64bit Hurd.
>   gnu: patch: Fix build for the 64bit Hurd.
>   gnu: libxcrypt: Support the 64bit Hurd.
>   gnu: libstdc++: Support the 64bit Hurd.
>   gnu: gcc-13, gcc-14: Support being used as parent for gcc-static.
>   DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd.
>   system: image: Add hurd64 image types.
>   gnu: Add libgpg-error-1.50.
>   gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd.
>   gnu: perl: Support cross-building for the 64bit Hurd.
>   gnu: openssl-3.0: Support the 64bit Hurd.
>   gnu: pciutils: Support the 64bit Hurd.
>   gnu: libpciaccess: Support the 64bit Hurd.
>   gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df.
>   gnu: netdde: Support the 64bit Hurd.
>   gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337.
>   gnu: rumpkernel: Support the 64bit Hurd.
>   gnu: hurd: Build fixes for the 64bit Hurd.
>   gnu: git-minimal: Support the 64bit Hurd.
>   gnu: inetutils: Fix build for the 64bit Hurd.
>   gnu: grub: Fix build for the 64bit Hurd.
>   gnu: guile-fibers: Fix build for the 64bit Hurd.
>   system: hurd: Use 64bit gnumach for the 64bit Hurd.
>
>  doc/guix.texi                                 |   9 +-
>  gnu/ci.scm                                    |   4 +-
>  gnu/local.mk                                  |   9 +
>  gnu/packages/admin.scm                        |  14 +-
>  gnu/packages/avr.scm                          |   7 +-
>  gnu/packages/base.scm                         |  74 ++++---
>  gnu/packages/bash.scm                         |   9 +
>  gnu/packages/benchmark.scm                    |   6 +-
>  gnu/packages/bootloaders.scm                  |  10 +-
>  gnu/packages/bootstrap.scm                    |  46 ++++-
>  gnu/packages/c.scm                            |   4 +-
>  gnu/packages/chicken.scm                      |   7 +-
>  gnu/packages/commencement.scm                 |  35 ++--
>  gnu/packages/containers.scm                   |   5 +-
>  gnu/packages/cross-base.scm                   |  27 +--
>  gnu/packages/crypto.scm                       |  15 ++
>  gnu/packages/dlang.scm                        |   3 +-
>  gnu/packages/elf.scm                          |   6 +-
>  gnu/packages/engineering.scm                  |   4 +-
>  gnu/packages/gawk.scm                         |   3 +-
>  gnu/packages/gcc.scm                          |  69 ++++---
>  gnu/packages/gnupg.scm                        |  19 +-
>  gnu/packages/golang.scm                       |   3 +-
>  gnu/packages/guile-xyz.scm                    |   2 +-
>  gnu/packages/hurd.scm                         | 187 ++++++++++++------
>  gnu/packages/julia-xyz.scm                    |   3 +-
>  gnu/packages/lisp.scm                         |   3 +-
>  gnu/packages/llvm.scm                         |   7 +-
>  gnu/packages/make-bootstrap.scm               |  60 +++---
>  gnu/packages/mpi.scm                          |   3 +-
>  gnu/packages/parallel.scm                     |   5 +-
>  gnu/packages/patches/gnumach-version.patch    |  23 +++
>  gnu/packages/patches/grub-hurd64.patch        |  32 +++
>  gnu/packages/patches/hurd-64bit.patch         |  56 ++++++
>  gnu/packages/patches/inetutils-hurd64.patch   |  65 ++++++
>  .../patches/libpciaccess-hurd64.patch         |  58 ++++++
>  gnu/packages/patches/libxcrypt-hurd64.patch   |  38 ++++
>  gnu/packages/patches/netdde-csum.patch        |  18 ++
>  gnu/packages/patches/openssl-hurd64.patch     |  99 ++++++++++
>  gnu/packages/patches/pciutils-hurd64.patch    |  31 +++
>  gnu/packages/pciutils.scm                     |  25 ++-
>  gnu/packages/perl.scm                         |  20 +-
>  gnu/packages/rocm.scm                         |   3 +-
>  gnu/packages/tls.scm                          |   9 +
>  gnu/packages/version-control.scm              |   8 +-
>  gnu/packages/xorg.scm                         |  23 ++-
>  gnu/system.scm                                |   1 -
>  gnu/system/hurd.scm                           |  11 +-
>  gnu/system/images/hurd.scm                    |  47 ++++-
>  guix/packages.scm                             |   8 +-
>  guix/platforms/x86.scm                        |  11 +-
>  guix/utils.scm                                |  15 +-
>  m4/guix.m4                                    |  12 +-
>  53 files changed, 1025 insertions(+), 246 deletions(-)
>  create mode 100644 gnu/packages/patches/gnumach-version.patch
>  create mode 100644 gnu/packages/patches/grub-hurd64.patch
>  create mode 100644 gnu/packages/patches/hurd-64bit.patch
>  create mode 100644 gnu/packages/patches/inetutils-hurd64.patch
>  create mode 100644 gnu/packages/patches/libpciaccess-hurd64.patch
>  create mode 100644 gnu/packages/patches/libxcrypt-hurd64.patch
>  create mode 100644 gnu/packages/patches/netdde-csum.patch
>  create mode 100644 gnu/packages/patches/openssl-hurd64.patch
>  create mode 100644 gnu/packages/patches/pciutils-hurd64.patch
>
>
> base-commit: 7105e7125882be35e334448eafd6d81b37b627f0

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 31/31] system: hurd: Use 64bit gnumach for the 64bit Hurd.
  2024-11-10 10:38 ` [bug#74290] [PATCH 31/31] system: hurd: Use 64bit gnumach " Janneke Nieuwenhuizen
@ 2024-11-10 14:40   ` janneke
  0 siblings, 0 replies; 206+ messages in thread
From: janneke @ 2024-11-10 14:40 UTC (permalink / raw)
  To: 74290

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

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 14/31] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-10 10:38 ` [bug#74290] [PATCH 14/31] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-11 18:05   ` janneke
  0 siblings, 0 replies; 206+ messages in thread
From: janneke @ 2024-11-11 18:05 UTC (permalink / raw)
  To: 74290

[-- Attachment #1: Type: text/plain, Size: 1538 bytes --]

Janneke Nieuwenhuizen writes:

Oops! This inadvertedly changed i586-gnu-pc hashes:

> diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
> index c4640b62e1..eb6a4f1917 100644
> --- a/gnu/packages/bootstrap.scm
> +++ b/gnu/packages/bootstrap.scm
> @@ -118,13 +118,22 @@ (define %bootstrap-executables
>        ,(base32 "0i9kxdi17bm5gxfi2xzm0y73p3ii0cqxli1sbljm6rh2fjgyn90k")))
>      ("i586-gnu"
>       ("bash"
> -      ,(base32 "1as8649aqaibahhhrvkj10ci8shpi4hq5n7gnik8rhhy0dc1jarg"))
> +      ,(base32 "0nb8ga2j7a4kf6j7pnavq8zf68mj8mhqh26nwkilz1ykj86vg9ml"))
>       ("mkdir"
> -      ,(base32 "1snqgpfrl00hfn82lm29jqylzjsfb9jd6ha74dp12phwb8fpbmb9"))
> +      ,(base32 "0ldsx9pwan40fx2hf4s9d10sfkhvkljvl20hksvm4192p7jb4shp"))
>       ("tar"
> -      ,(base32 "0nq2c1zb3wv5bf7kd83sziaashydazrn7xgq6kijlk0zj2syzc2m"))
> +      ,(base32 "1z6kfvpwhy14vc52i61v1vzzk3gzxka3db5rlg1jsq6kli35s2ab"))
>       ("xz"
> -      ,(base32 "033rhpk6zrpxpd6ffjyg5y2zwq9x9cnq0zljb7k8jlncbalsayq5")))
> +      ,(base32 "1f7g40sk5a6k6qf65k58vlybnnmhyyzczdxy60m3jgcsp674wfcr")))

and did not use "-r" in guix hash -r (I thought that meant "recursive"):

> +    ("x86_64-gnu"
> +     ("bash"
> +      ,(base32 "0l0dnighcipvdfbk14q834n57q859i2b9ssiq4bnbh0jpxvvqp1l"))
> +     ("mkdir"
> +      ,(base32 "1nd17k8pwwi7zsqi685w4rn1p2cvfcalrzdhfgwpsk1ilxnmdvsq"))
> +     ("tar"
> +      ,(base32 "0lf94y22ngmxdwhsp0cvj33m23p33r999xnlrff0s1yvlf20w3ks"))
> +     ("xz"
> +      ,(base32 "145aq65rx7w0qk1sw9239888id5ri60ha0xp1kyp6ir3pvizh6by")))



[-- Attachment #2: 0001-squash-DRAFT-gnu-bootstrap-Add-support-for-x86_64-gn.patch --]
[-- Type: text/x-patch, Size: 9069 bytes --]

From 59a6dcd5f4ca63aa17c83366fc5b74cf4c93d61d Mon Sep 17 00:00:00 2001
Message-ID: <59a6dcd5f4ca63aa17c83366fc5b74cf4c93d61d.1731348265.git.janneke@gnu.org>
From: Janneke Nieuwenhuizen <janneke@gnu.org>
Date: Mon, 11 Nov 2024 08:27:41 +0100
Subject: [PATCH] squash! DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka
 the 64bit Hurd.
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8

Oops: Leave i586-pc-gnu alone and use guix hash -r.

Change-Id: Id96715cee07572cd0635594d3b1aa6756fa8a822
---
 gnu/packages/bootstrap.scm | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index eb6a4f1917..066eef5cc8 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -118,22 +118,22 @@ (define %bootstrap-executables
       ,(base32 "0i9kxdi17bm5gxfi2xzm0y73p3ii0cqxli1sbljm6rh2fjgyn90k")))
     ("i586-gnu"
      ("bash"
-      ,(base32 "0nb8ga2j7a4kf6j7pnavq8zf68mj8mhqh26nwkilz1ykj86vg9ml"))
+      ,(base32 "1as8649aqaibahhhrvkj10ci8shpi4hq5n7gnik8rhhy0dc1jarg"))
      ("mkdir"
-      ,(base32 "0ldsx9pwan40fx2hf4s9d10sfkhvkljvl20hksvm4192p7jb4shp"))
+      ,(base32 "1snqgpfrl00hfn82lm29jqylzjsfb9jd6ha74dp12phwb8fpbmb9"))
      ("tar"
-      ,(base32 "1z6kfvpwhy14vc52i61v1vzzk3gzxka3db5rlg1jsq6kli35s2ab"))
+      ,(base32 "0nq2c1zb3wv5bf7kd83sziaashydazrn7xgq6kijlk0zj2syzc2m"))
      ("xz"
-      ,(base32 "1f7g40sk5a6k6qf65k58vlybnnmhyyzczdxy60m3jgcsp674wfcr")))
+      ,(base32 "033rhpk6zrpxpd6ffjyg5y2zwq9x9cnq0zljb7k8jlncbalsayq5")))
     ("x86_64-gnu"
      ("bash"
-      ,(base32 "0l0dnighcipvdfbk14q834n57q859i2b9ssiq4bnbh0jpxvvqp1l"))
+      ,(base32 "1ib1kk1larki3dm46lhl756856zpjwhhlnzkgdyh9f1yf6wm431y"))
      ("mkdir"
-      ,(base32 "1nd17k8pwwi7zsqi685w4rn1p2cvfcalrzdhfgwpsk1ilxnmdvsq"))
+      ,(base32 "15cnckq4qj1nlmgqy9vq3qa3kcbfm1pc2z38pscxix11j4aqswsm"))
      ("tar"
-      ,(base32 "0lf94y22ngmxdwhsp0cvj33m23p33r999xnlrff0s1yvlf20w3ks"))
+      ,(base32 "1m8v7ddmn42wym2kl9mf7csnwsw6c3jdglg7d7kp7yaa16h5fbck"))
      ("xz"
-      ,(base32 "145aq65rx7w0qk1sw9239888id5ri60ha0xp1kyp6ir3pvizh6by")))
+      ,(base32 "16cnr7vr0zawrwcnhshms3v5kyzb2vz1rp4kxmx507cs6rivd05b")))
     ("mips64el-linux"
      ("bash"
       ,(base32 "1aw046dhda240k9pb9iaj5aqkm23gkvxa9j82n4k7fk87nbrixw6"))
@@ -174,7 +174,7 @@ (define (bootstrap-executable-file-name system program)
   (match system
     ("powerpc64le-linux" (string-append system "/20210106/" program))
     ("i586-gnu" (string-append system "/20200326/" program))
-    ("x86_64-gnu" (string-append system "/20241110/" program))
+    ("x86_64-gnu" (string-append system "/20241111/" program))
     ("powerpc-linux" (string-append system "/20200923/bin/" program))
     ("riscv64-linux" (string-append system "/20210725/bin/" program))
     (_ (string-append system "/" program
@@ -377,7 +377,7 @@ (define (bootstrap-guile-url-path system)
                    ("i586-gnu"
                     "/20200326/guile-static-stripped-2.0.14-i586-pc-gnu.tar.xz")
                    ("x86_64-gnu"
-                    "/20241110/guile-static-stripped-3.0.9-x86_64-pc-gnu.tar.xz")
+                    "/20241111/guile-static-stripped-3.0.9-x86_64-pc-gnu.tar.xz")
                    ("powerpc64le-linux"
                     "/20210106/guile-static-stripped-2.0.14-powerpc64le-linux-gnu.tar.xz")
                    ("riscv64-linux"
@@ -403,7 +403,7 @@ (define (bootstrap-guile-hash system)
     ("i586-gnu"
      (base32 "0wgqpsmvg25rnqn49ap7kwd2qxccd8dr4lllzp7i3rjvgav27vac"))
     ("x86_64-gnu"
-     (base32 "0fgasmbidp584ibr5fbirmp3wr8qchv84a50i4bichysp00gg26p"))
+     (base32 "0s2r8pwy8jcp1m8qdyiwvnv6f4wmcjq9a8g8jcbm974dd63ym2y3"))
     ("powerpc-linux"
      (base32 "1by2p7s27fbyjzfkcw8h65h4kkqh7d23kv4sgg5jppjn2qx7swq4"))
     ("riscv64-linux"
@@ -613,7 +613,7 @@ (define %bootstrap-coreutils&co
                                             ("i586-gnu"
                                              "/20200326/static-binaries-0-i586-pc-gnu.tar.xz")
                                             ("x86_64-gnu"
-                                             "/20241110/static-binaries-0-x86_64-pc-gnu.tar.xz")
+                                             "/20241111/static-binaries-0-x86_64-pc-gnu.tar.xz")
                                             ("powerpc-linux"
                                              "/20200923/static-binaries.tar.xz")
                                             ("riscv64-linux"
@@ -643,7 +643,7 @@ (define %bootstrap-coreutils&co
                                 "17kllqnf3fg79gzy9ansgi801c46yh9c23h4d923plvb0nfm1cfn"))
                               ("x86_64-gnu"
                                (base32
-                                "118s161df8hgrdfph2w5spnrms02rh1dk7mzfvx1k1prvgngpm9p"))
+                                "05lacv0zx80798wmri6d7aag5vkpfm7q0xsrp1fm0vldwdm1v39v"))
                               ("powerpc-linux"
                                (base32
                                 "0kspxy0yczan2vlih6aa9hailr2inz000fqa0gn5x9d1fxxa5y8m"))
@@ -701,7 +701,7 @@ (define %bootstrap-binutils
                                             ("i586-gnu"
                                              "/20200326/binutils-static-stripped-2.34-i586-pc-gnu.tar.xz")
                                             ("x86_64-gnu"
-                                             "/20241110/binutils-static-stripped-2.41-x86_64-pc-gnu.tar.xz")
+                                             "/20241111/binutils-static-stripped-2.41-x86_64-pc-gnu.tar.xz")
                                             ("powerpc-linux"
                                              "/20200923/binutils-2.35.1.tar.xz")
                                             ("riscv64-linux"
@@ -734,7 +734,7 @@ (define %bootstrap-binutils
                                 "11kykv1kmqc5wln57rs4klaqa13hm952smkc57qcsyss21kfjprs"))
                               ("x86_64-gnu"
                                (base32
-                                "07r74sa7341frhf5a7h1p3pklsrmfpfrf5s8dxm3yz2kqzhish48"))
+                                "0rzdn8357g4gias3k29bc6nhwv23bx029r83k7y4lfnq6w86b1wz"))
                               ("powerpc-linux"
                                (base32
                                 "0asbg1c4avkrvh057mx0942xwddd136jni382zqsxzn79ls42yq8"))
@@ -796,7 +796,7 @@ (define %bootstrap-glibc
                                       ("i586-gnu"
                                        "/20240816/glibc-stripped-2.39-i586-pc-gnu.tar.xz")
                                       ("x86_64-gnu"
-                                       "/20241110/glibc-stripped-2.39-x86_64-pc-gnu.tar.xz")
+                                       "/20241111/glibc-stripped-2.39-x86_64-pc-gnu.tar.xz")
                                       ("powerpc-linux"
                                        "/20200923/glibc-2.32.tar.xz")
                                       ("riscv64-linux"
@@ -829,7 +829,7 @@ (define %bootstrap-glibc
                           "0x2x6w611k6v9qdabacawamw2475p04hm3s0q95xcg063wjq4ig2"))
                         ("x86_64-gnu"
                          (base32
-                          "1dcgrnlxbsdic0xmmrjbr8gl6ra5y2xbj8f8jr6y0zvpdyi12ldd"))
+                          "0fbmh8aa7lva4xm6a8n49pfsgw4gzai00c4ylvggvgryscm65qr7"))
                         ("powerpc-linux"
                          (base32
                           "0smmssyjrlk5cvx49586smmk81gkwff0i6r91n4rir4jm6ba25sb"))
@@ -907,7 +907,7 @@ (define %bootstrap-gcc
                                        ("i586-gnu"
                                         "/20200326/gcc-stripped-5.5.0-i586-pc-gnu.tar.xz")
                                        ("x86_64-gnu"
-                                        "/20241110/gcc-stripped-14.2.0-x86_64-pc-gnu.tar.xz")
+                                        "/20241111/gcc-stripped-14.2.0-x86_64-pc-gnu.tar.xz")
                                        ("powerpc-linux"
                                         "/20200923/gcc-5.5.0.tar.xz")
                                        ("riscv64-linux"
@@ -940,7 +940,7 @@ (define %bootstrap-gcc
                            "1j2zc58wzil71a34h7c70sd68dmqvcscrw3rmn2whq79vd70zvv5"))
                          ("x86_64-gnu"
                           (base32
-                           "0vqvjvw6xi16lihiqz4mhisfwx3dgs15y60q07ksdkgvi1wdli2w"))
+                           "1z9fiwrmknz8x3kcw0p6hdqq176bi43dg4andk40sid0vh34qc0n"))
                          ("powerpc-linux"
                           (base32
                            "1p7df3yixhm87dw5sccc6yn1i9db1r9hnmsg87wq5xi4rfmirq7w"))

base-commit: bf9b13cd1c109adbc372e15d9f17bf1ebe580446
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com


[-- Attachment #3: Type: text/plain, Size: 164 bytes --]


-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com

^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-10 14:15 ` [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka " janneke
@ 2024-11-12  1:17   ` Maxim Cournoyer
  0 siblings, 0 replies; 206+ messages in thread
From: Maxim Cournoyer @ 2024-11-12  1:17 UTC (permalink / raw)
  To: janneke
  Cc: 74290, Josselin Poiret, Tobias Geerinckx-Rice,
	Sharlatan Hellseher, Vagrant Cascadian, Ekaitz Zarraga,
	Simon Tournier, Guillaume Le Vaillant, Mathieu Othacehe,
	Ludovic Courtès, Katherine Cox-Buday, Efraim Flashner,
	Munyoki Kilyungi, Andreas Enge, jgart, Christopher Baines

Hi Janneke!

<janneke@gnu.org> writes:

> Janneke Nieuwenhuizen writes:
>
> From running etc/teams.scm by hand I found that you should have been
> CC'd on this patch series, sorry.  Working from a backup laptop that
> missed the ../etc/git/gitconfig teams include.

No worries.  Note that the git configuration should self-heal/update
itself on every 'make' invocation, IIRC.

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 00/40] Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (31 preceding siblings ...)
  2024-11-10 14:15 ` [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka " janneke
@ 2024-11-12 16:25 ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 01/40] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
                     ` (40 more replies)
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
  34 siblings, 41 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290; +Cc: Janneke Nieuwenhuizen

From: "Janneke Nieuwenhuizen" <janneke@gnu.org>

New in V2:

Add 64bit native compilation/development support:
  * commencement: update of gnumach-headers-boot0, mig-boot0, hurd-headers-boot0,
  * more 64bit Hurd/gcc-14 build fixes: m4, texinfo-4, flex,
  * cross build fix: gettext-[minimal],
  * rebased on latest master (NOTE: u-boot-tools tests must be disabled in
    order to build a VM, see <https://issues.guix.gnu.org/74270>).

Fixes:
  * guile-static now actually has (convinced libtool to create) a static guile,
  * guile-static-stripped-tarball is now packaged in a guile v3 bag,
  * binutils-static now actually has (convinced libtool to create) static binaries,
  * the hashes for bin/{bash,mkdir,tar,xz} now use guix hash _-r_,
  * the 32bit childhurd uses a 32bit gnumach again (and boots),
  * gnumach-headers-boot0 resets patches, resolving native i586-pc-gnu builds hanging,
  * a new bare-hurd64.tmpl (and devel-hurd64.tmpl) now work around this
    terrible "cannot-cross-build-gnumach-so-let's-guess-an-arch" issue,
    using NOIDE needed for the 64bit hurd to boot, and with better suggestions,

This is about the extent of what it can do right now: 

--8<---------------cut here---------------start------------->8---
15:07:14 janneke@dundal:~/var/geert 
$ ssh root@childhurd1


  This is the GNU Hurd.  Welcome.
root@guixygnu64 ~# uname -a
GNU guixygnu64 0.9 GNU-Mach 1.8/Hurd-0.9 x86_64 GNU
root@guixygnu64 ~# guix shell --bootstrap -D --expression='(@@ (gnu packages commencement) gnu-make-boot0)'
hint: Consider passing the `--check' option once to make sure your shell does not
clobber environment variables.

substitute: updating substitutes from 'http://dezyne.org:8181'... 100.0%
substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
The following derivations will be built:
  /gnu/store/w8y6ksif8m5x5340nc1f7chdmnidhsza-profile.drv
  /gnu/store/8kqnvyf9i8qgizq69314xa576fj4idy5-gcc-bootstrap-0.drv
  /gnu/store/kxi3vim4rl018vrg8gqchn84vda33dwy-bash.drv
  /gnu/store/mx6bmgkli4m404d9mzl4is9nsgycibw4-gcc-stripped-14.2.0-x86_64-pc-gnu.tar.xz.drv
  /gnu/store/mydw2x1m3nwxl2yz8p7kgr043mgzn1vd-tar.drv
  /gnu/store/ps0shilnqwpm40886dnqg4bkazw8pq7i-glibc-bootstrap-0.drv
  /gnu/store/fyk1fklwccp9m0g4x10rsgi6bw2nz3y5-glibc-stripped-2.39-x86_64-pc-gnu.tar.xz.drv
  /gnu/store/q4y6c1xk2vzfm5qff4kxw6skakkdz5mx-module-import-compiled.drv
  /gnu/store/z8bbhrwjlcrb1why3ahz1dk4x1xnwf0j-guile-bootstrap-2.0.drv
  /gnu/store/av844016j5sh8zy7y4h4wxkrs10a2rwd-guile-static-stripped-3.0.9-x86_64-pc-gnu.tar.xz.drv
  /gnu/store/rs264sapynb56fapyrklb5plsn0gsk49-xz.drv
  /gnu/store/zw7x3ln4wl3b0hvrzgjjvywx5bdiffaz-mkdir.drv
  /gnu/store/8llks4si3nqiw0n6sb3nc70nhpnfzw9j-module-import-compiled.drv
  /gnu/store/h0i9912383rhczlxca6pv5d6w9np9ici-bootstrap-binaries-0.drv
  /gnu/store/pllyzbxxbg249x6ckn4hb67g3q4v7xk5-static-binaries-0-x86_64-pc-gnu.tar.xz.drv
  /gnu/store/pa9pzpm6blxiasz5wz98lxdbvlz1a2wn-binutils-bootstrap-0.drv
  /gnu/store/6cg3h8i0mrsizrg1y06gnj491ydhdj9v-binutils-static-stripped-2.41-x86_64-pc-gnu.tar.xz.drv

building /gnu/store/kxi3vim4rl018vrg8gqchn84vda33dwy-bash.drv...
building /gnu/store/6cg3h8i0mrsizrg1y06gnj491ydhdj9v-binutils-static-stripped-2.41-x86_64-pc-gnu.tar.xz.drv...
building /gnu/store/mx6bmgkli4m404d9mzl4is9nsgycibw4-gcc-stripped-14.2.0-x86_64-pc-gnu.tar.xz.drv...
building /gnu/store/fyk1fklwccp9m0g4x10rsgi6bw2nz3y5-glibc-stripped-2.39-x86_64-pc-gnu.tar.xz.drv...
building /gnu/store/av844016j5sh8zy7y4h4wxkrs10a2rwd-guile-static-stripped-3.0.9-x86_64-pc-gnu.tar.xz.drv...
building /gnu/store/zw7x3ln4wl3b0hvrzgjjvywx5bdiffaz-mkdir.drv...
building /gnu/store/pllyzbxxbg249x6ckn4hb67g3q4v7xk5-static-binaries-0-x86_64-pc-gnu.tar.xz.drv...
building /gnu/store/mydw2x1m3nwxl2yz8p7kgr043mgzn1vd-tar.drv...
building /gnu/store/rs264sapynb56fapyrklb5plsn0gsk49-xz.drv...
building /gnu/store/z8bbhrwjlcrb1why3ahz1dk4x1xnwf0j-guile-bootstrap-2.0.drv...
building /gnu/store/8llks4si3nqiw0n6sb3nc70nhpnfzw9j-module-import-compiled.drv...
building /gnu/store/q4y6c1xk2vzfm5qff4kxw6skakkdz5mx-module-import-compiled.drv...
building /gnu/store/pa9pzpm6blxiasz5wz98lxdbvlz1a2wn-binutils-bootstrap-0.drv...
building /gnu/store/h0i9912383rhczlxca6pv5d6w9np9ici-bootstrap-binaries-0.drv...
building /gnu/store/ps0shilnqwpm40886dnqg4bkazw8pq7i-glibc-bootstrap-0.drv...
building /gnu/store/8kqnvyf9i8qgizq69314xa576fj4idy5-gcc-bootstrap-0.drv...
building profile with 4 packages...
bash-5.1# 
--8<---------------cut here---------------end--------------->8---

Reset and updated the hurd-team branch.

Greetings,
Janneke

Janneke Nieuwenhuizen (40):
  gnu: gnumach: Update to v1.8+git20240714.
  gnu: mig: Update to 1.8+git20231217.
  gnu: hurd: Update to 0.9.git20240714.
  gnu: gcc: Add indirections current-gcc, current-gcc-toolchain.
  gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
  gnu: cross-libc: Support cross-building for the 64bit Hurd.
  gnu: bash-minimal: Fix build for 64bit Hurd.
  gnu: elfutils: Fix build for 64bit Hurd.
  gnu: grep: Fix build for the 64bit Hurd.
  gnu: patch: Fix build for the 64bit Hurd.
  gnu: libxcrypt: Support the 64bit Hurd.
  gnu: libstdc++: Support the 64bit Hurd.
  gnu: gcc-13, gcc-14: Support being used as parent for gcc-static.
  DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd.
  system: image: Add hurd64 image types.
  gnu: Add libgpg-error-1.50.
  gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd.
  gnu: perl: Support cross-building for the 64bit Hurd.
  gnu: openssl-3.0: Support the 64bit Hurd.
  gnu: pciutils: Support the 64bit Hurd.
  gnu: libpciaccess: Support the 64bit Hurd.
  gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df.
  gnu: netdde: Support the 64bit Hurd.
  gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337.
  gnu: rumpkernel: Support the 64bit Hurd.
  gnu: hurd: Build fixes for the 64bit Hurd.
  gnu: git-minimal: Support the 64bit Hurd.
  gnu: inetutils: Fix build for the 64bit Hurd.
  gnu: grub: Fix build for the 64bit Hurd.
  gnu: guile-fibers: Fix build for the 64bit Hurd.
  gnu: m4: Fix build for the 64bit Hurd.
  gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714.
  gnu: commencement: mig-boot0: Update to 1.8+git20231217..
  gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714.
  gnu: commencement: libstdc++-boot0-gcc7: Replace by
    make-libstdc++-boot0.
  gnu: gettext: Fix cross-build shebangs.
  gnu: texinfo-4: Fix build for the 64bit Hurd.
  gnu: flex: Fix build for the 64bit Hurd.
  system: examples: Add bare-hurd64.tmpl.
  system: examples: Add devel-hurd64.tmpl.

 doc/guix.texi                                 |   9 +-
 gnu/ci.scm                                    |   4 +-
 gnu/local.mk                                  |   9 +
 gnu/packages/admin.scm                        |  14 +-
 gnu/packages/avr.scm                          |   7 +-
 gnu/packages/base.scm                         |  74 ++++---
 gnu/packages/bash.scm                         |   9 +
 gnu/packages/benchmark.scm                    |   6 +-
 gnu/packages/bootloaders.scm                  |  10 +-
 gnu/packages/bootstrap.scm                    |  41 +++-
 gnu/packages/c.scm                            |   4 +-
 gnu/packages/chicken.scm                      |   7 +-
 gnu/packages/commencement.scm                 |  55 +++---
 gnu/packages/containers.scm                   |   5 +-
 gnu/packages/cross-base.scm                   |  27 +--
 gnu/packages/crypto.scm                       |  15 ++
 gnu/packages/dlang.scm                        |   3 +-
 gnu/packages/elf.scm                          |   6 +-
 gnu/packages/engineering.scm                  |   4 +-
 gnu/packages/flex.scm                         |   8 +
 gnu/packages/gawk.scm                         |   3 +-
 gnu/packages/gcc.scm                          |  69 ++++---
 gnu/packages/gettext.scm                      |  16 +-
 gnu/packages/gnupg.scm                        |  19 +-
 gnu/packages/golang.scm                       |   3 +-
 gnu/packages/guile-xyz.scm                    |   2 +-
 gnu/packages/hurd.scm                         | 187 ++++++++++++------
 gnu/packages/julia-xyz.scm                    |   3 +-
 gnu/packages/lisp.scm                         |   3 +-
 gnu/packages/llvm.scm                         |   7 +-
 gnu/packages/m4.scm                           |   9 +-
 gnu/packages/make-bootstrap.scm               |  76 ++++---
 gnu/packages/mpi.scm                          |   3 +-
 gnu/packages/parallel.scm                     |   5 +-
 gnu/packages/patches/gnumach-version.patch    |  23 +++
 gnu/packages/patches/grub-hurd64.patch        |  32 +++
 gnu/packages/patches/hurd-64bit.patch         |  56 ++++++
 gnu/packages/patches/inetutils-hurd64.patch   |  65 ++++++
 .../patches/libpciaccess-hurd64.patch         |  58 ++++++
 gnu/packages/patches/libxcrypt-hurd64.patch   |  38 ++++
 gnu/packages/patches/netdde-csum.patch        |  18 ++
 gnu/packages/patches/openssl-hurd64.patch     |  99 ++++++++++
 gnu/packages/patches/pciutils-hurd64.patch    |  31 +++
 gnu/packages/pciutils.scm                     |  25 ++-
 gnu/packages/perl.scm                         |  20 +-
 gnu/packages/rocm.scm                         |   3 +-
 gnu/packages/texinfo.scm                      |  50 ++---
 gnu/packages/tls.scm                          |   9 +
 gnu/packages/version-control.scm              |   8 +-
 gnu/packages/xorg.scm                         |  23 ++-
 gnu/system.scm                                |   1 -
 gnu/system/examples/bare-hurd.tmpl            |  21 +-
 gnu/system/examples/bare-hurd64.tmpl          |  70 +++++++
 gnu/system/examples/devel-hurd.tmpl           |  70 +++----
 gnu/system/examples/devel-hurd64.tmpl         |  65 ++++++
 gnu/system/hurd.scm                           |  17 ++
 gnu/system/images/hurd.scm                    |  72 ++++++-
 guix/packages.scm                             |   8 +-
 guix/platforms/x86.scm                        |  11 +-
 guix/utils.scm                                |  15 +-
 m4/guix.m4                                    |  12 +-
 61 files changed, 1312 insertions(+), 330 deletions(-)
 create mode 100644 gnu/packages/patches/gnumach-version.patch
 create mode 100644 gnu/packages/patches/grub-hurd64.patch
 create mode 100644 gnu/packages/patches/hurd-64bit.patch
 create mode 100644 gnu/packages/patches/inetutils-hurd64.patch
 create mode 100644 gnu/packages/patches/libpciaccess-hurd64.patch
 create mode 100644 gnu/packages/patches/libxcrypt-hurd64.patch
 create mode 100644 gnu/packages/patches/netdde-csum.patch
 create mode 100644 gnu/packages/patches/openssl-hurd64.patch
 create mode 100644 gnu/packages/patches/pciutils-hurd64.patch
 create mode 100644 gnu/system/examples/bare-hurd64.tmpl
 create mode 100644 gnu/system/examples/devel-hurd64.tmpl


base-commit: b10ce47d8be5b6c15987f4e1d93b3bd71b1eb220
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 01/40] gnu: gnumach: Update to v1.8+git20240714.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 02/40] gnu: mig: Update to 1.8+git20231217 Janneke Nieuwenhuizen
                     ` (39 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/patches/gnumach-version.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hurd.scm (gnumach-headers): Update to v1.8+git20240714 and use
it.
* gnu/packages/commencement.scm (gnumach-headers-boot0)[origin]: Reset
patches.

Change-Id: I147c64021c2ee79dfc4cd4fd9a29529eef8890c5
---
 gnu/local.mk                               |  1 +
 gnu/packages/commencement.scm              |  1 +
 gnu/packages/hurd.scm                      |  9 ++++-----
 gnu/packages/patches/gnumach-version.patch | 23 ++++++++++++++++++++++
 4 files changed, 29 insertions(+), 5 deletions(-)
 create mode 100644 gnu/packages/patches/gnumach-version.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 1f48fddc9e..2bd857e7ac 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1460,6 +1460,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gnome-session-support-elogind.patch	\
   %D%/packages/patches/gnome-tweaks-search-paths.patch		\
   %D%/packages/patches/gnulib-bootstrap.patch			\
+  %D%/packages/patches/gnumach-version.patch			\
   %D%/packages/patches/gnupg-default-pinentry.patch		\
   %D%/packages/patches/gnupg-1-build-with-gcc10.patch		\
   %D%/packages/patches/gnutls-skip-trust-store-test.patch	\
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index ce40f0cea6..1cfaaae1e7 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2639,6 +2639,7 @@ (define gnumach-headers-boot0
      (source
       (origin
         (inherit (package-source gnumach-headers))
+        (patches '())
         (method
          (git-fetch-from-tarball
           (origin
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 9c1681f236..a22d0cadce 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -57,21 +57,20 @@ (define (hurd-source-url version)
                  version ".tar.gz"))
 
 (define-public gnumach-headers
-  (let ((revision "0")
-        (commit "2556fdece900d67529d5eda01f1bdaae4ffe96b0"))
+  (let ((commit "v1.8+git20240714"))
     (package
       (name "gnumach-headers")
-      (version (git-version "1.8" revision commit))
+      (version (string-drop commit 1))
       (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://git.savannah.gnu.org/git/hurd/gnumach.git")
                (commit commit)))
+         (patches (search-patches "gnumach-version.patch"))
          (file-name (git-file-name "gnumach" version))
          (sha256
-          (base32
-           "1lzsbix0l4jhab38pvwnmk7ip1lsn7m5smhnrciqajsqnadsnlzs"))))
+          (base32 "0ykav1kx0bgxcxw04bpcsh5s4531fzdkahjgrlsfs2h3w3vfkga0"))))
       (build-system gnu-build-system)
       (arguments
        `(#:phases
diff --git a/gnu/packages/patches/gnumach-version.patch b/gnu/packages/patches/gnumach-version.patch
new file mode 100644
index 0000000000..aec3c86a16
--- /dev/null
+++ b/gnu/packages/patches/gnumach-version.patch
@@ -0,0 +1,23 @@
+Upstream-status: Taken from Debian upstream:
+    <https://salsa.debian.org/hurd-team/gnumach/-/raw/master/debian/patches/12_version_suffix.patch>
+
+Index: gnumach/configure.ac
+===================================================================
+--- gnumach.orig/configure.ac
++++ gnumach/configure.ac
+@@ -19,6 +19,7 @@ AC_PREREQ([2.57])
+ m4_include([version.m4])
+ AC_INIT([AC_PACKAGE_NAME], [AC_PACKAGE_VERSION], [AC_PACKAGE_BUGREPORT],
+   [AC_PACKAGE_TARNAME])
++AC_SUBST([PACKAGE_VERSION_SUFFIX])
+ AC_CONFIG_SRCDIR([kern/ipc_kobject.c])
+ 
+ if test -z "${CFLAGS+set}"; then
+Index: gnumach/version.c.in
+===================================================================
+--- gnumach.orig/version.c.in
++++ gnumach/version.c.in
+@@ -1,2 +1,2 @@
+ /* @configure_input@ */
+-const char version[] = "@PACKAGE_NAME@ @PACKAGE_VERSION@";
++const char version[] = "@PACKAGE_NAME@ @PACKAGE_VERSION@@PACKAGE_VERSION_SUFFIX@";
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 02/40] gnu: mig: Update to 1.8+git20231217.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 01/40] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 03/40] gnu: hurd: Update to 0.9.git20240714 Janneke Nieuwenhuizen
                     ` (38 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (mig): Update to 1.8+git20231217.

Change-Id: I0e531ecc7fdcfbefe2e0e24d7b2fb5e0fe8a3ae2
---
 gnu/packages/hurd.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index a22d0cadce..28f39cc448 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -92,7 +92,7 @@ (define-public gnumach-headers
 (define-public mig
   (package
     (name "mig")
-    (version "1.8+git20230520")
+    (version "1.8+git20231217")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -101,7 +101,7 @@ (define-public mig
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "10r0fdjqjzqsy6ajb21rifvhw0wpjvrw6a1zdyliqlzqny5k0qlz"))))
+                "1mx7w5vzw5ws0zplm1y6s679jb1g2hjkiwl3dlk5lxys0dxs5g4g"))))
     (build-system gnu-build-system)
     ;; Flex is needed both at build and run time.
     (inputs (list gnumach-headers flex))
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 03/40] gnu: hurd: Update to 0.9.git20240714.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 01/40] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 02/40] gnu: mig: Update to 1.8+git20231217 Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 04/40] gnu: gcc: Add indirections current-gcc, current-gcc-toolchain Janneke Nieuwenhuizen
                     ` (37 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (hurd-headers): Update to 0.9.git20240714.
(hurd)[arguments]: Remove rumpdisk build hack from "prepare-addons" stage.
Instead, when cross-compiling, add stage "fixup-cross-configure" to enable
rumpdisk.
* gnu/system.scm (hurd-multiboot-modules): Remove
"--x-xattr-translator-records" option that has been removed and is now the
default.

Change-Id: I4609b5a959c1ece98e2fe1aedbb1d31d6edadcca
---
 gnu/packages/hurd.scm | 12 +++++++++---
 gnu/system.scm        |  1 -
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 28f39cc448..06fae1bd3b 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -132,7 +132,7 @@ (define-public mig
 
 (define-public hurd-headers
   (let ((revision "3")
-        (commit "v0.9.git20231217"))
+        (commit "v0.9.git20240714"))
     (package
       (name "hurd-headers")
       (version (string-drop commit 1))
@@ -143,7 +143,7 @@ (define-public hurd-headers
                       (commit commit)))
                 (sha256
                  (base32
-                  "1d138kzhil6s5gf9di8grpz1iziakyfv037wkc8s7qyd61imm31d"))
+                  "0wvzil3llmrjg7ymwqs86d11bm5fl771jwncv7kk679lsvqca0ll"))
                 (file-name (git-file-name name version))))
       (build-system gnu-build-system)
       (native-inputs
@@ -336,7 +336,7 @@ (define-public hurd
              ;; Makefile. libdde_linux26 is built later in its own phase.
              (substitute* "Makefile"
                (("libbpf ")
-                "libbpf libmachdevdde libddekit rumpdisk"))))
+                "libbpf libmachdevdde libddekit "))))
          (add-after 'unpack 'find-tirpc
            (lambda* (#:key inputs #:allow-other-keys)
              (for-each (lambda (var)
@@ -362,6 +362,12 @@ (define-public hurd
                (("#include <rpc/pmap_prot.h>" m)
                 (string-append "#include <rpc/types.h>\n#include <rpc/xdr.h>\n" m)))
              #t))
+         ,@(if (%current-target-system)
+               '((add-after 'configure 'fixup-cross-configure
+                   (lambda _
+                     (substitute* "config.make"
+                       (("HAVE_LIBRUMP = no") "HAVE_LIBRUMP = yes")))))
+               '())
          (add-before 'build 'pre-build
            (lambda _
              ;; Don't change the ownership of any file at this time.
diff --git a/gnu/system.scm b/gnu/system.scm
index 074cd04a0e..dfcb8fb279 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1539,7 +1539,6 @@ (define (hurd-multiboot-modules os)
                 "--multiboot-command-line='${kernel-command-line}'"
                 "--exec-server-task='${exec-task}'"
                 "--store-type=typed"
-                "--x-xattr-translator-records"
                 "'${root}'"
                 "'$(fs-task=task-create)'"))
          (target (%current-target-system))
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 04/40] gnu: gcc: Add indirections current-gcc, current-gcc-toolchain.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (2 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 03/40] gnu: hurd: Update to 0.9.git20240714 Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-17 16:51     ` Ludovic Courtès
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 05/40] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
                     ` (36 subsequent siblings)
  40 siblings, 1 reply; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290
  Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Guillaume Le Vaillant, Katherine Cox-Buday, Ludovic Courtès,
	Munyoki Kilyungi, Sharlatan Hellseher, Simon Tournier,
	Vagrant Cascadian, jgart

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 52a077ecea..e188553910 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -1710,7 +1710,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 a499c5d9ee..02674577ed 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 1cfaaae1e7..70641267a8 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)))
@@ -2952,7 +2953,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)
@@ -3219,7 +3220,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")))
@@ -3542,8 +3543,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
@@ -3640,13 +3641,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 adae2f5bfc..80b9c6e03d 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 3ceeb4425a..5abca92ebf 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2340,8 +2340,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))
 
 \f
 ;;;
@@ -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 894e878cf2..244e85f17c 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 c6566a3339..1d4a7f5277 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 7459a6a02c..e13bf04277 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.
 ;;;
@@ -666,7 +667,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
@@ -738,7 +739,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





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 05/40] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (3 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 04/40] gnu: gcc: Add indirections current-gcc, current-gcc-toolchain Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-17 16:59     ` Ludovic Courtès
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 06/40] gnu: cross-libc: Support cross-building for the " Janneke Nieuwenhuizen
                     ` (35 subsequent siblings)
  40 siblings, 1 reply; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290
  Cc: Andreas Enge, Christopher Baines, Efraim Flashner, Ekaitz Zarraga,
	Josselin Poiret, Ludovic Courtès, Mathieu Othacehe,
	Simon Tournier, Tobias Geerinckx-Rice

* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Update comment on where
to find shared linker name.
(make-raw-bag): Also use raw-build-guile3 when building for the 64bit Hurd.
* guix/platforms/x86.scm (x86_64-gnu): New exported variable.
* guix/utils.scm (target-hurd64? system-hurd64?): New procedures.
* gnu/packages/gcc.scm: (current-gcc): Use target-hurd64? in new procedure to
select gcc-14 on 64bit Hurd.
(libstdc++): Change to procedure.
(libstdc++-headers): Update accordingly.
* gnu/packages/commencement.scm (current-gcc-toolchain): Likewise, to select
gcc-toolchain-14 on 64bit Hurd.
* gnu/packages/cross-base.scm (%xgcc): Use current-gcc.
(cross-kernel-headers*): Use target-hurd? instead of custom "i586..."
matching to also use xhurd-core-headers for target-hurd64.
* gnu/packages/make-bootstrap.scm (package-with-relocatable-glibc):
Capture (current-gcc) before resetting %current-target-system.
[native-inputs]:  Move final-inputs before cross-packages.
(%glibc-stripped): Likewise.
(%gcc-static): Change to procedure.
(%gcc-stripped): Likewise, update accordingly.
(%gcc-bootstrap-tarball): Likewise, update accordingly.
(make-guile-static)[arguments]: When building for the 64bit Hurd, add
"lt_cv_prog_compiler_static_works=yes" to #:configure-flags to convince
libtool to actually link guile statically.
(%binutils-static)[arguments]: When building for the 64bit Hurd, add
"lt_cv_prog_compiler_static_works=yes", "lt_cv_prog_compiler_static_works_CXX=yes"
to #:make-flags to convince to actually link the binaries statically.
* gnu/ci.scm (%core-packages): Update accordingly.
* gnu/packages/patches/gcc-14-cross-without-bootstrap.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/cross-base.scm (cross-gcc)[origin]: Use it when
cross-building gcc >= 14.

Change-Id: I4ae189e7e5188ced91744b89fe9d753b6a1fca78
---
 gnu/ci.scm                      |  4 +--
 gnu/packages/bootstrap.scm      |  3 +-
 gnu/packages/commencement.scm   |  6 ++--
 gnu/packages/cross-base.scm     |  6 ++--
 gnu/packages/gcc.scm            | 32 ++++++++++---------
 gnu/packages/make-bootstrap.scm | 56 ++++++++++++++++++++++-----------
 guix/platforms/x86.scm          | 11 ++++++-
 guix/utils.scm                  | 15 ++++++++-
 8 files changed, 90 insertions(+), 43 deletions(-)

diff --git a/gnu/ci.scm b/gnu/ci.scm
index 4e282d197f..e7e839d968 100644
--- a/gnu/ci.scm
+++ b/gnu/ci.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012-2024 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2017, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2017, 2020, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2018, 2019 Clément Lassieur <clement@lassieur.org>
 ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2020, 2021 Mathieu Othacehe <othacehe@gnu.org>
@@ -146,7 +146,7 @@ (define %core-packages
         %bootstrap-binaries-tarball
         %binutils-bootstrap-tarball
         (%glibc-bootstrap-tarball)
-        %gcc-bootstrap-tarball
+        (%gcc-bootstrap-tarball)
         %guile-bootstrap-tarball
         %bootstrap-tarballs))
 
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index c4640b62e1..234d001fc1 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -558,7 +558,8 @@ (define* (make-raw-bag name
     (name name)
     (system system)
     (build-inputs inputs)
-    (build (cond ((target-riscv64?)
+    (build (cond ((or (target-riscv64?)
+                      (target-hurd64?))
                   raw-build-guile3)
                  (else raw-build)))))
 
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 70641267a8..a000cbfdc5 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3643,10 +3643,12 @@ (define-public gcc-toolchain-14
 ;; The default GCC
 (define (current-gcc-toolchain)
   "The current default gcc-toolchain version."
-  gcc-toolchain-11)
+  (if (target-hurd64?)
+      gcc-toolchain-14
+      gcc-toolchain-11))
 
 (define-public gcc-toolchain
-  (deprecated-package "gcc-toolchain" gcc-toolchain-11))
+  (deprecated-package "gcc-toolchain" (current-gcc-toolchain)))
 
 (define-public gcc-toolchain-aka-gcc
   ;; It's natural for users to try "guix install gcc".  This package
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 9c701efae8..7b32a6b64e 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -641,9 +641,9 @@ (define* (cross-kernel-headers* target
                 ("hurd-headers" ,xhurd-headers)
                 ("hurd-minimal" ,xhurd-minimal)))))
 
-  (match target
-    ((or "i586-pc-gnu" "i586-gnu") xhurd-core-headers)
-    (_ xlinux-headers)))
+  (if (target-hurd? target)
+      xhurd-core-headers
+      xlinux-headers))
 
 (define* (cross-libc . args)
   (if (or (= (length args) 1) (contains-keyword? args))
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 3b5d05b9a9..fc3746fb05 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -861,10 +861,12 @@ (define-public gcc-14
 ;;       the gcc-toolchain-* definitions.
 (define (current-gcc)
   "The current default gcc version."
-  gcc-11)
+  (if (target-hurd64?)
+      gcc-14
+      gcc-11))
 
 (define-public gcc
-  (deprecated-package "gcc" gcc-11))
+  (deprecated-package "gcc" (current-gcc)))
 
 \f
 ;;;
@@ -903,15 +905,15 @@ (define-public gcc-2.95
     (outputs '("out"))
     (arguments
      (let ((matching-system
-             (match (%current-system)
-               ;; This package predates our 64-bit architectures.
-               ;; Force a 32-bit build targeting a similar architecture.
-               ("aarch64-linux"
-                "armhf-linux")
-               ("x86_64-linux"
-                "i686-linux")
-               (_
-                (%current-system)))))
+            (match (%current-system)
+              ;; This package predates our 64-bit architectures.
+              ;; Force a 32-bit build targeting a similar architecture.
+              ("aarch64-linux"
+               "armhf-linux")
+              ("x86_64-linux"
+               "i686-linux")
+              (_
+               (%current-system)))))
        (list #:system matching-system
              #:configure-flags #~'("--disable-werror")
 
@@ -1050,8 +1052,8 @@ (define-public (make-libstdc++ gcc)
     (propagated-inputs '())
     (synopsis "GNU C++ standard library")))
 
-(define libstdc++
-  ;; Libstdc++ matching the default GCC.
+(define (current-libstdc++)
+  ;; Libstdc++ matching the CURRENT-GCC.
   (make-libstdc++ (current-gcc)))
 
 (define libstdc++-headers
@@ -1061,7 +1063,7 @@ (define libstdc++-headers
   ;; is right under include/c++ and not under
   ;; include/c++/x86_64-unknown-linux-gnu (aka. GPLUSPLUS_TOOL_INCLUDE_DIR).
   (package
-    (inherit libstdc++)
+    (inherit (current-libstdc++))
     (name "libstdc++-headers")
     (outputs '("out"))
     (build-system trivial-build-system)
@@ -1072,7 +1074,7 @@ (define libstdc++-headers
                    (mkdir (string-append out "/include"))
                    (symlink (string-append libstdc++ "/include")
                             (string-append out "/include/c++")))))
-    (inputs `(("libstdc++" ,libstdc++)))
+    (inputs `(("libstdc++" ,(current-libstdc++))))
     (synopsis "Headers of GNU libstdc++")))
 
 (define-public libstdc++-4.9
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index c6293b9a38..f4165178fe 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -124,8 +124,11 @@ (define (package-with-relocatable-glibc p)
     (glibc-for-bootstrap
      ;; `cross-libc' already returns a cross libc, so clear
      ;; %CURRENT-TARGET-SYSTEM.
-     (parameterize ((%current-target-system #f))
-       (cross-libc target))))
+     (let ((xgcc (cross-gcc target #:xgcc (current-gcc))))
+       (parameterize ((%current-target-system #f))
+         (cross-libc target #:xgcc xgcc
+                     #:xheaders (cross-kernel-headers
+                                 target #:xgcc xgcc))))))
 
   ;; Standard inputs with the above libc and corresponding GCC.
 
@@ -145,7 +148,10 @@ (define (package-with-relocatable-glibc p)
                       target
                       #:xbinutils (cross-binutils target)
                       #:libc (cross-bootstrap-libc target))))
-          `(("cross-gcc" ,(package
+          `(,@(%final-inputs)
+            ;; As versions for gcc and cross-gcc can differ, make sure to have
+            ;; cross-gcc behind gcc in CPLUS_INCLUDE_PATH.
+            ("cross-gcc" ,(package
                             (inherit xgcc)
                             (search-paths
                              ;; Ensure the cross libc headers appears on the
@@ -154,8 +160,7 @@ (define (package-with-relocatable-glibc p)
                                     (variable "CROSS_CPLUS_INCLUDE_PATH")
                                     (files '("include")))
                                    (package-search-paths (current-gcc))))))
-            ("cross-binutils" ,(cross-binutils target))
-            ,@(%final-inputs)))
+            ("cross-binutils" ,(cross-binutils target))))
         `(("libc" ,(glibc-for-bootstrap glibc))
           ("libc:static" ,(glibc-for-bootstrap glibc) "static")
           ("gcc" ,(gcc-for-bootstrap glibc))
@@ -395,10 +400,15 @@ (define %binutils-static
                        ((#:configure-flags flags _ ...)
                         flags)))
            #:make-flags
-           (match (memq #:make-flags (package-arguments binutils))
-             ((#:make-flags flags _ ...)
-              flags)
-             (_ #~'()))
+           #~(append
+              #$(if (target-hurd64?)
+                    #~'("lt_cv_prog_compiler_static_works=yes"
+                        "lt_cv_prog_compiler_static_works_CXX=yes")
+                    #~'())
+              #$(match (memq #:make-flags (package-arguments binutils))
+                  ((#:make-flags flags _ ...)
+                   flags)
+                  (_ #~'())))
            #:strip-flags #~'("--strip-all")
            #:phases
            #~(modify-phases %standard-phases
@@ -446,7 +456,8 @@ (define (%glibc-stripped)
   ;; GNU libc's essential shared libraries, dynamic linker, and headers,
   ;; with all references to store directories stripped.  As a result,
   ;; libc.so is unusable and need to be patched for proper relocation.
-  (let ((glibc (glibc-for-bootstrap glibc)))
+  (let ((glibc (glibc-for-bootstrap glibc))
+        (gcc (current-gcc)))
     (package (inherit glibc)
       (name "glibc-stripped")
       (build-system trivial-build-system)
@@ -463,8 +474,13 @@ (define (%glibc-stripped)
        `(("libc" ,(let ((target (%current-target-system)))
                     (if target
                         (glibc-for-bootstrap
-                         (parameterize ((%current-target-system #f))
-                           (cross-libc target)))
+                         (let* ((xgcc (cross-gcc target #:xgcc gcc))
+                                (xheaders (cross-kernel-headers target
+                                                                #:xgcc xgcc)))
+                           (parameterize ((%current-target-system #f))
+                             (cross-libc target
+                                         #:xgcc xgcc
+                                         #:xheaders xheaders))))
                         glibc)))))
       (inputs
        `(("kernel-headers"
@@ -478,11 +494,12 @@ (define (%glibc-stripped)
       ;; Only one output.
       (outputs '("out")))))
 
-(define %gcc-static
+(define (%gcc-static)
   ;; A statically-linked GCC, with stripped-down functionality.
   (package-with-relocatable-glibc
    (package (inherit (current-gcc))
      (name "gcc-static")
+     (source (package-source (current-gcc)))
      (outputs '("out"))                           ; all in one
      (arguments
       (substitute-keyword-arguments (package-arguments (current-gcc))
@@ -552,7 +569,7 @@ (define %gcc-static
             ,@(package-native-inputs (current-gcc)))
           (package-native-inputs (current-gcc)))))))
 
-(define %gcc-stripped
+(define (%gcc-stripped)
   ;; The subset of GCC files needed for bootstrap.
   (package
     (inherit (current-gcc))
@@ -575,7 +592,7 @@ (define %gcc-stripped
                       (libdir     (string-append out "/lib"))
                       (includedir (string-append out "/include"))
                       (libexecdir (string-append out "/libexec"))
-                      (gcc        #$%gcc-static))
+                      (gcc        #$(%gcc-static)))
                  (copy-recursively (string-append gcc "/bin") bindir)
                  (for-each remove-store-references
                            (find-files bindir ".*"))
@@ -642,6 +659,9 @@ (define* (make-guile-static guile patches)
 
                   #$@(if (target-hurd?)
                          #~("--disable-jit")
+                         #~())
+                  #$@(if (target-hurd64?)
+                         #~("lt_cv_prog_compiler_static_works=yes")
                          #~())))
          ((#:phases phases '%standard-phases)
           #~(modify-phases #$phases
@@ -813,9 +833,9 @@ (define (%glibc-bootstrap-tarball)
   ;; A tarball with GNU libc's shared libraries, dynamic linker, and headers.
   (tarball-package (%glibc-stripped)))
 
-(define %gcc-bootstrap-tarball
+(define (%gcc-bootstrap-tarball)
   ;; A tarball with a dynamic-linked GCC and its headers.
-  (tarball-package %gcc-stripped))
+  (tarball-package (%gcc-stripped)))
 
 (define %guile-bootstrap-tarball
   ;; A tarball with the statically-linked, relocatable Guile.
@@ -856,7 +876,7 @@ (define %bootstrap-tarballs
            ((or "i686-linux" "x86_64-linux")
             (list %linux-libre-headers-bootstrap-tarball))
            (_
-            (list %gcc-bootstrap-tarball
+            (list (%gcc-bootstrap-tarball)
                   %binutils-bootstrap-tarball
                   (%glibc-bootstrap-tarball)
                   %bootstrap-binaries-tarball)))))
diff --git a/guix/platforms/x86.scm b/guix/platforms/x86.scm
index 0c8fc7296c..5617e6dd68 100644
--- a/guix/platforms/x86.scm
+++ b/guix/platforms/x86.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
 ;;; Copyright © 2023, 2024 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,7 +26,8 @@ (define-module (guix platforms x86)
             x86_64-linux-x32
             i686-mingw
             x86_64-mingw
-            i586-gnu))
+            i586-gnu
+            x86_64-gnu))
 
 (define i686-linux
   (platform
@@ -71,3 +73,10 @@ (define i586-gnu
    (system "i586-gnu")
    (rust-target "i686-unknown-hurd-gnu")
    (glibc-dynamic-linker "/lib/ld.so.1")))
+
+(define x86_64-gnu
+  (platform
+   (target "x86_64-pc-gnu")
+   (system "x86_64-gnu")
+   (rust-target "x86_64-unknown-hurd-gnu")
+   (glibc-dynamic-linker "/lib/ld-x86-64.so.1")))
diff --git a/guix/utils.scm b/guix/utils.scm
index f161cb4ef3..e100c03365 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -17,7 +17,7 @@
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
 ;;; Copyright © 2023 Philip McGrath <philip@philipmcgrath.com>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com>
 ;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
@@ -94,6 +94,8 @@ (define-module (guix utils)
             target-linux?
             target-hurd?
             system-hurd?
+            target-hurd64?
+            system-hurd64?
             target-mingw?
             target-x86-32?
             target-x86-64?
@@ -716,6 +718,17 @@ (define* (system-hurd?)
   "Is the current system the GNU(/Hurd) system?"
   (and=> (%current-system) target-hurd?))
 
+(define* (target-hurd64? #:optional (target (or (%current-target-system)
+                                                (%current-system))))
+  "Does TARGET represent the 64bit GNU(/Hurd) system?"
+  (and (target-hurd?)
+       (target-64bit? target)))
+
+(define* (system-hurd64?)
+  "Is the current system the 64bit GNU(/Hurd) system?"
+  (and (system-hurd?)
+       (target-64bit? (%current-system))))
+
 (define* (target-mingw? #:optional (target (%current-target-system)))
   "Is the operating system of TARGET Windows?"
   (and target
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 06/40] gnu: cross-libc: Support cross-building for the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (4 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 05/40] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 07/40] gnu: bash-minimal: Fix build for " Janneke Nieuwenhuizen
                     ` (34 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/base.scm (glibc)[arguments]: When building for the Hurd, in
phase "create-machine-symlink", do not assume CPU is i386, also cater for
x86_64.
* gnu/packages/cross-base.scm (cross-libc*)[arguments]: Likewise.

Change-Id: Ib009b7bd301b543b8629382330cca9d963b7a812
---
 gnu/packages/base.scm       | 18 ++++++++++++------
 gnu/packages/cross-base.scm | 17 +++++++++++------
 2 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 4e8121ae2c..02ef71f20d 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1079,7 +1079,7 @@ (define-public glibc
                                (string-append locale "/C.UTF-8")))))
 
                  ,@(if (target-hurd?)
-                       '((add-after 'install 'augment-libc.so
+                       `((add-after 'install 'augment-libc.so
                            (lambda* (#:key outputs #:allow-other-keys)
                              (let ((out (assoc-ref outputs "out")))
                                (substitute* (string-append out "/lib/libc.so")
@@ -1088,11 +1088,17 @@ (define-public glibc
                                                  " libmachuser.so libhurduser.so"))))))
                          (add-after 'install 'create-machine-symlink
                            (lambda* (#:key outputs #:allow-other-keys)
-                             (let ((out (assoc-ref outputs "out"))
-                                   (cpu "i386"))
-                               (symlink cpu
-                                        (string-append out
-                                                       "/include/mach/machine"))))))
+                             (let* ((out (assoc-ref outputs "out"))
+                                    (cpu ,(match (or (%current-target-system)
+                                                     (%current-system))
+                                            ((? target-x86-32?)
+                                             "i386")
+                                            ((? target-x86-64?)
+                                             "x86_64")))
+                                    (machine (string-append
+                                              out "/include/mach/machine")))
+                               (unless (file-exists? machine)
+                                 (symlink cpu machine))))))
                        '()))))
 
    (inputs `(("static-bash" ,static-bash)))
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 7b32a6b64e..3827e87aec 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -738,7 +738,7 @@ (define* (cross-libc* target
                (delete 'install-utf8-c-locale)
 
                ,@(if (target-hurd? target)
-                     '((add-after 'install 'augment-libc.so
+                     `((add-after 'install 'augment-libc.so
                          (lambda* (#:key outputs #:allow-other-keys)
                            (let ((out (assoc-ref outputs "out")))
                              (substitute* (string-append out "/lib/libc.so")
@@ -747,11 +747,16 @@ (define* (cross-libc* target
                                                " libmachuser.so libhurduser.so"))))))
                        (add-after 'install 'create-machine-symlink
                          (lambda* (#:key outputs #:allow-other-keys)
-                           (let ((out (assoc-ref outputs "out"))
-                                 (cpu "i386"))
-                             (symlink cpu
-                                      (string-append out
-                                                     "/include/mach/machine"))))))
+                           (let* ((out (assoc-ref outputs "out"))
+                                  (cpu ,(match target
+                                          ((? target-x86-32?)
+                                           "i386")
+                                          ((? target-x86-64?)
+                                           "x86_64")))
+                                  (machine (string-append
+                                            out "/include/mach/machine")))
+                             (unless (file-exists? machine)
+                               (symlink cpu machine))))))
                      '())))))
 
       ;; Shadow the native "kernel-headers" because glibc's recipe expects the
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 07/40] gnu: bash-minimal: Fix build for 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (5 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 06/40] gnu: cross-libc: Support cross-building for the " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 08/40] gnu: elfutils: " Janneke Nieuwenhuizen
                     ` (33 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/bash-minimal.scm (bash)[arguments]: When building with gcc >=
14 use "CFLAGS=-Wno-implicit-function-declaration".

Change-Id: I3fd2da7a1d9011b155084dceadbad649dbb2a1b9
---
 gnu/packages/bash.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index 93641a78d5..1a3b014ad7 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
 ;;; Copyright © 2021 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2024 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -30,6 +31,7 @@ (define-module (gnu packages bash)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bootstrap)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages readline)
@@ -251,6 +253,13 @@ (define-public bash-minimal
                ;; modules and related code.
                "ac_cv_func_dlopen=no"
 
+               ,@(if (version>=? (package-version (current-gcc)) "14")
+                     ;; gcc-14 implictly uses -Wimplicit-function-declaration
+                     ;; which together with -Werror causes:
+                     ;; ./enable.def:492:11: error: implicit declaration of function ‘dlclose’;
+                     '("CFLAGS=-Wno-implicit-function-declaration")
+                     '())
+
                ,@(if (%current-target-system)
                      '("bash_cv_job_control_missing=no"
                        "bash_cv_getcwd_malloc=yes")
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 08/40] gnu: elfutils: Fix build for 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (6 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 07/40] gnu: bash-minimal: Fix build for " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 09/40] gnu: grep: Fix build for the " Janneke Nieuwenhuizen
                     ` (32 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/elf.scm (elfutils)[arguments]: When building for a 64bit Hurd,
set #:make-flags.

Change-Id: I00abf360a7de5b1f78c1e912f0dcf27c62c1af68
---
 gnu/packages/elf.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm
index 119f8d13dd..81a753a483 100644
--- a/gnu/packages/elf.scm
+++ b/gnu/packages/elf.scm
@@ -10,7 +10,7 @@
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2021 Leo Le Bouter <lle-bout@zaclys.net>
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -86,6 +86,10 @@ (define-public elfutils
                                "--disable-libdebuginfod"
                                "--disable-debuginfod")
 
+       ,@(if (target-hurd64?)
+             '(#:make-flags '("core-file_no_Werror=yes"))
+             '())
+
        ;; Disable tests on MIPS and PowerPC (without changing
        ;; the arguments list on other systems).
        ,@(if (any (cute string-prefix? <> (or (%current-target-system)
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 09/40] gnu: grep: Fix build for the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (7 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 08/40] gnu: elfutils: " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 10/40] gnu: patch: " Janneke Nieuwenhuizen
                     ` (31 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/base.scm (grep)[arguments]: When building for the 64bit Hurd,
add patch-sigsegv.h stage.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/packages/base.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 02ef71f20d..010be631d7 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -154,6 +154,13 @@ (define-public grep
                                        (string-append bin "/fgrep"))
                       (("^exec grep")
                        (string-append "exec " bin "/grep"))))))
+              #$@(if (target-hurd64?)
+                     #~((add-after 'unpack 'patch-sigsegv
+                          (lambda _
+                            ;; Stack overflow recovery does not compile
+                            (substitute* "lib/sigsegv.in.h"
+                              (("__GNU__") "__XGNU__")))))
+                     #~())
               #$@(if (system-hurd?)
                      #~((add-before 'check 'skip-test
                           (lambda _
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 10/40] gnu: patch: Fix build for the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (8 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 09/40] gnu: grep: Fix build for the " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 11/40] gnu: libxcrypt: Support " Janneke Nieuwenhuizen
                     ` (30 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/base.scm (patch)[arguments]: When building for the 64bit Hurd,
set #:configure-flags.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/packages/base.scm | 49 ++++++++++++++++++++++++-------------------
 1 file changed, 28 insertions(+), 21 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 010be631d7..83f8c0d9e9 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -339,27 +339,34 @@ (define-public patch
                   "1bk38169c0xh01b0q0zmnrjqz8k9byz3arp4q7q66sn6xwf94nvz"))
                 (patches (search-patches "patch-hurd-path-max.patch"))))
       (arguments
-       (substitute-keyword-arguments (package-arguments base)
-         ((#:phases phases '%standard-phases)
-          #~(modify-phases #$phases
-              (add-after 'unpack 'copy-gnulib-sources
-                (lambda _
-                  ;; XXX: We copy the source instead of using 'gnulib' as a
-                  ;; native input to avoid introducing a dependency cycle.
-                  (copy-recursively #+gnulib "gnulib")
-                  (setenv "GNULIB_SRCDIR"
-                          (string-append (getcwd) "/gnulib/src/gnulib"))))
-              (add-after 'copy-gnulib-sources 'update-bootstrap-script
-                (lambda _
-                  (copy-file "gnulib/src/gnulib/build-aux/bootstrap"
-                             "bootstrap")))
-              (add-after 'unpack 'patch-configure.ac
-                (lambda _
-                  (substitute* "configure.ac"
-                    ;; The gnulib-provided git-version-gen script has a plain
-                    ;; shebang of #!/bin/sh; avoid using it.
-                    (("build-aux/git-version-gen" all)
-                     (string-append "sh " all)))))))))
+       (let ((arguments
+         (substitute-keyword-arguments (package-arguments base)
+           ((#:phases phases '%standard-phases)
+            #~(modify-phases #$phases
+                (add-after 'unpack 'copy-gnulib-sources
+                  (lambda _
+                    ;; XXX: We copy the source instead of using 'gnulib' as a
+                    ;; native input to avoid introducing a dependency cycle.
+                    (copy-recursively #+gnulib "gnulib")
+                    (setenv "GNULIB_SRCDIR"
+                            (string-append (getcwd) "/gnulib/src/gnulib"))))
+                (add-after 'copy-gnulib-sources 'update-bootstrap-script
+                  (lambda _
+                    (copy-file "gnulib/src/gnulib/build-aux/bootstrap"
+                               "bootstrap")))
+                (add-after 'unpack 'patch-configure.ac
+                  (lambda _
+                    (substitute* "configure.ac"
+                      ;; The gnulib-provided git-version-gen script has a plain
+                      ;; shebang of #!/bin/sh; avoid using it.
+                      (("build-aux/git-version-gen" all)
+                       (string-append "sh " all))))))))))
+         (if (target-hurd64?)
+             (substitute-keyword-arguments arguments
+               ((#:configure-flags flags '())
+                #~(list "--disable-threads"
+                        "gl_cv_func_working_mktime=yes")))
+             arguments)))
       (native-inputs (list autoconf automake bison ed))
       (properties '()))))
 
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 11/40] gnu: libxcrypt: Support the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (9 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 10/40] gnu: patch: " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 12/40] gnu: libstdc++: " Janneke Nieuwenhuizen
                     ` (29 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/libxcrypt-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/crypto.scm (libxcrypt)[arguments]: When building for the 64bit
Hurd, use it in new phase `apply-patch'.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/local.mk                                |  1 +
 gnu/packages/crypto.scm                     | 15 ++++++++
 gnu/packages/patches/libxcrypt-hurd64.patch | 38 +++++++++++++++++++++
 3 files changed, 54 insertions(+)
 create mode 100644 gnu/packages/patches/libxcrypt-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 2bd857e7ac..c952e090ec 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1727,6 +1727,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libvpx-CVE-2016-2818.patch		\
   %D%/packages/patches/libvpx-CVE-2023-5217.patch		\
   %D%/packages/patches/libvpx-CVE-2023-44488.patch		\
+  %D%/packages/patches/libxcrypt-hurd64.patch			\
   %D%/packages/patches/libxml2-xpath0-Add-option-xpath0.patch	\
   %D%/packages/patches/libwpd-gcc-compat.patch			\
   %D%/packages/patches/libxslt-generated-ids.patch		\
diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index 2a298c4caf..94a98bb0ad 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -27,6 +27,7 @@
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;; Copyright © 2023 Ivan Vilata-i-Balaguer <ivan@selidor.net>
 ;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1661,6 +1662,20 @@ (define-public libxcrypt
     (build-system gnu-build-system)
     (native-inputs
      (list perl))
+    (arguments
+     (if (target-hurd64?)
+         (list
+          #:phases
+          #~(modify-phases %standard-phases
+              (add-after 'unpack 'apply-patch
+                (lambda _
+                  (let ((patch-file
+                         #$(local-file
+                            (search-patch
+                             "libxcrypt-hurd64.patch"))))
+                    (invoke "patch" "--force" "-p1" "-i"
+                            patch-file))))))
+              '()))
     (synopsis
      "Extended crypt library for descrypt, md5crypt, bcrypt, and others")
     (description
diff --git a/gnu/packages/patches/libxcrypt-hurd64.patch b/gnu/packages/patches/libxcrypt-hurd64.patch
new file mode 100644
index 0000000000..9fc3018539
--- /dev/null
+++ b/gnu/packages/patches/libxcrypt-hurd64.patch
@@ -0,0 +1,38 @@
+Upstream-status: Taken from upstream:
+    <https://github.com/besser82/libxcrypt/commit/b2c1da2e1ce2d3e72f511f5bc94a6ffa68b70917>
+
+From b2c1da2e1ce2d3e72f511f5bc94a6ffa68b70917 Mon Sep 17 00:00:00 2001
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date: Sun, 14 Jul 2024 13:13:07 +0200
+Subject: [PATCH] Add binary compatibility for x86_64 GNU/Hurd
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+
+diff --git a/lib/libcrypt.map.in b/lib/libcrypt.map.in
+index 88ea911..a56b7bf 100644
+--- a/lib/libcrypt.map.in
++++ b/lib/libcrypt.map.in
+@@ -43,5 +43,5 @@ fcrypt			-		GLIBC_2.0
+ %chain GLIBC_2.0 GLIBC_2.2 GLIBC_2.2.1 GLIBC_2.2.2 GLIBC_2.2.5 GLIBC_2.2.6
+ %chain GLIBC_2.3 GLIBC_2.4 GLIBC_2.12 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18
+ %chain GLIBC_2.21 GLIBC_2.27 GLIBC_2.29 GLIBC_2.32 GLIBC_2.33 GLIBC_2.35
+-%chain GLIBC_2.36
++%chain GLIBC_2.36 GLIBC_2.38
+ %chain OW_CRYPT_1.0 XCRYPT_2.0 XCRYPT_4.3 XCRYPT_4.4
+diff --git a/lib/libcrypt.minver b/lib/libcrypt.minver
+index 8478077..c5a5bf2 100644
+--- a/lib/libcrypt.minver
++++ b/lib/libcrypt.minver
+@@ -51,6 +51,7 @@
+ #VERSION     SYSTEM          CPU_FAMILY    PREPROCESSOR_CHECK
+ 
+ # GNU Hurd
++GLIBC_2.38   gnu             x86_64
+ GLIBC_2.2.6  gnu             i[3-9]86
+ ERROR        gnu             .
+ 
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 12/40] gnu: libstdc++: Support the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (10 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 11/40] gnu: libxcrypt: Support " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 13/40] gnu: gcc-13, gcc-14: Support being used as parent for gcc-static Janneke Nieuwenhuizen
                     ` (28 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/gcc.scm (make-libstdc++)[arguments]: When building for the
64bit Hurd, add stage patch-hurd64.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/packages/gcc.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index fc3746fb05..850a14cb1c 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -1033,7 +1033,15 @@ (define-public (make-libstdc++ gcc)
                   (("/lib64") "/lib")))))
           (add-before 'configure 'chdir
             (lambda _
-              (chdir "libstdc++-v3"))))
+              (chdir "libstdc++-v3")))
+          #$@(let ((version (package-version gcc)))
+               (if (target-hurd64?)
+                   #~((add-after 'unpack 'patch-hurd64
+                        (lambda _
+                          (substitute* "libstdc++-v3/src/c++20/tzdb.cc"
+                            (("#if ! defined _GLIBCXX_ZONEINFO_DIR")
+                             "#if __GNU__ || ! defined _GLIBCXX_ZONEINFO_DIR")))))
+                   '())))
 
       #:configure-flags '`("--disable-libstdcxx-pch"
                            ,(string-append "--with-gxx-include-dir="
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 13/40] gnu: gcc-13, gcc-14: Support being used as parent for gcc-static.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (11 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 12/40] gnu: libstdc++: " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-17 16:49     ` Ludovic Courtès
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 14/40] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                     ` (27 subsequent siblings)
  40 siblings, 1 reply; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/gcc.scm (gcc-13)[arguments]: Use quasiquote instead of
g-expressions.
(gcc-14)[arguments]: Likewise.

Change-Id: I22269b31d49868effe967d46247b189ed9a9d394
---
 gnu/packages/gcc.scm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 850a14cb1c..befbbda027 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -811,10 +811,10 @@ (define-public gcc-13
               (snippet gcc-canadian-cross-objdump-snippet)))
     (arguments
      (substitute-keyword-arguments (package-arguments gcc-11)
-       ((#:phases phases #~%standard-phases)
+       ((#:phases phases '%standard-phases)
        (if (target-hurd?)
-           #~(modify-phases #$phases
-               (delete 'patch-hurd-libpthread))
+           `(modify-phases ,phases
+              (delete 'patch-hurd-libpthread))
            phases))))
     (properties
      `((compiler-cpu-architectures
@@ -841,8 +841,8 @@ (define-public gcc-14
               (modules '((guix build utils)))
               (snippet gcc-canadian-cross-objdump-snippet)))
     (arguments (substitute-keyword-arguments (package-arguments gcc-13)
-                 ((#:phases phases #~%standard-phases)
-                  #~(modify-phases #$phases
+                 ((#:phases phases '%standard-phases)
+                  `(modify-phases ,phases
                       (add-before 'configure 'pre-x86-configure
                         (lambda _
                           (substitute* "gcc/config/i386/t-linux64"
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 14/40] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (12 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 13/40] gnu: gcc-13, gcc-14: Support being used as parent for gcc-static Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-17 16:50     ` Ludovic Courtès
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 15/40] system: image: Add hurd64 image types Janneke Nieuwenhuizen
                     ` (26 subsequent siblings)
  40 siblings, 1 reply; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290
  Cc: Andreas Enge, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Maxim Cournoyer,
	Simon Tournier, Tobias Geerinckx-Rice

XXX TODO:

   v Boot a 64bit hurd, and
   o Guix build hello,
   o Push the commit below,
   o Re-check the bootstrap-tarballs build/hash,
   o Update this commit message with new commit hash,
   o Push it with remainder of hurd-team branch,
   o Update blog post.

On commit:
    b4c0b38776c048869626bed8aefd4efb042cea11
    gnu: gcc-13, gcc-14: Support being used as parent for gcc-static.

Run:
    ./pre-inst-env guix build --target=x86_64-gnu bootstrap-tarballs

Producing:
    /gnu/store/46ndf3vaic6cfk7a486saaa8xxnqfpxk-bootstrap-tarballs-0/

With guix hash -r:
    1w9sp8dhgpawf88qd89ykrgyrpfxr9qxxqwpbpd893rnn4cp16v2

* gnu/packages/bootstrap.scm (%bootstrap-executables): Add entries for
x86_64-gnu.
(%bootstrap-guile-hash, %bootstrap-coreutils&co, %bootstrap-binutils,
%bootstrap-glibc, %bootstrap-gcc): Add entry for x86_64-gnu.
* guix/packages.scm (%supported-systems, %hurd-systems): Add x86_64-gnu.
(%cuirass-supported-systems): Remove x86_64-gnu.
* guix/utils.scm (target-64bit?): Add x86_64-gnu.
* m4/guix.m4: Add x86_64-gnu as a supported system.
* doc/guix.texi (GNU Distribution): Add x86_64-gnu.

Change-Id: Id96715cee07572cd0635594d3b1aa6756fa8a822
---
 doc/guix.texi              |  9 ++++++++-
 gnu/packages/bootstrap.scm | 34 ++++++++++++++++++++++++++++++++++
 guix/packages.scm          |  8 +++++---
 m4/guix.m4                 | 12 +++++++++---
 4 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 8f65387e92..0f5e11a305 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -36,7 +36,7 @@
 Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Efraim Flashner@*
 Copyright @copyright{} 2016 John Darrington@*
 Copyright @copyright{} 2016, 2017 Nikita Gillmann@*
-Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Jan Nieuwenhuizen@*
+Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Janneke Nieuwenhuizen@*
 Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021 Julien Lepiller@*
 Copyright @copyright{} 2016 Alex ter Weele@*
 Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021 Christopher Baines@*
@@ -639,6 +639,13 @@ GNU Distribution
 (@pxref{transparent-emulation-qemu, @code{hurd-vm-service-type}}).
 @xref{Contributing}, on how to help!
 
+@item x86_64-gnu
+@uref{https://hurd.gnu.org, GNU/Hurd} on the @code{x86_64} Intel/AMD
+64-bit architecture.
+
+This configuration is even more experimental and under heavy upstream
+development.
+
 @item mips64el-linux (unsupported)
 little-endian 64-bit MIPS processors, specifically the Loongson series,
 n32 ABI, and Linux-Libre kernel.  This configuration is no longer fully
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 234d001fc1..3efb21eab3 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -125,6 +125,15 @@ (define %bootstrap-executables
       ,(base32 "0nq2c1zb3wv5bf7kd83sziaashydazrn7xgq6kijlk0zj2syzc2m"))
      ("xz"
       ,(base32 "033rhpk6zrpxpd6ffjyg5y2zwq9x9cnq0zljb7k8jlncbalsayq5")))
+    ("x86_64-gnu"
+     ("bash"
+      ,(base32 "1ib1kk1larki3dm46lhl756856zpjwhhlnzkgdyh9f1yf6wm431y"))
+     ("mkdir"
+      ,(base32 "15cnckq4qj1nlmgqy9vq3qa3kcbfm1pc2z38pscxix11j4aqswsm"))
+     ("tar"
+      ,(base32 "1m8v7ddmn42wym2kl9mf7csnwsw6c3jdglg7d7kp7yaa16h5fbck"))
+     ("xz"
+      ,(base32 "16cnr7vr0zawrwcnhshms3v5kyzb2vz1rp4kxmx507cs6rivd05b")))
     ("mips64el-linux"
      ("bash"
       ,(base32 "1aw046dhda240k9pb9iaj5aqkm23gkvxa9j82n4k7fk87nbrixw6"))
@@ -165,6 +174,7 @@ (define (bootstrap-executable-file-name system program)
   (match system
     ("powerpc64le-linux" (string-append system "/20210106/" program))
     ("i586-gnu" (string-append system "/20200326/" program))
+    ("x86_64-gnu" (string-append system "/20241112/" program))
     ("powerpc-linux" (string-append system "/20200923/bin/" program))
     ("riscv64-linux" (string-append system "/20210725/bin/" program))
     (_ (string-append system "/" program
@@ -366,6 +376,8 @@ (define (bootstrap-guile-url-path system)
                     "/20150101/guile-2.0.11.tar.xz")
                    ("i586-gnu"
                     "/20200326/guile-static-stripped-2.0.14-i586-pc-gnu.tar.xz")
+                   ("x86_64-gnu"
+                    "/20241112/guile-static-stripped-3.0.9-x86_64-pc-gnu.tar.xz")
                    ("powerpc64le-linux"
                     "/20210106/guile-static-stripped-2.0.14-powerpc64le-linux-gnu.tar.xz")
                    ("riscv64-linux"
@@ -390,6 +402,8 @@ (define (bootstrap-guile-hash system)
      (base32 "1giy2aprjmn5fp9c4s9r125fljw4wv6ixy5739i5bffw4jgr0f9r"))
     ("i586-gnu"
      (base32 "0wgqpsmvg25rnqn49ap7kwd2qxccd8dr4lllzp7i3rjvgav27vac"))
+    ("x86_64-gnu"
+     (base32 "06a26dd1r6svcxi6wk9xcdc8ldnxm0p51cnq1klghbc4djarmg6v"))
     ("powerpc-linux"
      (base32 "1by2p7s27fbyjzfkcw8h65h4kkqh7d23kv4sgg5jppjn2qx7swq4"))
     ("riscv64-linux"
@@ -599,6 +613,8 @@ (define %bootstrap-coreutils&co
                                              "/20210106/static-binaries-0-powerpc64le-linux-gnu.tar.xz")
                                             ("i586-gnu"
                                              "/20200326/static-binaries-0-i586-pc-gnu.tar.xz")
+                                            ("x86_64-gnu"
+                                             "/20241112/static-binaries-0-x86_64-pc-gnu.tar.xz")
                                             ("powerpc-linux"
                                              "/20200923/static-binaries.tar.xz")
                                             ("riscv64-linux"
@@ -626,6 +642,9 @@ (define %bootstrap-coreutils&co
                               ("i586-gnu"
                                (base32
                                 "17kllqnf3fg79gzy9ansgi801c46yh9c23h4d923plvb0nfm1cfn"))
+                              ("x86_64-gnu"
+                               (base32
+                                "118s161df8hgrdfph2w5spnrms02rh1dk7mzfvx1k1prvgngpm9p"))
                               ("powerpc-linux"
                                (base32
                                 "0kspxy0yczan2vlih6aa9hailr2inz000fqa0gn5x9d1fxxa5y8m"))
@@ -682,6 +701,8 @@ (define %bootstrap-binutils
                                              "/20210106/binutils-static-stripped-2.34-powerpc64le-linux-gnu.tar.xz")
                                             ("i586-gnu"
                                              "/20200326/binutils-static-stripped-2.34-i586-pc-gnu.tar.xz")
+                                            ("x86_64-gnu"
+                                             "/20241112/binutils-static-stripped-2.41-x86_64-pc-gnu.tar.xz")
                                             ("powerpc-linux"
                                              "/20200923/binutils-2.35.1.tar.xz")
                                             ("riscv64-linux"
@@ -712,6 +733,9 @@ (define %bootstrap-binutils
                               ("i586-gnu"
                                (base32
                                 "11kykv1kmqc5wln57rs4klaqa13hm952smkc57qcsyss21kfjprs"))
+                              ("x86_64-gnu"
+                               (base32
+                                "1nibcgqqkqvpqs9636an2ikiybz0mn6vqhl57hvfs6cxfylm5c5x"))
                               ("powerpc-linux"
                                (base32
                                 "0asbg1c4avkrvh057mx0942xwddd136jni382zqsxzn79ls42yq8"))
@@ -772,6 +796,8 @@ (define %bootstrap-glibc
                                        "/20210106/glibc-stripped-2.31-powerpc64le-linux-gnu.tar.xz")
                                       ("i586-gnu"
                                        "/20240816/glibc-stripped-2.39-i586-pc-gnu.tar.xz")
+                                      ("x86_64-gnu"
+                                       "/20241112/glibc-stripped-2.39-x86_64-pc-gnu.tar.xz")
                                       ("powerpc-linux"
                                        "/20200923/glibc-2.32.tar.xz")
                                       ("riscv64-linux"
@@ -802,6 +828,9 @@ (define %bootstrap-glibc
                         ("i586-gnu"
                          (base32
                           "0x2x6w611k6v9qdabacawamw2475p04hm3s0q95xcg063wjq4ig2"))
+                        ("x86_64-gnu"
+                         (base32
+                          "1dcgrnlxbsdic0xmmrjbr8gl6ra5y2xbj8f8jr6y0zvpdyi12ldd"))
                         ("powerpc-linux"
                          (base32
                           "0smmssyjrlk5cvx49586smmk81gkwff0i6r91n4rir4jm6ba25sb"))
@@ -878,6 +907,8 @@ (define %bootstrap-gcc
                                         "/20210106/gcc-stripped-5.5.0-powerpc64le-linux-gnu.tar.xz")
                                        ("i586-gnu"
                                         "/20200326/gcc-stripped-5.5.0-i586-pc-gnu.tar.xz")
+                                       ("x86_64-gnu"
+                                        "/20241112/gcc-stripped-14.2.0-x86_64-pc-gnu.tar.xz")
                                        ("powerpc-linux"
                                         "/20200923/gcc-5.5.0.tar.xz")
                                        ("riscv64-linux"
@@ -908,6 +939,9 @@ (define %bootstrap-gcc
                          ("i586-gnu"
                           (base32
                            "1j2zc58wzil71a34h7c70sd68dmqvcscrw3rmn2whq79vd70zvv5"))
+                         ("x86_64-gnu"
+                          (base32
+                           "0vqvjvw6xi16lihiqz4mhisfwx3dgs15y60q07ksdkgvi1wdli2w"))
                          ("powerpc-linux"
                           (base32
                            "1p7df3yixhm87dw5sccc6yn1i9db1r9hnmsg87wq5xi4rfmirq7w"))
diff --git a/guix/packages.scm b/guix/packages.scm
index f373136d22..403217d711 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -419,7 +420,7 @@ (define %32bit-supported-systems
 (define %64bit-supported-systems
   ;; This is the list of 64-bit system types that are supported.
   '("x86_64-linux" "mips64el-linux" "aarch64-linux" "powerpc64le-linux"
-    "riscv64-linux"))
+    "riscv64-linux" "x86_64-gnu"))
 
 (define %supported-systems
   ;; This is the list of system types that are supported.  By default, we
@@ -428,14 +429,15 @@ (define %supported-systems
 
 (define %hurd-systems
   ;; The GNU/Hurd systems for which support is being developed.
-  '("i586-gnu"))
+  '("i586-gnu" "x86_64-gnu"))
 
 (define %cuirass-supported-systems
   ;; This is the list of system types for which build machines are available.
   ;;
   ;; XXX: MIPS is unavailable in CI:
   ;; <https://lists.gnu.org/archive/html/guix-devel/2017-03/msg00790.html>.
-  (fold delete %supported-systems '("mips64el-linux" "powerpc-linux" "riscv64-linux")))
+  (fold delete %supported-systems '("mips64el-linux" "powerpc-linux"
+                                    "riscv64-linux" "x86_64-gnu")))
 
 (define (maybe-add-input-labels inputs)
   "Add labels to INPUTS unless it already has them."
diff --git a/m4/guix.m4 b/m4/guix.m4
index b93daba5c3..8c2757a8b7 100644
--- a/m4/guix.m4
+++ b/m4/guix.m4
@@ -3,6 +3,7 @@ dnl Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020, 2021 Ludovic Co
 dnl Copyright © 2014 Mark H Weaver <mhw@netris.org>
 dnl Copyright © 2017, 2020, 2021, 2023 Efraim Flashner <efraim@flashner.co.il>
 dnl Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
+dnl Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 dnl
 dnl This file is part of GNU Guix.
 dnl
@@ -61,8 +62,13 @@ AC_DEFUN([GUIX_SYSTEM_TYPE], [
        linux-musl*)
 	  guix_system="$machine_name-linux";;
        gnu*)
-          # Always use i586 for GNU/Hurd.
-          guix_system="i586-gnu";;
+          case "$machine_name" in
+            i386|i486|i586|i686)
+              # Always use i586 for 32bit GNU/Hurd.
+              guix_system="i586-gnu";;
+            *)
+	      guix_system="$machine_name-gnu";;
+          esac;;
        *)
 	  # Strip the version number from names such as `gnu0.3',
 	  # `darwin10.2.0', etc.
@@ -91,7 +97,7 @@ courageous and port the GNU System distribution to it (see
   # Currently only Linux-based systems are supported, and only on some
   # platforms.
   case "$guix_system" in
-    x86_64-linux|i686-linux|armhf-linux|aarch64-linux|powerpc64le-linux|riscv64-linux|i586-gnu)
+    x86_64-linux|i686-linux|armhf-linux|aarch64-linux|powerpc64le-linux|riscv64-linux|i586-gnu|x86_64-gnu)
       ;;
     mips64el-linux|powerpc-linux)
       AC_MSG_WARN([building Guix on `$guix_system', which is not supported])
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 15/40] system: image: Add hurd64 image types.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (13 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 14/40] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 16/40] gnu: Add libgpg-error-1.50 Janneke Nieuwenhuizen
                     ` (25 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/system/hurd.scm (%hurd64-default-operating-system-kernel,
%hurd64-default-operating-system): New variables.
* gnu/system/images/hurd.scm (hurd64-disk-image, hurd64-image-type,
hurd64-qcow2-image-type, hurd64-barebones-disk-image,
hurd64-barebones-qcow2-image): New variables.

* gnu/system/images/hurd.scm (hurd64-barebones-os): New variable.
---
 gnu/system/hurd.scm        | 17 +++++++++
 gnu/system/images/hurd.scm | 72 ++++++++++++++++++++++++++++++++++++--
 2 files changed, 87 insertions(+), 2 deletions(-)

diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 9a351529e8..6263d3de71 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)
@@ -51,6 +52,8 @@ (define-module (gnu system hurd)
             %desktop-services/hurd
             %hurd-default-operating-system
             %hurd-default-operating-system-kernel
+            %hurd64-default-operating-system
+            %hurd64-default-operating-system-kernel
             %setuid-programs/hurd))
 
 ;;; Commentary:
@@ -68,6 +71,14 @@ (define %hurd-default-operating-system-kernel
                         (%current-target-system #f))
         gnumach)))
 
+(define %hurd64-default-operating-system-kernel
+  (if (system-hurd?)
+      gnumach
+      ;; A cross-built GNUmach does not work
+      (with-parameters ((%current-system "x86_64-linux")
+                        (%current-target-system #f))
+        gnumach)))
+
 (define %base-packages/hurd
   ;; Note: the Shepherd comes before the Hurd, not just because its duty is to
   ;; shepherd the herd, but also because we want its 'halt' and 'reboot'
@@ -142,3 +153,9 @@ (define %hurd-default-operating-system
     (essential-services (hurd-default-essential-services this-operating-system))
     (privileged-programs '())
     (setuid-programs %setuid-programs/hurd)))
+
+(define %hurd64-default-operating-system
+  (operating-system
+    (inherit %hurd-default-operating-system)
+    (kernel %hurd64-default-operating-system-kernel)))
+
diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm
index 01c422a54f..67815aeb9b 100644
--- a/gnu/system/images/hurd.scm
+++ b/gnu/system/images/hurd.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,7 +36,14 @@ (define-module (gnu system images hurd)
             hurd-image-type
             hurd-qcow2-image-type
             hurd-barebones-disk-image
-            hurd-barebones-qcow2-image))
+            hurd-barebones-qcow2-image
+
+            hurd64-barebones-os
+            hurd64-disk-image
+            hurd6-image-type
+            hurd64-qcow2-image-type
+            hurd64-barebones-disk-image
+            hurd64-barebones-qcow2-image))
 
 (define hurd-barebones-os
   (operating-system
@@ -62,6 +69,30 @@ (define hurd-barebones-os
                               (password-authentication? #t)))
                     %base-services+qemu-networking/hurd))))
 
+(define hurd64-barebones-os
+  (operating-system
+    (inherit %hurd64-default-operating-system)
+    (bootloader (bootloader-configuration
+                 (bootloader grub-minimal-bootloader)
+                 (targets '("/dev/sdX"))))
+    (file-systems (cons (file-system
+                          (device (file-system-label "my-root"))
+                          (mount-point "/")
+                          (type "ext2"))
+                        %base-file-systems))
+    (host-name "guixygnu")
+    (timezone "Europe/Amsterdam")
+    (packages (cons openssh-sans-x %base-packages/hurd))
+    (services (cons (service openssh-service-type
+                             (openssh-configuration
+                              (openssh openssh-sans-x)
+                              (use-pam? #f)
+                              (port-number 2222)
+                              (permit-root-login #t)
+                              (allow-empty-passwords? #t)
+                              (password-authentication? #t)))
+                    %base-services+qemu-networking/hurd))))
+
 (define hurd-initialize-root-partition
   #~(lambda* (#:rest args)
       (apply initialize-root-partition
@@ -115,5 +146,42 @@ (define hurd-barebones-qcow2-image
                         #:type hurd-qcow2-image-type))
    (name 'hurd-barebones.qcow2)))
 
+\f
+;;;
+;;; 64bit Hurd
+;;;
+(define hurd64-disk-image
+  (image
+   (inherit hurd-disk-image)
+   (platform x86_64-gnu)))
+
+(define hurd64-image-type
+  (image-type
+   (name 'hurd64-raw)
+   (constructor (cut image-with-os hurd64-disk-image <>))))
+
+(define hurd64-qcow2-image-type
+  (image-type
+   (name 'hurd64-qcow2)
+   (constructor (lambda (os)
+                  (image
+                   (inherit hurd64-disk-image)
+                   (format 'compressed-qcow2)
+                   (operating-system os))))))
+
+(define hurd64-barebones-disk-image
+  (image
+   (inherit
+    (os+platform->image hurd64-barebones-os x86_64-gnu
+                        #:type hurd64-image-type))
+   (name 'hurd64-barebones-disk-image)))
+
+(define hurd64-barebones-qcow2-image
+  (image
+   (inherit
+    (os+platform->image hurd64-barebones-os x86_64-gnu
+                        #:type hurd64-qcow2-image-type))
+   (name 'hurd64-barebones.qcow2)))
+
 ;; Return the default image.
 hurd-barebones-qcow2-image
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 16/40] gnu: Add libgpg-error-1.50.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (14 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 15/40] system: image: Add hurd64 image types Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 17/40] gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd Janneke Nieuwenhuizen
                     ` (24 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/gnupg.scm (libgpg-error-1.50): New variable.

Change-Id: Ia34c0f339f331420d76b2c840205f29e511d1dcc
---
 gnu/packages/gnupg.scm | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index 2e97c2244a..a4863542f2 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -22,7 +22,7 @@
 ;;; Copyright © 2021 Nikita Domnitskii <nikita@domnitskii.me>
 ;;; Copyright © 2021 Aleksandr Vityazev <avityazev@posteo.org>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -164,6 +164,19 @@ (define-public libgpg-error
     (properties '((ftp-server . "ftp.gnupg.org")
                   (ftp-directory . "/gcrypt/libgpg-error")))))
 
+(define-public libgpg-error-1.50
+  (package
+    (inherit libgpg-error)
+    (version "1.50")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "mirror://gnupg/libgpg-error/libgpg-error-"
+                          version ".tar.bz2"))
+      (sha256
+       (base32
+        "02p2jgz95688ib28sl4aa624cj0liz73anwcl92f8cx6w14m6h39"))))))
+
 (define-public libgcrypt
   (package
     (name "libgcrypt")
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 17/40] gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (15 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 16/40] gnu: Add libgpg-error-1.50 Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-17 16:51     ` Ludovic Courtès
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 18/40] gnu: perl: Support cross-building " Janneke Nieuwenhuizen
                     ` (23 subsequent siblings)
  40 siblings, 1 reply; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/gnupg.scm (libgcrypt)[propagated-inputs]: When building for the
64bit Hurd, use libgcrypt-1.50.

Change-Id: I608d283a4a307527d5b09a81fa1a53cec5d6bb76
---
 gnu/packages/gnupg.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index a4863542f2..6c6efff026 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -190,7 +190,9 @@ (define-public libgcrypt
                "1pp9zyx02bzgzjzldxf0mx9kp3530xgaaqcz4n2cv100ddaaw57g"))))
     (build-system gnu-build-system)
     (propagated-inputs
-     `(("libgpg-error-host" ,libgpg-error)))
+     `(("libgpg-error-host" ,(if (target-hurd64?)
+                                 libgpg-error-1.50
+                                 libgpg-error))))
     (native-inputs
      ;; Needed here for the 'gpg-error' program.
      `(("libgpg-error-native" ,libgpg-error)))
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 18/40] gnu: perl: Support cross-building for the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (16 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 17/40] gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 19/40] gnu: openssl-3.0: Support " Janneke Nieuwenhuizen
                     ` (22 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/cross-base.scm (perl)[native-inputs]: When cross-building for
the 64bit Hurd, use perl-cross-1.6.

Change-Id: I4a77f51a6757ad4aed9bcca8f9bbbf2cbd162e15
---
 gnu/packages/perl.scm | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index faaac13bf1..2ea7c49419 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -248,14 +248,18 @@ (define-public perl
     (native-inputs
      (if (%current-target-system)
          `(("perl-cross"
-            ,(origin
-               (method git-fetch)
-               (uri (git-reference
-                     (url "https://github.com/arsv/perl-cross")
-                     (commit "1.4")))
-               (file-name (git-file-name "perl-cross" "1.4"))
-               (sha256
-                (base32 "1ydjvlhrk06ccyj4bm8by7xk90krsll2k380mc3x1mhfrc7r9gzy")))))
+            ,(let ((version (if (target-hurd64?) "1.6" "1.4"))
+                   (hash
+                    (if (target-hurd64?)
+                        "0s06lkx5b79r9cn6pm5p6d4jbdjq7wg7rjr75nw5xdhw1z3wnl2d"
+                        "1ydjvlhrk06ccyj4bm8by7xk90krsll2k380mc3x1mhfrc7r9gzy")))
+               (origin
+                 (method git-fetch)
+                 (uri (git-reference
+                       (url "https://github.com/arsv/perl-cross")
+                       (commit version)))
+                 (file-name (git-file-name "perl-cross" version))
+                 (sha256 (base32 hash))))))
          '()))
     (native-search-paths (list (search-path-specification
                                 (variable "PERL5LIB")
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 19/40] gnu: openssl-3.0: Support the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (17 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 18/40] gnu: perl: Support cross-building " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 20/40] gnu: pciutils: " Janneke Nieuwenhuizen
                     ` (21 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/openssl-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/tls.scm (openssl-3.0)[arguments]: When building for
the 64bit Hurd, use it in new "apply-hurd-patch" phase.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/local.mk                              |  1 +
 gnu/packages/patches/openssl-hurd64.patch | 99 +++++++++++++++++++++++
 gnu/packages/tls.scm                      |  9 +++
 3 files changed, 109 insertions(+)
 create mode 100644 gnu/packages/patches/openssl-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index c952e090ec..a7e5e903e3 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1893,6 +1893,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/opensles-add-license-file.patch			\
   %D%/packages/patches/openssl-1.1-c-rehash-in.patch		\
   %D%/packages/patches/openssl-3.0-c-rehash-in.patch		\
+  %D%/packages/patches/openssl-hurd64.patch			\
   %D%/packages/patches/opentaxsolver-file-browser-fix.patch     \
   %D%/packages/patches/open-zwave-hidapi.patch			\
   %D%/packages/patches/orangeduck-mpc-fix-pkg-config.patch	\
diff --git a/gnu/packages/patches/openssl-hurd64.patch b/gnu/packages/patches/openssl-hurd64.patch
new file mode 100644
index 0000000000..372fda834a
--- /dev/null
+++ b/gnu/packages/patches/openssl-hurd64.patch
@@ -0,0 +1,99 @@
+Upstream-status: Taken from upstream:
+
+<https://github.com/openssl/openssl/commit/7c729851d169f30d9e0c0ad6e7c1cf6cefb37935>.
+
+From 795699363be8f717e36802c3ac503011b74ad752 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Thu, 7 Nov 2024 14:08:05 +0100
+Subject: [PATCH] Add support for the 64bit Hurd.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+Taken from <https://salsa.debian.org/debian/openssl>.
+---
+ Configurations/10-main.conf | 45 ++++++++++++++++++++++++++++++++-----
+ util/perl/OpenSSL/config.pm |  3 ++-
+ 2 files changed, 41 insertions(+), 7 deletions(-)
+
+diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
+index b578a3c2a8..740460ebd3 100644
+--- a/Configurations/10-main.conf
++++ b/Configurations/10-main.conf
+@@ -1685,20 +1685,53 @@ my %targets = (
+     },
+ 
+ ##### GNU Hurd
+-    "hurd-x86" => {
++    "hurd-generic32" => {
+         inherit_from     => [ "BASE_unix" ],
+         CC               => "gcc",
+-        CFLAGS           => "-O3 -fomit-frame-pointer -Wall",
++        CXX              => "g++",
++        CFLAGS           => picker(default => "-Wall",
++                                   debug   => "-O0 -g",
++                                   release => "-O3"),
++        CXXFLAGS         => picker(default => "-Wall",
++                                   debug   => "-O0 -g",
++                                   release => "-O3"),
+         cflags           => threads("-pthread"),
+-        lib_cppflags     => "-DL_ENDIAN",
++        cxxflags         => combine("-std=c++11", threads("-pthread")),
+         ex_libs          => add("-ldl", threads("-pthread")),
+-        bn_ops           => "BN_LLONG",
+-        asm_arch         => 'x86',
+-        perlasm_scheme   => 'elf',
++        bn_ops           => "BN_LLONG RC4_CHAR",
+         thread_scheme    => "pthreads",
+         dso_scheme       => "dlfcn",
+         shared_target    => "linux-shared",
+         shared_cflag     => "-fPIC",
++        shared_ldflag    => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
++    },
++
++    "hurd-generic64" => {
++        inherit_from     => [ "hurd-generic32" ],
++        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
++    },
++
++    #### X86 / X86_64 targets
++    "hurd-x86" => {
++        inherit_from     => [ "hurd-generic32" ],
++        CFLAGS           => add(picker(release => "-fomit-frame-pointer")),
++        cflags           => add("-m32"),
++        cxxflags         => add("-m32"),
++        lib_cppflags     => add("-DL_ENDIAN"),
++        bn_ops           => "BN_LLONG",
++        asm_arch         => 'x86',
++        perlasm_scheme   => 'elf',
++    },
++
++    "hurd-x86_64" => {
++        inherit_from     => [ "hurd-generic64" ],
++        cflags           => add("-m64"),
++        cxxflags         => add("-m64"),
++        lib_cppflags     => add("-DL_ENDIAN"),
++        bn_ops           => "SIXTY_FOUR_BIT_LONG",
++        asm_arch         => 'x86_64',
++        perlasm_scheme   => 'elf',
++        multilib         => "64",
+     },
+ 
+ ##### VxWorks for various targets
+diff --git a/util/perl/OpenSSL/config.pm b/util/perl/OpenSSL/config.pm
+index 2f1edcafb6..707db71537 100755
+--- a/util/perl/OpenSSL/config.pm
++++ b/util/perl/OpenSSL/config.pm
+@@ -92,7 +92,8 @@ my $guess_patterns = [
+     [ 'IRIX64:.*',                  'mips4-sgi-irix64' ],
+     [ 'Linux:[2-9]\..*',            '${MACHINE}-whatever-linux2' ],
+     [ 'Linux:1\..*',                '${MACHINE}-whatever-linux1' ],
+-    [ 'GNU.*',                      'hurd-x86' ],
++    [ 'GNU:.*86-AT386',             'hurd-x86' ],
++    [ 'GNU:.*86_64-AT386',          'hurd-x86_64' ],
+     [ 'LynxOS:.*',                  '${MACHINE}-lynx-lynxos' ],
+     # BSD/OS always says 386
+     [ 'BSD\/OS:4\..*',              'i486-whatever-bsdi4' ],
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 43806e24da..fab88518ce 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -589,6 +589,15 @@ (define-public openssl-3.0
                                            "/bin/perl"))))
             #$@(if (target-hurd?)
                    #~((delete 'patch-configure))
+                   #~())
+            #$@(if (target-hurd64?)
+                   #~((add-after 'unpack 'apply-hurd-patch
+                        (lambda _
+                          (let ((patch-file
+                                 #$(local-file
+                                    (search-patch "openssl-hurd64.patch"))))
+                            (invoke "patch" "--force" "-p1" "-i"
+                                    patch-file)))))
                    #~())))
        ((#:configure-flags flags #~'())
         (if (system-hurd?)
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 20/40] gnu: pciutils: Support the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (18 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 19/40] gnu: openssl-3.0: Support " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 21/40] gnu: libpciaccess: " Janneke Nieuwenhuizen
                     ` (20 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/pciutils-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/pciutils.scm (pciutils)[arguments]: Use g-expressions.  When
building for the 64bit Hurd, use it in new "apply-hurd64-patch" phase.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/local.mk                               |  1 +
 gnu/packages/patches/pciutils-hurd64.patch | 31 ++++++++++++++++++++++
 gnu/packages/pciutils.scm                  | 25 +++++++++++------
 3 files changed, 49 insertions(+), 8 deletions(-)
 create mode 100644 gnu/packages/patches/pciutils-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index a7e5e903e3..34023909a1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1908,6 +1908,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/pam-krb5-CVE-2020-10595.patch		\
   %D%/packages/patches/pango-skip-libthai-test.patch		\
   %D%/packages/patches/password-store-tree-compat.patch		\
+  %D%/packages/patches/pciutils-hurd64.patch			\
   %D%/packages/patches/pdfpc-build-with-vala-0.56.patch         \
   %D%/packages/patches/petri-foo-0.1.87-fix-recent-file-not-exist.patch			\
   %D%/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch \
diff --git a/gnu/packages/patches/pciutils-hurd64.patch b/gnu/packages/patches/pciutils-hurd64.patch
new file mode 100644
index 0000000000..316f12e131
--- /dev/null
+++ b/gnu/packages/patches/pciutils-hurd64.patch
@@ -0,0 +1,31 @@
+Upstream-status: Not presented upstream.
+
+--- pciutils-3.8.0/lib/hurd.c.orig	2024-11-07 15:09:20.728973822 +0100
++++ pciutils-3.8.0/lib/hurd.c	2024-11-07 15:05:08.524682813 +0100
+@@ -213,7 +213,7 @@
+ hurd_read(struct pci_dev *d, int pos, byte * buf, int len)
+ {
+   int err;
+-  size_t nread;
++  mach_msg_type_number_t nread;
+   char *data;
+   mach_port_t device_port = device_port_lookup(d);
+ 
+@@ -266,7 +266,7 @@
+   mach_port_t device_port = device_port_lookup(d);
+   struct pci_bar regions[6];
+   char *buf = (char *) &regions;
+-  size_t size = sizeof(regions);
++  mach_msg_type_number_t size = sizeof(regions);
+ 
+   int err = pci_get_dev_regions(device_port, &buf, &size);
+   if (err)
+@@ -305,7 +305,7 @@
+   struct pci_xrom_bar rom;
+   mach_port_t device_port = device_port_lookup(d);
+   char *buf = (char *) &rom;
+-  size_t size = sizeof(rom);
++  mach_msg_type_number_t size = sizeof(rom);
+ 
+   int err = pci_get_dev_rom(device_port, &buf, &size);
+   if (err)
diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index d2a352eb6b..08f1634113 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2022 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
 ;;;
@@ -81,25 +81,34 @@ (define-public pciutils
                 "01aglgw9ds9qiswcbi2lx90lswncikrlyv8mmp4haix8542bvvci"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
          (add-after 'unpack 'unbundle-pci.ids
            (lambda* (#:key native-inputs inputs #:allow-other-keys)
              (copy-file (search-input-file (or native-inputs inputs)
                                            "share/hwdata/pci.ids")
                         "pci.ids")))
+         #$@(if (target-hurd64?)
+               #~((add-after 'unpack 'apply-hurd64-patch
+                    (lambda _
+                      (let ((patch-file
+                             #$(local-file
+                                (search-patch "pciutils-hurd64.patch"))))
+                        (invoke "patch" "--force" "-p1" "-i" patch-file)))))
+               #~())
          (replace 'configure
            (lambda* (#:key outputs #:allow-other-keys)
              ;; There's no 'configure' script, just a raw makefile.
              (substitute* "Makefile"
-               ,@(if (%current-target-system)
-                     `((("^CROSS_COMPILE=.*$")
+               #$@(if (%current-target-system)
+                     #~((("^CROSS_COMPILE=.*$")
                         (string-append "CROSS_COMPILE="
-                                       ,(%current-target-system) "-"
+                                       #$(%current-target-system) "-"
                                        "\n"))
                        (("^HOST=.*$")
                         (string-append "HOST="
-                                       ,(gnu-triplet->nix-system
+                                       #$(gnu-triplet->nix-system
                                          (%current-target-system)) "\n"))
                        ;; Disable 'install' strip option, that would fail when
                        ;; we are cross-compiling.
@@ -139,7 +148,7 @@ (define-public pciutils
              (invoke "make" "install" "install-lib"))))
 
        ;; Make sure programs have an RPATH so they can find libpciutils.so.
-       #:make-flags (list ,(string-append "CC="
+       #:make-flags #~(list #$(string-append "CC="
                                           (if (%current-target-system)
                                               (cc-for-target)
                                               "gcc"))
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 21/40] gnu: libpciaccess: Support the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (19 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 20/40] gnu: pciutils: " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 22/40] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df Janneke Nieuwenhuizen
                     ` (19 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/libpciaccess-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/xorg.scm (libpciaccess) [arguments]: Use g-expressions.  When
building for the 64bit Hurd, use it in new "apply-hurd64-patch" phase.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/local.mk                                  |  1 +
 .../patches/libpciaccess-hurd64.patch         | 58 +++++++++++++++++++
 gnu/packages/xorg.scm                         | 23 +++++---
 3 files changed, 75 insertions(+), 7 deletions(-)
 create mode 100644 gnu/packages/patches/libpciaccess-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 34023909a1..8c4f052b75 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1703,6 +1703,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libmpeg2-global-symbol-test.patch	\
   %D%/packages/patches/libmygpo-qt-fix-qt-5.11.patch		\
   %D%/packages/patches/libmygpo-qt-missing-qt5-modules.patch	\
+  %D%/packages/patches/libpciaccess-hurd64.patch		\
   %D%/packages/patches/libphonenumber-reproducible-build.patch	\
   %D%/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch	\
   %D%/packages/patches/libquicktime-ffmpeg.patch 		\
diff --git a/gnu/packages/patches/libpciaccess-hurd64.patch b/gnu/packages/patches/libpciaccess-hurd64.patch
new file mode 100644
index 0000000000..f7e11059b1
--- /dev/null
+++ b/gnu/packages/patches/libpciaccess-hurd64.patch
@@ -0,0 +1,58 @@
+Upstream-status: Taken from upstream:
+
+<https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/commit/6cd5a4afbb70868c7746de8d50dea59e02e9acf2>.
+
+From 6cd5a4afbb70868c7746de8d50dea59e02e9acf2 Mon Sep 17 00:00:00 2001
+From: Flavio Cruz <flaviocruz@gmail.com>
+Date: Wed, 28 Jun 2023 01:02:34 -0400
+Subject: [PATCH] Fix compilation warnings when building against hurd-amd64.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+Passes mach_msg_type_number_t instead of size_t which have different
+sizes. Example warning:
+
+/hurd_pci.c:101:53: warning: passing argument 3 of 'pci_get_dev_regions' from incompatible pointer type [-Wincompatible-pointer-types]
+  101 |     err = pci_get_dev_regions(d->device_port, &buf, &size);
+      |                                                     ^~~~~
+      |                                                     |
+      |                                                     size_t * {aka long unsigned int *}
+---
+ src/hurd_pci.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/hurd_pci.c b/src/hurd_pci.c
+index 8653e1b..9ac3813 100644
+--- a/src/hurd_pci.c
++++ b/src/hurd_pci.c
+@@ -82,7 +82,7 @@ pci_device_hurd_probe(struct pci_device *dev)
+     struct pci_bar regions[6];
+     struct pci_xrom_bar rom;
+     struct pci_device_private *d;
+-    size_t size;
++    mach_msg_type_number_t size;
+     char *buf;
+ 
+     /* Many of the fields were filled in during initial device enumeration.
+@@ -323,7 +323,7 @@ pciclient_cfg_read(mach_port_t device_port, int reg, char *buf,
+                    size_t * nbytes)
+ {
+     int err;
+-    size_t nread;
++    mach_msg_type_number_t nread;
+     char *data;
+ 
+     data = buf;
+@@ -473,7 +473,7 @@ simple_readdir(mach_port_t port, uint32_t *first_entry)
+ {
+     char *data;
+     int nentries = 0;
+-    vm_size_t size;
++    mach_msg_type_number_t size;
+ 
+     dir_readdir (port, &data, &size, *first_entry, 1, 0, &nentries);
+ 
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 0de08a4ad1..b106a604a7 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -36,7 +36,7 @@
 ;;; Copyright © 2021 Lu Hui <luhux76@gmail.com>
 ;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
 ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2023, 2024 John Kehayias <john.kehayias@protonmail.com>
 ;;; Copyright © 2023, 2024 Kaelyn Takata <kaelyn.alexi@protonmail.com>
 ;;;
@@ -1157,16 +1157,17 @@ (define-public libpciaccess
             "12glp4w1kgvmqn89lk19cgr6jccd3awxra4dxisp7pagi06rsk11"))))
     (build-system gnu-build-system)
     (arguments
-     '(;; Make sure libpciaccess can read compressed 'pci.ids' files as
-       ;; provided by pciutils.
-       #:configure-flags
-       (list "--with-zlib"
+     (list
+      ;; Make sure libpciaccess can read compressed 'pci.ids' files as
+      ;; provided by pciutils.
+      #:configure-flags
+      #~(list "--with-zlib"
              (string-append "--with-pciids-path="
                             (assoc-ref %build-inputs "pciutils")
                             "/share/hwdata"))
 
        #:phases
-       (modify-phases %standard-phases
+       #~(modify-phases %standard-phases
          (add-after 'install 'add-L-zlib
            (lambda* (#:key inputs outputs #:allow-other-keys)
              ;; Provide '-LZLIB/lib' next to '-lz' in the .la file.
@@ -1175,7 +1176,15 @@ (define-public libpciaccess
                (substitute* (string-append out "/lib/libpciaccess.la")
                  (("-lz")
                   (string-append "-L" zlib "/lib -lz")))
-               #t))))))
+               #t)))
+         #$@(if (target-hurd64?)
+                #~((add-after 'unpack 'apply-hurd64-patch
+                     (lambda _
+                       (let ((patch-file
+                              #$(local-file
+                                 (search-patch "libpciaccess-hurd64.patch"))))
+                         (invoke "patch" "--force" "-p1" "-i" patch-file)))))
+                #~()))))
     (inputs
      (list zlib pciutils))                   ;for 'pci.ids.gz'
     (native-inputs
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 22/40] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (20 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 21/40] gnu: libpciaccess: " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 23/40] gnu: netdde: Support the 64bit Hurd Janneke Nieuwenhuizen
                     ` (18 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (netdde): Update to
c0ef248dc7c5ccc1273e2a796f3ece30c5b645df.
(dde-sources): Update to b6c8526c703f3ba76294d9002f195c63897ec661.

Change-Id: Id03f5c5124f16e9ffd6a77cbb2507d274e0f325a
---
 gnu/packages/hurd.scm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 06fae1bd3b..f9d8b28b8c 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -294,7 +294,7 @@ (define unifont
 
 (define dde-sources
   ;; This is the current tip of the dde branch
-  (let ((commit "066797b576ebf8364ad157f50bef2a655597deeb"))
+  (let ((commit "b6c8526c703f3ba76294d9002f195c63897ec661"))
     (origin
       (method git-fetch)
       (uri (git-reference
@@ -302,7 +302,7 @@ (define dde-sources
             (commit commit)))
       (sha256
        (base32
-        "19f2awlfnar5gyhi0w5zawla5brzck2s88iv0f20022pd1l5v9hl"))
+        "0k1ilj8ghli8x43xaksbc4y419pqh0w16k374914c07svq419bbr"))
       (file-name (git-file-name "dde" (string-take commit 7))))))
 
 (define %import-from-dde
@@ -561,8 +561,8 @@ (define-public hurd
     (license gpl2+)))
 
 (define-public netdde
-  (let ((commit "e67c284ac113d939b10b4578334f27dab29d5b08")
-        (revision "2"))
+  (let ((commit "c0ef248dc7c5ccc1273e2a796f3ece30c5b645df")
+        (revision "3"))
     (package
       (name "netdde")
       ;; The version prefix corresponds to the version of Linux from which the
@@ -576,7 +576,7 @@ (define-public netdde
                 (patches (list (search-patch "netdde-build-fix.patch")))
                 (sha256
                  (base32
-                  "0vnkls7sr7srzib5mnw6gybzl5qa8c5a4zf3h08w6gdr7zqbndh0"))
+                  "070fpmd4nvn3mp8dj9w4if63iwz7j2m0h6ywq888znw70wlrc6sh"))
                 (file-name (git-file-name name commit))))
       (build-system gnu-build-system)
       (arguments
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 23/40] gnu: netdde: Support the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (21 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 22/40] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 24/40] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337 Janneke Nieuwenhuizen
                     ` (17 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/netdde-csum.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hurd.scm (netdde)[source]: Use it.
[arguments]: Do not assume x86, rather use actual ARCH in #:make-flags,
disable -Wstrict-prototypes and -Wint-conversion, and follow upstream's
"amd64" symlinking voodoo.

Change-Id: Ie825e56779dae2f489066569dc3c4405bac778c1
---
 gnu/local.mk                           |  1 +
 gnu/packages/hurd.scm                  | 22 ++++++++++++++++++++--
 gnu/packages/patches/netdde-csum.patch | 18 ++++++++++++++++++
 3 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/netdde-csum.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 8c4f052b75..073a95a556 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1818,6 +1818,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ncftp-reproducible.patch			\
   %D%/packages/patches/netcdf-date-time.patch			\
   %D%/packages/patches/netdde-build-fix.patch			\
+  %D%/packages/patches/netdde-csum.patch			\
   %D%/packages/patches/netpbm-CVE-2017-2586.patch		\
   %D%/packages/patches/netpbm-CVE-2017-2587.patch		\
   %D%/packages/patches/netsurf-message-timestamp.patch		\
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index f9d8b28b8c..973564ee33 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -573,7 +573,8 @@ (define-public netdde
                 (uri (git-reference
                       (url "https://git.savannah.gnu.org/git/hurd/incubator.git")
                       (commit commit)))
-                (patches (list (search-patch "netdde-build-fix.patch")))
+                (patches (search-patches "netdde-build-fix.patch"
+                                         "netdde-csum.patch"))
                 (sha256
                  (base32
                   "070fpmd4nvn3mp8dj9w4if63iwz7j2m0h6ywq888znw70wlrc6sh"))
@@ -586,7 +587,13 @@ (define-public netdde
                               (search-input-file %build-inputs "/bin/bash"))
                "PKGDIR=libdde_linux26"
                (string-append "CC=" ,(cc-for-target))
-               "ARCH=x86")
+               (let ((arch ,(match (or (%current-target-system)
+                                       (%current-system))
+                              ((? target-x86-32?)
+                               "x86")
+                              ((? target-x86-64?)
+                               "amd64"))))
+                 (string-append "ARCH=" arch)))
          #:configure-flags
          ,#~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
          #:phases
@@ -604,8 +611,19 @@ (define-public netdde
                  (("/bin/bash") (which "bash")))))
            (add-after 'patch-generated-file-shebangs 'build-libdde-linux26
              (lambda* (#:key make-flags #:allow-other-keys)
+               (when ,(target-hurd64?)
+                 (let ((dir "libdde_linux26/build/include"))
+                   (mkdir-p (string-append dir "/x86"))
+                   (format #t "symlink ~a -> ~a\n"
+                           (string-append dir "/x86/amd64") "x86")
+                   (symlink "x86" (string-append dir "/amd64"))
+                   (format #t "symlink ~a -> ~a\n"
+                           (string-append dir "/amd64/asm-x86_64") "asm-x86")
+                   (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64"))))
                (with-directory-excursion "libdde_linux26"
                  (apply invoke "make"
+                        (string-append "WARNINGS=-Wno-strict-prototypes"
+                                       " -Wno-int-conversion")
                         (delete "PKGDIR=libdde_linux26" make-flags)))))
            (add-after 'build-libdde-linux26 'convert
              (lambda* (#:key make-flags #:allow-other-keys)
diff --git a/gnu/packages/patches/netdde-csum.patch b/gnu/packages/patches/netdde-csum.patch
new file mode 100644
index 0000000000..4fdd004898
--- /dev/null
+++ b/gnu/packages/patches/netdde-csum.patch
@@ -0,0 +1,18 @@
+Upstream-status: Taken from debian.
+
+<https://salsa.debian.org/hurd-team/netdde/raw/master/debian/patches/csum>.
+
+---
+ linux/drivers/net/vmxnet3/vmxnet3_drv.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/linux/drivers/net/vmxnet3/vmxnet3_drv.c
++++ b/linux/drivers/net/vmxnet3/vmxnet3_drv.c
+@@ -25,6 +25,7 @@
+  */
+ 
+ #include "vmxnet3_int.h"
++#include <net/ip6_checksum.h>
+ 
+ char vmxnet3_driver_name[] = "vmxnet3";
+ #define VMXNET3_DRIVER_DESC "VMware vmxnet3 virtual NIC driver"
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 24/40] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (22 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 23/40] gnu: netdde: Support the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 25/40] gnu: rumpkernel: Support the 64bit Hurd Janneke Nieuwenhuizen
                     ` (16 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (rumpkernel): Update to
f1ffd6405f225336e595a0f99f01095ed7438337.
[arguments]: In stage "build", add "-Wno-error=sign-compare" to CWARNFLAGS.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/packages/hurd.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 973564ee33..b156fcea4c 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -665,8 +665,8 @@ (define-public netdde
       (license gpl2))))
 
 (define-public rumpkernel
-  (let ((commit "81043d42fabda9baed7ac9ca36e3f3f5ed11ba81")
-        (revision "3"))
+  (let ((commit "f1ffd6405f225336e595a0f99f01095ed7438337")
+        (revision "0"))
     (package
       (name "rumpkernel")
       (version (git-version "0-20211031" revision commit))
@@ -680,7 +680,7 @@ (define-public rumpkernel
                       (commit commit)))
                 (sha256
                  (base32
-                  "0fv0k52qqcg3nq9012hibgsamvsd7mnvn2ikdasmzjhsp8qh5q3r"))
+                  "1ygn3ysji06ik3k44sf906fjpdmabznkspw70llldbk2zkrcdw7i"))
                 (file-name (git-file-name name version))))
       (build-system gnu-build-system)
       (arguments
@@ -800,7 +800,8 @@ (define-public rumpkernel
                            " -Wno-error=stack-protector"
                            " -Wno-error=array-parameter"
                            " -Wno-error=array-bounds"
-                           " -Wno-error=stringop-overflow")
+                           " -Wno-error=stringop-overflow"
+                           " -Wno-error=sign-compare")
                      "-V" "LIBCRTBEGIN="
                      "-V" "LIBCRTEND="
                      "-V" "LIBCRT0="
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 25/40] gnu: rumpkernel: Support the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (23 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 24/40] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337 Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 26/40] gnu: hurd: Build fixes for " Janneke Nieuwenhuizen
                     ` (15 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (rumpkernel)[argument]: In stage "build", follow
Debian upstream to use -DPAE disable the DTRACE and ZFS builds.

Change-Id: I534da31eefb378c72b4896d64a51a73109e38aa6
---
 gnu/packages/hurd.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index b156fcea4c..d29ec22cd7 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -781,6 +781,9 @@ (define-public rumpkernel
                      "-V" "MKBINUTILS=no"
                      "-V" "MKGDB=no"
                      "-V" "MKGROFF=no"
+                     "-V" "MKDTRACE=no"
+                     "-V" "MKZFS=no"
+
                      "-V" (string-append "TOPRUMP=" toprump)
                      "-V" "BUILDRUMP_CPPFLAGS=-Wno-error=stringop-overread"
                      "-V" "RUMPUSER_EXTERNAL_DPLIBS=pthread"
@@ -791,7 +794,8 @@ (define-public rumpkernel
                            " -DRUMP_REGISTER_T=int"
                            " -DRUMPUSER_CONFIG=yes"
                            " -DNO_PCI_MSI_MSIX=yes"
-                           " -DNUSB_DMA=1")
+                           " -DNUSB_DMA=1"
+                           " -DPAE")
                      "-V" (string-append
                            "CWARNFLAGS="
                            " -Wno-error=maybe-uninitialized"
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 26/40] gnu: hurd: Build fixes for the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (24 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 25/40] gnu: rumpkernel: Support the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 27/40] gnu: git-minimal: Support " Janneke Nieuwenhuizen
                     ` (14 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/hurd-64bit.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hurd.scm (hurd)[source]: Use it.
[arguments]: When building for the 64bit Hurd, add "create-machine-symlink"
phase.  In phases "build-libdde-linux" and "install-goodies", do not assume
x86, rather use actual ARCH, disable -Wstrict-prototypes and -Wint-conversion,
and follow upstream's "amd64" symlinking voodoo.

Change-Id: If264a91b2433add13f9121c482f0abe67ae5f1e9
---
 gnu/local.mk                          |   1 +
 gnu/packages/hurd.scm                 | 115 +++++++++++++++++---------
 gnu/packages/patches/hurd-64bit.patch |  56 +++++++++++++
 3 files changed, 131 insertions(+), 41 deletions(-)
 create mode 100644 gnu/packages/patches/hurd-64bit.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 073a95a556..948fc4ba73 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1546,6 +1546,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/htslib-for-stringtie.patch		\
   %D%/packages/patches/hubbub-sort-entities.patch		\
   %D%/packages/patches/hueplusplus-mbedtls.patch		\
+  %D%/packages/patches/hurd-64bit.patch				\
   %D%/packages/patches/hurd-rumpdisk-no-hd.patch		\
   %D%/packages/patches/hurd-startup.patch			\
   %D%/packages/patches/hwloc-1-test-btrfs.patch			\
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index d29ec22cd7..7aed0ebe1d 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -317,7 +317,8 @@ (define-public hurd
     (source (origin
               (inherit (package-source hurd-headers))
               (patches (search-patches "hurd-rumpdisk-no-hd.patch"
-                                       "hurd-startup.patch"))))
+                                       "hurd-startup.patch"
+                                       "hurd-64bit.patch"))))
     (version (package-version hurd-headers))
     (arguments
      `(#:tests? #f                      ;no "check" target
@@ -467,48 +468,80 @@ (define-public hurd
                          (find-files (string-append out "/libexec")))
                #t)))
          (add-after 'build 'build-libdde-linux
-           (lambda* (#:key inputs native-inputs #:allow-other-keys)
-             (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
-                                    "/bin/make")
-                     ;; XXX There can be a race condition because subdirs
-                     ;; aren't interdependent targets in the Makefile.
-                     "-j1" "-C" "libdde_linux26"
-                     (string-append "SHELL="
-                                    (assoc-ref (or native-inputs inputs) "bash")
-                                    "/bin/bash")
-                     (string-append "CC="
-                                    ,(cc-for-target))
-                     "ARCH=x86")))
+          (lambda* (#:key inputs native-inputs #:allow-other-keys)
+            (let ((arch ,(match (or (%current-target-system)
+                                    (%current-system))
+                           ((? target-x86-32?)
+                            "x86")
+                           ((? target-x86-64?)
+                            "amd64"))))
+              (when ,(target-hurd64?)
+                (let ((dir "libdde_linux26/build/include"))
+                  (mkdir-p (string-append dir "/x86"))
+                  (format #t "symlink ~a -> ~a\n"
+                          (string-append dir "/x86/amd64") "x86")
+                  (symlink "x86" (string-append dir "/amd64"))
+                  (format #t "symlink ~a -> ~a\n"
+                          (string-append dir "/amd64/asm-x86_64") "asm-x86")
+                  (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64"))))
+              (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
+                                     "/bin/make")
+                      ;; XXX There can be a race condition because subdirs
+                      ;; aren't interdependent targets in the Makefile.
+                      "-j1" "-C" "libdde_linux26"
+                      (string-append "SHELL="
+                                     (assoc-ref (or native-inputs inputs) "bash")
+                                     "/bin/bash")
+                      (string-append "CC="
+                                     ,(cc-for-target))
+                      (string-append "WARNINGS=-Wno-int-conversion"
+                                     " -Wno-strict-prototypes")
+                      (string-append "ARCH=" arch)))))
          (add-after 'install 'install-goodies
-           (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
-             ;; Install additional goodies.
-             ;; TODO: Build & install *.msgids for rpctrace.
-             (let* ((out (assoc-ref outputs "out"))
-                    (datadir (string-append out "/share/hurd")))
-               ;; Install libdde_linux26.
-               (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
-                                      "/bin/make")
-                       "-C" "libdde_linux26" "install"
-                       (string-append "SHELL="
-                                      (assoc-ref (or native-inputs inputs) "bash")
-                                      "/bin/bash")
-                       (string-append "INSTALLDIR="
-                                      out
-                                      "/share/libdde_linux26/build/include")
-                       "ARCH=x86")
-               ;; Install the fancy UTF-8 motd.
-               (mkdir-p (string-append out "/etc"))
-               (copy-file "console/motd.UTF8"
-                          (string-append out "/etc/motd"))
+          (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
+            ;; Install additional goodies.
+            ;; TODO: Build & install *.msgids for rpctrace.
+            (let* ((out (assoc-ref outputs "out"))
+                   (datadir (string-append out "/share/hurd"))
+                   (arch ,(match (or (%current-target-system)
+                                     (%current-system))
+                            ((? target-x86-32?)
+                             "x86")
+                            ((? target-x86-64?)
+                             "amd64")))
+                   (dir (string-append out "/share/libdde_linux26/build/include")))
+              (mkdir-p dir)
+              (when ,(target-hurd64?)
+                (mkdir-p (string-append dir "/amd64"))
+                (format #t "symlink ~a -> ~a\n"
+                        (string-append dir "/amd64/asm-x86_64")
+                        "x86")
+                (symlink "x86" (string-append dir "/amd46")))
+              (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
+                                     "/bin/make")
+                      "-C" "libdde_linux26" "install"
+                      (string-append "SHELL="
+                                     (assoc-ref (or native-inputs inputs) "bash")
+                                     "/bin/bash")
+                      (string-append "INSTALLDIR=" dir)
+                      (string-append "ARCH=" arch))
+              (when ,(target-hurd64?)
+                (format #t "symlink ~a -> ~a\n"
+                        (string-append dir "/amd64/asm-x86_64")
+                        "asm-x86")
+                (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64")))
+              ;; Install the fancy UTF-8 motd.
+              (mkdir-p (string-append out "/etc"))
+              (copy-file "console/motd.UTF8"
+                         (string-append out "/etc/motd"))
 
-               ;; Install the BDF font for use by the console client.
-               (copy-file (assoc-ref inputs "unifont")
-                          "unifont.gz")
-               (invoke "gunzip" "unifont.gz")
-               (mkdir-p datadir)
-               (copy-file "unifont"
-                          (string-append datadir "/vga-system.bdf"))
-               #t))))
+              ;; Install the BDF font for use by the console client.
+              (copy-file (assoc-ref inputs "unifont")
+                         "unifont.gz")
+              (invoke "gunzip" "unifont.gz")
+              (mkdir-p datadir)
+              (copy-file "unifont"
+                         (string-append datadir "/vga-system.bdf"))))))
        #:configure-flags
        ,#~(list (string-append "LDFLAGS=-Wl,-rpath="
                                #$output "/lib")
diff --git a/gnu/packages/patches/hurd-64bit.patch b/gnu/packages/patches/hurd-64bit.patch
new file mode 100644
index 0000000000..643550ad68
--- /dev/null
+++ b/gnu/packages/patches/hurd-64bit.patch
@@ -0,0 +1,56 @@
+Upstream-status: Taken from upstream:
+    <https://git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=d494333e7607ea03819adcfb69d89f8248ec2044>.
+
+From d494333e7607ea03819adcfb69d89f8248ec2044 Mon Sep 17 00:00:00 2001
+From: Flavio Cruz <flaviocruz@gmail.com>
+Date: Sun, 21 Jul 2024 17:20:55 -0400
+Subject: [PATCH] nfsd: fix -Werror=incompatible-pointer-types issues for
+ x86_64
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+Message-ID: <3pmgbk2myx4phdb6wcso54solmybulrvbytols5md3nri2p2qp@xjmfmpvwjp6t>
+---
+ nfsd/cache.c | 2 +-
+ nfsd/ops.c   | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/nfsd/cache.c b/nfsd/cache.c
+index cd5524af..864739c0 100644
+--- a/nfsd/cache.c
++++ b/nfsd/cache.c
+@@ -387,7 +387,7 @@ create_cached_handle (int fs, struct cache_handle *credc, file_t userport)
+   struct cache_handle *c;
+   int hash;
+   char *bp = fhandle.array + sizeof (int);
+-  size_t handlelen = NFS2_FHSIZE - sizeof (int);
++  mach_msg_type_number_t handlelen = NFS2_FHSIZE - sizeof (int);
+   mach_port_t newport, ref;
+ 
+   /* Authenticate USERPORT so that we can call file_getfh on it.  */
+diff --git a/nfsd/ops.c b/nfsd/ops.c
+index 463a9c87..64e94b93 100644
+--- a/nfsd/ops.c
++++ b/nfsd/ops.c
+@@ -292,7 +292,7 @@ op_write (struct cache_handle *c,
+   off_t offset;
+   size_t count;
+   error_t err;
+-  mach_msg_type_number_t amt;
++  vm_size_t amt;
+   char *bp;
+   struct stat st;
+ 
+@@ -583,7 +583,7 @@ op_readdir (struct cache_handle *c,
+   error_t err;
+   char *buf;
+   struct dirent *dp;
+-  size_t bufsize;
++  mach_msg_type_number_t bufsize;
+   int nentries;
+   int i;
+   int *replystart;
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 27/40] gnu: git-minimal: Support the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (25 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 26/40] gnu: hurd: Build fixes for " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 28/40] gnu: inetutils: Fix build for " Janneke Nieuwenhuizen
                     ` (13 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/version-control.scm (git-minimal)[arguments]: When using gcc >=
14, use "-Wno-implicit-function-declaration" in #:make-flags.
Use target-hurd? instead of comparing with "i586-pc-gnu" in "use-host-uname_S"
phase.

Change-Id: Ib9836be8a1e389a82c8a89adf22aaeac0d85bd14
---
 gnu/packages/version-control.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index c892a83a98..325b7ca8d8 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -113,6 +113,7 @@ (define-module (gnu packages version-control)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gawk)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
@@ -296,7 +297,10 @@ (define-public git-minimal
               ;; By default 'make install' creates hard links for
               ;; things in 'libexec/git-core', which leads to huge
               ;; nars; see <https://bugs.gnu.org/21949>.
-              "NO_INSTALL_HARDLINKS=indeed")
+              "NO_INSTALL_HARDLINKS=indeed"
+              #$@(if (version>=? (package-version (current-gcc)) "14")
+                     #~("-Wno-implicit-function-declaration")
+                     #~()))
       #:phases
       #~(modify-phases %standard-phases
           #$@(if (%current-target-system)
@@ -305,7 +309,7 @@ (define-public git-minimal
                       (lambda _
                         (substitute* "config.mak.uname"
                           (("uname_S := .*" all)
-                           (if (equal? #$(%current-target-system) "i586-pc-gnu")
+                           (if #$(target-hurd?)
                                "uname_S := GNU\n"
                                all))))))
                  ;; We do not have a full bash when cross-compiling.
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 28/40] gnu: inetutils: Fix build for the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (26 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 27/40] gnu: git-minimal: Support " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 29/40] gnu: grub: " Janneke Nieuwenhuizen
                     ` (12 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290; +Cc: Ricardo Wurmus

* gnu/packages/patches/inetutils-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/admin.scm (inetutils)[arguments]: When building for the 64bit
Hurd, use it in new "apply-hurd64-patch" stage.

Change-Id: I780f6a92418b49e5fe0d23eb1c90e155216f1428
---
 gnu/local.mk                                |  1 +
 gnu/packages/admin.scm                      | 14 ++++-
 gnu/packages/patches/inetutils-hurd64.patch | 65 +++++++++++++++++++++
 3 files changed, 78 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/inetutils-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 948fc4ba73..0759555494 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1570,6 +1570,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/indent-CVE-2024-0911.patch	\
   %D%/packages/patches/instead-use-games-path.patch		\
   %D%/packages/patches/intltool-perl-compatibility.patch	\
+  %D%/packages/patches/inetutils-hurd64.patch			\
   %D%/packages/patches/irrlicht-use-system-libs.patch		\
   %D%/packages/patches/irrlicht-link-against-needed-libs.patch	\
   %D%/packages/patches/isl-0.11.1-aarch64-support.patch	\
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 9c765b51a9..311d613b68 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -31,7 +31,7 @@
 ;;; Copyright © 2019, 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2019, 2020, 2021 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
@@ -1044,7 +1044,17 @@ (define-public inetutils
                              "\\\""))
       ;; On some systems, 'libls.sh' may fail with an error such as:
       ;; "Failed to tell switch -a apart from -A".
-      #:parallel-tests? #f))
+      #:parallel-tests? #f
+      #:phases (if (target-hurd64?)
+                   #~(modify-phases %standard-phases
+                       (add-after 'unpack 'apply-hurd64-patch
+                         (lambda _
+                           (let ((patch
+                                  #$(local-file
+                                     (search-patch
+                                      "inetutils-hurd64.patch"))))
+                             (invoke "patch" "--force" "-p1" "-i" patch)))))
+                   #~%standard-phases)))
     (inputs
      (list coreutils
            shadow                     ;for login (used in telnetd and rlogind)
diff --git a/gnu/packages/patches/inetutils-hurd64.patch b/gnu/packages/patches/inetutils-hurd64.patch
new file mode 100644
index 0000000000..3fb238bcdc
--- /dev/null
+++ b/gnu/packages/patches/inetutils-hurd64.patch
@@ -0,0 +1,65 @@
+Upstream-status: Not presented upstream.
+
+From 0804e655a7abfd22dc3a053f03fab8f811405f84 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Fri, 8 Nov 2024 11:07:56 +0100
+Subject: [PATCH] ifconfig hurd: Build fix for the 64bit HUrd.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+* ifconfig/system/hurd.c (check_driving): Use mach_msg_type_number_t
+instead of size_t for file_get_fs_options.
+---
+ ifconfig/system/hurd.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/ifconfig/system/hurd.c b/ifconfig/system/hurd.c
+index 70b2ed27..86fe6375 100644
+--- a/ifconfig/system/hurd.c
++++ b/ifconfig/system/hurd.c
+@@ -47,7 +47,7 @@ check_driving (const char *name)
+   error_t err;
+ 
+   char *argz = 0, *new_argz = 0;
+-  size_t argz_len = 0;
++  mach_msg_type_number_t argz_len = 0;
+   char *entry = 0;
+   const char *socket = _SERVERS_SOCKET "/2";
+ 
+@@ -106,7 +106,9 @@ check_driving (const char *name)
+   new_argz = malloc (argz_len);
+   memcpy (new_argz, argz, argz_len);
+ 
+-  err = argz_insert (&new_argz, &argz_len, new_argz, name);
++  size_t new_argz_len = 0;
++
++  err = argz_insert (&new_argz, &new_argz_len, new_argz, name);
+   if (err)
+     {
+       error (0, err, "Could not prepend name %s to '%s' for %s", name,
+@@ -114,7 +116,7 @@ check_driving (const char *name)
+       goto out;
+     }
+ 
+-  err = argz_insert (&new_argz, &argz_len, new_argz, "-i");
++  err = argz_insert (&new_argz, &new_argz_len, new_argz, "-i");
+   if (err)
+     {
+       argz_stringify (new_argz, argz_len, ' ');
+@@ -122,10 +124,10 @@ check_driving (const char *name)
+       goto out;
+     }
+ 
+-  err = fsys_set_options (fsys, new_argz, argz_len, 1);
++  err = fsys_set_options (fsys, new_argz, new_argz_len, 1);
+   if (err)
+     {
+-      argz_stringify (new_argz, argz_len, ' ');
++      argz_stringify (new_argz, new_argz_len, ' ');
+       error (0, err, "Could not make pfinet %s drive %s with '%s'", socket,
+ 	     name, new_argz);
+       goto out;
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 29/40] gnu: grub: Fix build for the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (27 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 28/40] gnu: inetutils: Fix build for " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 30/40] gnu: guile-fibers: " Janneke Nieuwenhuizen
                     ` (11 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290; +Cc: Efraim Flashner, Vagrant Cascadian

* gnu/packages/patches/grub-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/bootloaders.scm (grub)[arguments]: When building for the 64bit
Hurd, use it in new "apply-hurd64-patch" stage.

Change-Id: I780f6a92418b49e5fe0d23eb1c90e155216f1428
---
 gnu/local.mk                           |  1 +
 gnu/packages/bootloaders.scm           |  8 +++++++
 gnu/packages/patches/grub-hurd64.patch | 32 ++++++++++++++++++++++++++
 3 files changed, 41 insertions(+)
 create mode 100644 gnu/packages/patches/grub-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 0759555494..2b8a8d7065 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1488,6 +1488,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gromacs-tinyxml2.patch			\
   %D%/packages/patches/groovy-add-exceptionutilsgenerator.patch	\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
+  %D%/packages/patches/grub-hurd64.patch			\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index e188553910..caec26edc7 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -192,6 +192,14 @@ (define-public grub
                        (setenv "BUILD_FREETYPE_CFLAGS"
                                (string-append "-I" freetype
                                               "/include/freetype2"))))))
+               #$@(if (target-hurd64?)
+                      #~((add-after 'unpack 'apply-hurd64-patch
+                           (lambda _
+                             (let ((patch
+                                    #$(local-file
+                                       (search-patch "grub-hurd64.patch"))))
+                               (invoke "patch" "--force" "-p1" "-i" patch)))))
+                      #~())
                (add-before 'check 'disable-flaky-test
                  (lambda _
                    ;; This test is unreliable. For more information, see:
diff --git a/gnu/packages/patches/grub-hurd64.patch b/gnu/packages/patches/grub-hurd64.patch
new file mode 100644
index 0000000000..d5acd99eb8
--- /dev/null
+++ b/gnu/packages/patches/grub-hurd64.patch
@@ -0,0 +1,32 @@
+Upstream-status: Not presented upstream.
+
+From a4eb7d1f2cbd02132a9f5512f1294182576d4653 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Fri, 8 Nov 2024 11:47:49 +0100
+Subject: [PATCH] osdep/hurd: Support the 64bit Hurd.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+* grub-core/osdep/hurd/getroot.c (grub_util_find_hurd_root_device):
+Use mach_msg_type_number_t instead of size_t.
+---
+ grub-core/osdep/hurd/getroot.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/grub-core/osdep/hurd/getroot.c b/grub-core/osdep/hurd/getroot.c
+index 0efefdab4..b849700e6 100644
+--- a/grub-core/osdep/hurd/getroot.c
++++ b/grub-core/osdep/hurd/getroot.c
+@@ -58,7 +58,7 @@ grub_util_find_hurd_root_device (const char *path)
+   file_t file;
+   error_t err;
+   char *argz = NULL, *name = NULL, *ret;
+-  size_t argz_len = 0;
++  mach_msg_type_number_t argz_len = 0;
+   int i;
+ 
+   file = file_name_lookup (path, 0, 0);
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 30/40] gnu: guile-fibers: Fix build for the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (28 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 29/40] gnu: grub: " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 31/40] gnu: m4: " Janneke Nieuwenhuizen
                     ` (10 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/guile-xyz.scm (guile-fibers)[arguments]: Also modify phases for
the 64bit Hurd.

Change-Id: I780f6a92418b49e5fe0d23eb1c90e155216f1428
---
 gnu/packages/guile-xyz.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index ea192c2c03..a874ab908d 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -855,7 +855,7 @@ (define-public guile-fibers
      (list #:make-flags
            #~(list "GUILE_AUTO_COMPILE=0")
            #:phases
-           (if (target-x86-64?)
+           (if (and (target-x86-64?) (not (target-hurd?)))
                #~%standard-phases
                #~(modify-phases %standard-phases
                    (add-before 'check 'disable-some-tests
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 31/40] gnu: m4: Fix build for the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (29 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 30/40] gnu: guile-fibers: " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 32/40] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714 Janneke Nieuwenhuizen
                     ` (9 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/base.scm (grep)[arguments]: When building for the 64bit Hurd,
add patch-sigsegv.h stage.

Change-Id: I82993ebde268867348893556a9476faa5c4e9453
---
 gnu/packages/m4.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/m4.scm b/gnu/packages/m4.scm
index 39b50b6800..081304db34 100644
--- a/gnu/packages/m4.scm
+++ b/gnu/packages/m4.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -64,6 +64,13 @@ (define-public m4
                       (("(^| )main *\\(.*" all)
                        (string-append all "{\n  exit (77);//"))))))
               '())
+        ,@(if (target-hurd64?)
+              '((add-after 'unpack 'patch-sigsegv
+                  (lambda _
+                    ;; Stack overflow recovery does not compile
+                    (substitute* "lib/sigsegv.in.h"
+                      (("__GNU__") "__XGNU__")))))
+              '())
         (add-after 'unpack 'configure-shell
           (lambda* (#:key native-inputs inputs #:allow-other-keys)
             (let ((/bin/sh (search-input-file (or native-inputs inputs)
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 32/40] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (30 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 31/40] gnu: m4: " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 33/40] gnu: commencement: mig-boot0: Update to 1.8+git20231217 Janneke Nieuwenhuizen
                     ` (8 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (gnumach-headers-boot0): Update to
1.8+git20240714.

Change-Id: If30d7b4a688070d70741173c97a60284ca8299ef
---
 gnu/packages/commencement.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index a000cbfdc5..a8d48fbb93 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2636,7 +2636,7 @@ (define gnumach-headers-boot0
    (package
      (inherit gnumach-headers)
      (name "gnumach-headers-boot0")
-     (version "1.8+git20230410")
+     (version "1.8+git20240714")
      (source
       (origin
         (inherit (package-source gnumach-headers))
@@ -2650,7 +2650,7 @@ (define gnumach-headers-boot0
                   "gnumach-" version ".tar.gz"))
             (sha256
              (base32
-              "1s09256g2ny46idrn8frzs7r51la9ni45bmglmswlsmz9ii7dpi4")))))))
+              "1bnw5vdbq91zjxklx23qvim40fb0yw1qdxhn9n37jdfypm6q3xir")))))))
      (native-inputs (list autoconf-boot0 automake-boot0 texinfo-boot0))
      (arguments
       (substitute-keyword-arguments (package-arguments gnumach-headers)
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 33/40] gnu: commencement: mig-boot0: Update to 1.8+git20231217..
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (31 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 32/40] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714 Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 34/40] gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714 Janneke Nieuwenhuizen
                     ` (7 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (mig-boot0): Update to 1.8+git20231217.

Change-Id: I591ff7cb84ac1e567d49f51eb40be19fa6b15f5b
---
 gnu/packages/commencement.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index a8d48fbb93..faa4c903e4 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2671,7 +2671,7 @@ (define mig-boot0
    (package
      (inherit mig)
      (name "mig-boot0")
-     (version "1.8+git20230520")
+     (version "1.8+git20231217")
      (source
       (origin
         (inherit (package-source mig))
@@ -2684,7 +2684,7 @@ (define mig-boot0
                   "mig-" version ".tar.gz"))
             (sha256
              (base32
-              "1l1vfm4wap5yxylv91wssgpy7fnq22wp3akgd5nv995kychfa9jy")))))))
+              "18vz3ifrhhlvrdmlv70h63wl0kh5w8jcpsjx9yscsw9yazm1lzs7")))))))
      (native-inputs (list autoconf-boot0 automake-boot0 bison-boot0 flex-boot0
                           gnumach-headers-boot0))
      (inputs (list flex-boot0 gnumach-headers-boot0))
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 34/40] gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (32 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 33/40] gnu: commencement: mig-boot0: Update to 1.8+git20231217 Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 35/40] gnu: commencement: libstdc++-boot0-gcc7: Replace by make-libstdc++-boot0 Janneke Nieuwenhuizen
                     ` (6 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (hurd-headers-boot0): Update to
0.9.git20240714.

Change-Id: Ib3edaa3adb9cfe4cb8c5a3af83cb2701ee9dda1b
---
 gnu/packages/commencement.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index faa4c903e4..aad3f523b5 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2700,7 +2700,7 @@ (define hurd-headers-boot0
    (package
      (inherit hurd-headers)
      (name "hurd-headers-boot0")
-     (version "0.9.git20230520")
+     (version "0.9.git20240714")
      (source
       (origin
         (inherit (package-source hurd-headers))
@@ -2713,7 +2713,7 @@ (define hurd-headers-boot0
                   "hurd-v" version ".tar.gz"))
             (sha256
              (base32
-              "0ybmx7bhy21zv1if2hfdspn13zn68vki1na72sw2jj87gj8przna")))))))
+              "0wcihffclwijjamx4cjbr8i92yg780538ipg2z208ahg96jjrmgq")))))))
      (native-inputs
       (list autoconf-boot0 automake-boot0 mig-boot0))
      (inputs '()))))
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 35/40] gnu: commencement: libstdc++-boot0-gcc7: Replace by make-libstdc++-boot0.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (33 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 34/40] gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714 Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 36/40] gnu: gettext: Fix cross-build shebangs Janneke Nieuwenhuizen
                     ` (5 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (libstdc++-boot0-gcc7): Change variable to...
(make-libstdc++-boot0): ...this new procedure and update accordingly.
(gcc-boot0): Update accordingly, and cater for x86_64-gnu.

Change-Id: Ib0bc84e4dab90b080e5a01e6ab932f8be456c656
---
 gnu/packages/commencement.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index aad3f523b5..b2558c0d54 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2274,9 +2274,9 @@ (define libstdc++-boot0
       (inputs (%boot0-inputs))
       (native-inputs '()))))
 
-(define libstdc++-boot0-gcc7
+(define (make-libstdc++-boot0 gcc)
   ;; GCC >= 7 is needed by architectures which use C++-14 features.
-  (let ((lib (make-libstdc++ gcc-7)))
+  (let ((lib (make-libstdc++ gcc)))
     (package
       (inherit lib)
       (source (bootstrap-origin (package-source lib)))
@@ -2447,7 +2447,8 @@ (define gcc-boot0
 
               ;; The libstdc++ that libcc1 links against.
               ("libstdc++" ,(match (%current-system)
-                                   ("riscv64-linux" libstdc++-boot0-gcc7)
+                                   ("riscv64-linux" (make-libstdc++-boot0 gcc-7))
+                                   ("x86_64-gnu" (make-libstdc++-boot0 gcc-14))
                                    (_ libstdc++-boot0)))
 
               ;; Call it differently so that the builder can check whether
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 36/40] gnu: gettext: Fix cross-build shebangs.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (34 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 35/40] gnu: commencement: libstdc++-boot0-gcc7: Replace by make-libstdc++-boot0 Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 37/40] gnu: texinfo-4: Fix build for the 64bit Hurd Janneke Nieuwenhuizen
                     ` (4 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

This fixes running autopoint from a cross-built gettext[-minimal].

* gnu/packages/gettext.scm (gettext-minimal): When cross-building, add stage
"patch-cross-shebangs".

Change-Id: I5029a3be0b5cee3c173de66d8f0b027b02c3bc47
---
 gnu/packages/gettext.scm | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm
index cabe4f3be9..7862c296bd 100644
--- a/gnu/packages/gettext.scm
+++ b/gnu/packages/gettext.scm
@@ -9,7 +9,7 @@
 ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Miguel <rosen644835@gmail.com>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020 EuAndreh <eu@euandre.org>
 ;;; Copyright © 2022, 2024 gemmaro <gemmaro.dev@gmail.com>
 ;;; Copyright © 2023 Maxim Cournoyer maxim.cournoyer@gmail.com>
@@ -130,7 +130,19 @@ (define-public gettext-minimal
                                    ((" test-tls\\$\\(EXEEXT\\) ") " ")))
                               '())
 
-                       #t)))))
+                       #t))))
+          #$@(if (%current-target-system)
+                 #~((add-after 'install 'patch-cross-shebangs
+                      (lambda _
+                        (let ((path (list (string-append #$bash-minimal "/bin"))))
+                          (define (patch-cross-shebang file)
+                            (patch-shebang file path))
+                          (with-directory-excursion
+                              (string-append #$output "/bin")
+                            (for-each
+                             patch-cross-shebang
+                             '("autopoint" "gettext.sh" "gettextize")))))))
+                 '()))
 
        ;; When tests fail, we want to know the details.
        #:make-flags #~'("VERBOSE=yes")))
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 37/40] gnu: texinfo-4: Fix build for the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (35 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 36/40] gnu: gettext: Fix cross-build shebangs Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 38/40] gnu: flex: " Janneke Nieuwenhuizen
                     ` (3 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/texinfo.scm (texinfo-4): When building for the 64bit Hurd, add
"-Wno-incompatible-pointer-types" to #:configure-flags.

Change-Id: Ia0503e3f5c7aa5354a949b69035a1be6f93ec85f
---
 gnu/packages/texinfo.scm | 50 ++++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/texinfo.scm b/gnu/packages/texinfo.scm
index 81afdaf7a7..c0a35b6ffa 100644
--- a/gnu/packages/texinfo.scm
+++ b/gnu/packages/texinfo.scm
@@ -7,7 +7,7 @@
 ;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
 ;;; Copyright © 2019, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2022 ( <paren@disroot.org>
 ;;;
@@ -165,31 +165,35 @@ (define-public texinfo-4
       (modify-inputs (package-native-inputs texinfo)
         (prepend automake)))
     (arguments
-     (substitute-keyword-arguments (package-arguments texinfo)
-       ((#:phases phases)
-        `(modify-phases ,phases
-           (add-after 'unpack 'fix-configure
-             (lambda* (#:key inputs native-inputs #:allow-other-keys)
-               ;; Replace outdated config.sub and config.guess.
-               (with-directory-excursion "build-aux"
-                 (for-each
-                  (lambda (file)
-                    (install-file (string-append
-                                   (assoc-ref
-                                    (or native-inputs inputs) "automake")
-                                   "/share/automake-"
-                                   ,(version-major+minor
-                                     (package-version automake))
-                                   "/" file) "."))
-                  '("config.sub" "config.guess")))
-               #t))
-           ;; Build native version of tools before running 'build phase.
-           ,@(if (%current-target-system)
-                 `((add-before 'build 'make-native-gnu-lib
+     (append
+      (substitute-keyword-arguments (package-arguments texinfo)
+        ((#:phases phases)
+         `(modify-phases ,phases
+            (add-after 'unpack 'fix-configure
+              (lambda* (#:key inputs native-inputs #:allow-other-keys)
+                ;; Replace outdated config.sub and config.guess.
+                (with-directory-excursion "build-aux"
+                  (for-each
+                   (lambda (file)
+                     (install-file (string-append
+                                    (assoc-ref
+                                     (or native-inputs inputs) "automake")
+                                    "/share/automake-"
+                                    ,(version-major+minor
+                                      (package-version automake))
+                                    "/" file) "."))
+                   '("config.sub" "config.guess")))
+                #t))
+            ;; Build native version of tools before running 'build phase.
+            ,@(if (%current-target-system)
+                  `((add-before 'build 'make-native-gnu-lib
                       (lambda* (#:key inputs #:allow-other-keys)
                         (invoke "make" "-C" "tools/gnulib/lib")
                         #t)))
-                 '())))))))
+                  '()))))
+      (if (target-hurd64?)
+          (list #:configure-flags ''("CFLAGS=-Wno-incompatible-pointer-types"))
+          '())))))
 
 (define-public info-reader
   ;; The idea of this package is to have the standalone Info reader without
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 38/40] gnu: flex: Fix build for the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (36 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 37/40] gnu: texinfo-4: Fix build for the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 39/40] system: examples: Add bare-hurd64.tmpl Janneke Nieuwenhuizen
                     ` (2 subsequent siblings)
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/packages/flex.scm (flex): When building for the 64bit Hurd, add
"-Wno-int-conversion "-Wno-implicit-function-declaration" to #:configure-flags.

Change-Id: Ia0503e3f5c7aa5354a949b69035a1be6f93ec85f
---
 gnu/packages/flex.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/flex.scm b/gnu/packages/flex.scm
index 7972675971..cf2dfe9ec9 100644
--- a/gnu/packages/flex.scm
+++ b/gnu/packages/flex.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,6 +23,7 @@ (define-module (gnu packages flex)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix gexp)
   #:use-module (guix utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages m4)
@@ -53,6 +55,12 @@ (define-public flex
                  ((#:tests? _ #f) #f)))
               (inputs (alist-delete "flex" (package-inputs bison))))))
        `(("bison" ,bison-for-tests))))
+    (arguments
+     (if (target-hurd64?)
+         (list #:configure-flags
+               #~'(#$(string-append "CFLAGS=-Wno-int-conversion"
+                                    " -Wno-implicit-function-declaration")))
+         '()))
     ;; m4 is not present in PATH when cross-building
     (native-inputs
      (list help2man m4))
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 39/40] system: examples: Add bare-hurd64.tmpl.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (37 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 38/40] gnu: flex: " Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 40/40] system: examples: Add devel-hurd64.tmpl Janneke Nieuwenhuizen
  2024-11-17 17:03   ` [bug#74290] [PATCH v2 00/40] Add support for x86_64-gnu, aka the 64bit Hurd Ludovic Courtès
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

* gnu/system/examples/bare-hurd.tmpl: Update comments.
* gnu/system/examples/bare-hurd64.tmpl: New file.

Change-Id: I8d26afd19afaa8fb3558948b50b0efdc0f83f29c
---
 gnu/system/examples/bare-hurd.tmpl   | 21 +++++----
 gnu/system/examples/bare-hurd64.tmpl | 70 ++++++++++++++++++++++++++++
 2 files changed, 82 insertions(+), 9 deletions(-)
 create mode 100644 gnu/system/examples/bare-hurd64.tmpl

diff --git a/gnu/system/examples/bare-hurd.tmpl b/gnu/system/examples/bare-hurd.tmpl
index 68c6d3c166..9bfa776769 100644
--- a/gnu/system/examples/bare-hurd.tmpl
+++ b/gnu/system/examples/bare-hurd.tmpl
@@ -3,23 +3,26 @@
 ;; This is an operating system configuration template
 ;; for a "bare bones" QEMU setup, with no X11 display server.
 
-;; To build a disk image for a virtual machine, do
+;; To build a disk image for a virtual machine, do:
 ;;
-;;     ./pre-inst-env guix system image --image-type=hurd-raw \
+;;     ./pre-inst-env guix system image --image-type=hurd-qcow2 \
 ;;         gnu/system/examples/bare-hurd.tmpl
 ;;
-;; You may run it like so
+;; You may run it like so:
 ;;
-;;     guix shell qemu -- qemu-system-i386 -enable-kvm -m 2048 \
-;;      -device rtl8139,netdev=net0 -netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222 \
-;;      -snapshot -hda <the-image>
+;;     guix shell qemu -- qemu-system-i386 -m 2048                \
+;;       --enable-kvm                                             \
+;;       --device e1000,netdev=net0                               \
+;;       --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222  \
+;;       --snapshot
+;;       --hda /gnu/store/...-disk-image
 ;;
-;; and use it like
+;; and use it like:
 ;;
 ;;     ssh -p 10022 root@localhost
 ;;     guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
 ;;
-;; or even (if you use --image-size=3G)
+;; or even, if you build the image with at least --image-size=3G:
 ;;
 ;;     guix build hello
 
@@ -34,7 +37,7 @@
                  (bootloader grub-minimal-bootloader)
                  (targets '("/dev/sdX"))))
     (file-systems (cons (file-system
-                          (device (file-system-label "my-root"))
+                          (device (file-system-label "hurd"))
                           (mount-point "/")
                           (type "ext2"))
                         %base-file-systems))
diff --git a/gnu/system/examples/bare-hurd64.tmpl b/gnu/system/examples/bare-hurd64.tmpl
new file mode 100644
index 0000000000..89811e458a
--- /dev/null
+++ b/gnu/system/examples/bare-hurd64.tmpl
@@ -0,0 +1,70 @@
+;; -*-scheme-*-
+
+;; This is an operating system configuration template
+;; for a "bare bones" QEMU setup, with no X11 display server.
+
+;; To build a disk image for a virtual machine, do:
+;;
+;;     ./pre-inst-env guix system image --image-type=hurd64-qcow2 \
+;;         gnu/system/examples/bare-hurd64.tmpl
+;;
+;; You may run it like so:
+;;
+;;     guix shell qemu@7 -- qemu-system-x86_64 -m 2048            \
+;;       --machine q35                                            \
+;;       --enable-kvm                                             \
+;;       --device e1000,netdev=net0                               \
+;;       --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222  \
+;;       --snapshot
+;;       --hda /gnu/store/...-disk-image
+;;
+;; and use it like:
+;;
+;;     ssh -p 10022 root@localhost
+;;     guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
+;;
+;; or even, if you build the image with at least --image-size=3G:
+;;
+;;     guix build hello
+
+(use-modules (gnu) (gnu system hurd) (guix utils))
+(use-service-modules ssh)
+(use-package-modules ssh)
+
+(define %hurd64-os
+  (operating-system
+    (inherit %hurd64-default-operating-system)
+    (bootloader (bootloader-configuration
+                 (bootloader grub-minimal-bootloader)
+                 (targets '("/dev/sdX"))))
+    (kernel-arguments '("noide")) ;use rumpdisk
+    (file-systems (cons (file-system
+                          (device (file-system-label "hurd"))
+                          (mount-point "/")
+                          (type "ext2"))
+                        %base-file-systems))
+    (host-name "guixygnu64")
+    (timezone "Europe/Amsterdam")
+    (users (cons (user-account
+                  (name "guix")
+                  (comment "Anonymous Hurd Hacker")
+                  (group "users")
+                  (supplementary-groups '("wheel")))
+                 %base-user-accounts))
+    (packages (cons openssh-sans-x %base-packages/hurd))
+    (services (cons (service openssh-service-type
+                             (openssh-configuration
+                              (openssh openssh-sans-x)
+                              (port-number 2222)
+                              (permit-root-login #t)
+                              (allow-empty-passwords? #t)
+                              (password-authentication? #t)))
+                    ;; For installing on a real (non-QEMU) machine, use:
+                    ;; (static-networking-service-type
+                    ;;   (list %loopback-static-networking
+                    ;;        (static-networking
+                    ;;         ...)))
+                    ;; %base-services/hurd
+                    %base-services+qemu-networking/hurd))))
+
+%hurd64-os
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 40/40] system: examples: Add devel-hurd64.tmpl.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (38 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 39/40] system: examples: Add bare-hurd64.tmpl Janneke Nieuwenhuizen
@ 2024-11-12 16:25   ` Janneke Nieuwenhuizen
  2024-11-17 17:03   ` [bug#74290] [PATCH v2 00/40] Add support for x86_64-gnu, aka the 64bit Hurd Ludovic Courtès
  40 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-12 16:25 UTC (permalink / raw)
  To: 74290

This also updates comments and removes the comment about a very old
`bootstrap-profile' hack.

* gnu/system/examples/devel-hurd.tmpl (hurd-packages): New variable
(%hurd-devel-os): Use it.
* gnu/system/examples/devel-hurd64.tmpl: New file.

Change-Id: I54b6b0843f0dd635d89cca483ae43d23b20d21e8
---
 gnu/system/examples/devel-hurd.tmpl   | 70 +++++++++++----------------
 gnu/system/examples/devel-hurd64.tmpl | 65 +++++++++++++++++++++++++
 2 files changed, 93 insertions(+), 42 deletions(-)
 create mode 100644 gnu/system/examples/devel-hurd64.tmpl

diff --git a/gnu/system/examples/devel-hurd.tmpl b/gnu/system/examples/devel-hurd.tmpl
index 3dca0706d1..066bdfe9d8 100644
--- a/gnu/system/examples/devel-hurd.tmpl
+++ b/gnu/system/examples/devel-hurd.tmpl
@@ -3,7 +3,7 @@
 ;; This is an operating system configuration template for a "bare bones
 ;; development" setup, with no X11 display server.
 
-;; To build a disk image for a virtual machine, do
+;; To build a disk image for a virtual machine, do something like:
 ;;
 ;;   ./pre-inst-env guix system image --image-type=hurd-qcow2 --image-size=6G \
 ;;      --no-offload gnu/system/examples/devel-hurd.tmpl
@@ -11,41 +11,38 @@
 ;; You may run it like so
 ;;
 ;;     cp /gnu/store/.../disk-image devel-hurd.img
-;;     guix shell qemu -- qemu-system-i386 -enable-kvm -m 4096 \
-;;      -device rtl8139,netdev=net0                            \
-;;      -netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222 \
-;;      -hda devel-hurd.img
-;;
-;; and use it like
+;;     guix shell qemu -- qemu-system-i386 -m 4096                \
+;;       --enable-kvm                                             \
+;;       --device e1000,netdev=net0                               \
+;;       --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222  \
+;;       --hda devel-hurd.img
 ;;
 ;;     ssh -p 10022 root@localhost
 ;;     guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
 ;;
-;; or even (if you use --image-size=3G)
+;; or even:
 ;;
 ;;     guix build hello
 ;;
-;; Building Guix, do something like:
+;; For Guix hacking, do something like:
 ;;
-;;     GUIX_PROFILE=/run/current-system/bootstrap-profile
-;;     source $GUIX_PROFILE/etc/profile
+;;     guix shell --boostrap -D guix
 ;;     mkdir -p ~/src/guix
 ;;     cd src/guix
 ;;     git clone https://git.savannah.gnu.org/git/guix.git master
 ;;     cd master
 ;;     ./bootstrap
-;;     ./configure --with-courage
+;;     ./configure
 ;;     make
 
+(include "bare-hurd.tmpl")
+
 (use-modules (srfi srfi-1)
              (ice-9 match)
-             (gnu)
              (gnu system hurd)
-             (gnu system locale)
              (guix packages)
-             (guix store)
-             (guix utils))
-(use-service-modules ssh virtualization)
+             (guix store))
+
 (use-package-modules base compression file gawk gdb hurd less m4
                      package-management ssh version-control)
 
@@ -64,23 +61,23 @@
                     ;; These are not essential and do not build yet.
                     '("graphviz" "guile-avahi" "po4a"))))
 
+(define hurd-packages
+  (filter-map input->package
+              (fold alist-delete (package-direct-inputs hurd)
+                    ;; These are not essential, rumpkernel is very big.
+                    '("dde-sources" "parted" "rumpkernel" "util-linux"
+                      "texinfo"))))
+
 (define %hurd-devel-os
   (operating-system
-    (inherit %hurd-vm-operating-system)
-    (host-name "guixydevel")
+    (inherit %hurd-os)
+    (bootloader (bootloader-configuration
+                 (bootloader grub-minimal-bootloader)
+                 (targets '("/dev/sdX"))
+                 (timeout 0)))
     (timezone "Europe/Berlin")
-    (file-systems (cons (file-system
-                          (device (file-system-label "hurd"))
-                          (mount-point "/")
-                          (type "ext2"))
-                        %base-file-systems))
     (swap-devices (list (swap-space
                           (target "/swapfile"))))
-    (users (cons (user-account
-                  (name "guix")
-                  (group "users")
-                  (supplementary-groups '("wheel")))
-                 %base-user-accounts))
     (packages (cons*
                gdb-minimal
                git-minimal
@@ -89,18 +86,7 @@
                openssh-sans-x
                (append
                 guix-packages
-                %base-packages/hurd)))
-    (services (cons*
-               (modify-services (operating-system-user-services
-                                 %hurd-vm-operating-system)
-                 (openssh-service-type
-                  config =>
-                  ;; Set wide open
-                  (openssh-configuration
-                   (openssh openssh-sans-x)
-                   (port-number 2222)
-                   (permit-root-login #t)
-                   (allow-empty-passwords? #t)
-                   (password-authentication? #t))))))))
+                hurd-packages
+                %base-packages/hurd)))))
 
 %hurd-devel-os
diff --git a/gnu/system/examples/devel-hurd64.tmpl b/gnu/system/examples/devel-hurd64.tmpl
new file mode 100644
index 0000000000..ebc9fe8138
--- /dev/null
+++ b/gnu/system/examples/devel-hurd64.tmpl
@@ -0,0 +1,65 @@
+;; -*-scheme-*-
+
+;; This is an operating system configuration template
+;; for a "bare bones" QEMU setup, with no X11 display server.
+
+;; To build a disk image for a virtual machine, do:
+;;
+;;   ./pre-inst-env guix system image --image-type=hurd-qcow2 --image-size=6G \
+;;      --no-offload gnu/system/examples/devel-hurd64.tmpl
+;;
+;; You may run it like so:
+;;
+;;     cp /gnu/store/.../disk-image devel-hurd.img
+;;     guix shell qemu@7 -- qemu-system-x86_64 -m 4096            \
+;;       --machine q35                                            \
+;;       --enable-kvm                                             \
+;;       --device e1000,netdev=net0                               \
+;;       --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222  \
+;;       --hda devel-hurd.img
+;;
+;; and use it like:
+;;
+;;     ssh -p 10022 root@localhost
+;;     guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
+;;
+;; or even:
+;;
+;;     guix build hello
+;;
+;; For Guix hacking, do something like:
+;;
+;;     guix shell --boostrap -D guix
+;;     mkdir -p ~/src/guix
+;;     cd src/guix
+;;     git clone git clone git://git.savannah.gnu.org/guix
+;;     cd master
+;;     ./bootstrap
+;;     ./configure
+;;     make
+
+(include "devel-hurd.tmpl")
+(include "bare-hurd64.tmpl")
+
+(define %hurd64-devel-os
+  (operating-system
+    (inherit %hurd64-os)
+    (bootloader (bootloader-configuration
+                 (bootloader grub-minimal-bootloader)
+                 (targets '("/dev/sdX"))
+                 (timeout 0)))
+    (timezone "Europe/Berlin")
+    (swap-devices (list (swap-space
+                          (target "/swapfile"))))
+    (packages (cons*
+               gdb-minimal
+               git-minimal
+               gnu-make
+               m4
+               openssh-sans-x
+               (append
+                guix-packages
+                hurd-packages
+                %base-packages/hurd)))))
+
+%hurd64-devel-os
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 13/40] gnu: gcc-13, gcc-14: Support being used as parent for gcc-static.
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 13/40] gnu: gcc-13, gcc-14: Support being used as parent for gcc-static Janneke Nieuwenhuizen
@ 2024-11-17 16:49     ` Ludovic Courtès
  2024-11-17 18:27       ` janneke
  0 siblings, 1 reply; 206+ messages in thread
From: Ludovic Courtès @ 2024-11-17 16:49 UTC (permalink / raw)
  To: Janneke Nieuwenhuizen; +Cc: 74290, Andreas Enge

Hi!

Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

> * gnu/packages/gcc.scm (gcc-13)[arguments]: Use quasiquote instead of
> g-expressions.
> (gcc-14)[arguments]: Likewise.
>
> Change-Id: I22269b31d49868effe967d46247b189ed9a9d394

[...]

> -           #~(modify-phases #$phases
> -               (delete 'patch-hurd-libpthread))
> +           `(modify-phases ,phases
> +              (delete 'patch-hurd-libpthread))

I think we should not do that as this undoes previous changes.

Instead, can we change whichever package expects to get an sexp here to
use gexps?

Ludo’.




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 14/40] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 14/40] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-17 16:50     ` Ludovic Courtès
  2024-11-17 17:34       ` janneke
  0 siblings, 1 reply; 206+ messages in thread
From: Ludovic Courtès @ 2024-11-17 16:50 UTC (permalink / raw)
  To: Janneke Nieuwenhuizen
  Cc: 74290, Josselin Poiret, Maxim Cournoyer, Simon Tournier,
	Mathieu Othacehe, Tobias Geerinckx-Rice, Andreas Enge,
	Christopher Baines

Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

> +++ b/gnu/packages/bootstrap.scm
> @@ -125,6 +125,15 @@ (define %bootstrap-executables
>        ,(base32 "0nq2c1zb3wv5bf7kd83sziaashydazrn7xgq6kijlk0zj2syzc2m"))
>       ("xz"
>        ,(base32 "033rhpk6zrpxpd6ffjyg5y2zwq9x9cnq0zljb7k8jlncbalsayq5")))
> +    ("x86_64-gnu"
> +     ("bash"
> +      ,(base32 "1ib1kk1larki3dm46lhl756856zpjwhhlnzkgdyh9f1yf6wm431y"))
> +     ("mkdir"
> +      ,(base32 "15cnckq4qj1nlmgqy9vq3qa3kcbfm1pc2z38pscxix11j4aqswsm"))
> +     ("tar"
> +      ,(base32 "1m8v7ddmn42wym2kl9mf7csnwsw6c3jdglg7d7kp7yaa16h5fbck"))
> +     ("xz"
> +      ,(base32 "16cnr7vr0zawrwcnhshms3v5kyzb2vz1rp4kxmx507cs6rivd05b")))

Are the i586-gnu binaries usable on x86_64-gnu?  That would be sweet,
and it would allow us have a single set of binary seeds instead of two.




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 17/40] gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd.
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 17/40] gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-17 16:51     ` Ludovic Courtès
  2024-11-17 17:53       ` janneke
  0 siblings, 1 reply; 206+ messages in thread
From: Ludovic Courtès @ 2024-11-17 16:51 UTC (permalink / raw)
  To: Janneke Nieuwenhuizen; +Cc: 74290

Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

> * gnu/packages/gnupg.scm (libgcrypt)[propagated-inputs]: When building for the
> 64bit Hurd, use libgcrypt-1.50.
>
> Change-Id: I608d283a4a307527d5b09a81fa1a53cec5d6bb76

[...]

>      (propagated-inputs
> -     `(("libgpg-error-host" ,libgpg-error)))
> +     `(("libgpg-error-host" ,(if (target-hurd64?)
> +                                 libgpg-error-1.50
> +                                 libgpg-error))))

Could you add a short comment explaining why this version is needed?




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 04/40] gnu: gcc: Add indirections current-gcc, current-gcc-toolchain.
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 04/40] gnu: gcc: Add indirections current-gcc, current-gcc-toolchain Janneke Nieuwenhuizen
@ 2024-11-17 16:51     ` Ludovic Courtès
  0 siblings, 0 replies; 206+ messages in thread
From: Ludovic Courtès @ 2024-11-17 16:51 UTC (permalink / raw)
  To: Janneke Nieuwenhuizen
  Cc: 74290, Sharlatan Hellseher, Vagrant Cascadian, Ekaitz Zarraga,
	Simon Tournier, Guillaume Le Vaillant, Katherine Cox-Buday,
	Efraim Flashner, Munyoki Kilyungi, Andreas Enge, jgart

Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

> 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

I would have loved to avoid those indirections… but can we? :-)




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 05/40] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 05/40] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-17 16:59     ` Ludovic Courtès
  2024-11-17 17:26       ` janneke
  0 siblings, 1 reply; 206+ messages in thread
From: Ludovic Courtès @ 2024-11-17 16:59 UTC (permalink / raw)
  To: Janneke Nieuwenhuizen
  Cc: 74290, Josselin Poiret, Ekaitz Zarraga, Simon Tournier,
	Mathieu Othacehe, Tobias Geerinckx-Rice, Efraim Flashner,
	Andreas Enge, Christopher Baines

[-- Attachment #1: Type: text/plain, Size: 871 bytes --]

Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

> +++ b/gnu/packages/commencement.scm
> @@ -3643,10 +3643,12 @@ (define-public gcc-toolchain-14
>  ;; The default GCC
>  (define (current-gcc-toolchain)
>    "The current default gcc-toolchain version."
> -  gcc-toolchain-11)
> +  (if (target-hurd64?)
> +      gcc-toolchain-14
> +      gcc-toolchain-11))

[...]

> +++ b/gnu/packages/gcc.scm
> @@ -861,10 +861,12 @@ (define-public gcc-14
>  ;;       the gcc-toolchain-* definitions.
>  (define (current-gcc)
>    "The current default gcc version."
> -  gcc-11)
> +  (if (target-hurd64?)
> +      gcc-14
> +      gcc-11))

This affects not just cross-compilation but also native compilation.

Let’s assume we only want cross-compilation to x86_64-gnu for now, how
about changing the GCC version used for cross-compilation, and only
that:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 497 bytes --]

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 5781341a87..6120740b3c 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -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 gcc-14))
 
 (define %gcc-include-paths
   ;; Environment variables for header search paths.

[-- Attachment #3: Type: text/plain, Size: 397 bytes --]


That would affect also non-Hurd cross-compilation targets, but if it
works, it’s simpler.

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?

Ludo’.

^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 00/40] Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
                     ` (39 preceding siblings ...)
  2024-11-12 16:25   ` [bug#74290] [PATCH v2 40/40] system: examples: Add devel-hurd64.tmpl Janneke Nieuwenhuizen
@ 2024-11-17 17:03   ` Ludovic Courtès
  2024-11-17 17:51     ` janneke
  40 siblings, 1 reply; 206+ messages in thread
From: Ludovic Courtès @ 2024-11-17 17:03 UTC (permalink / raw)
  To: Janneke Nieuwenhuizen; +Cc: 74290

Hi!

Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

> root@guixygnu64 ~# uname -a
> GNU guixygnu64 0.9 GNU-Mach 1.8/Hurd-0.9 x86_64 GNU
> root@guixygnu64 ~# guix shell --bootstrap -D --expression='(@@ (gnu packages commencement) gnu-make-boot0)'
> hint: Consider passing the `--check' option once to make sure your shell does not
> clobber environment variables.

[...]

> building /gnu/store/ps0shilnqwpm40886dnqg4bkazw8pq7i-glibc-bootstrap-0.drv...
> building /gnu/store/8kqnvyf9i8qgizq69314xa576fj4idy5-gcc-bootstrap-0.drv...
> building profile with 4 packages...

This is amazing!!

Glad to see it happen.  I’ve just posted a bargaining proposal :-)
regarding ‘current-gcc’ etc., let’s see where that goes.

Anyhow, this is great, it makes the OS more usable.

Ludo’.




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 05/40] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
  2024-11-17 16:59     ` Ludovic Courtès
@ 2024-11-17 17:26       ` janneke
  2024-11-18  8:45         ` janneke
  2024-11-20 11:48         ` Ludovic Courtès
  0 siblings, 2 replies; 206+ messages in thread
From: janneke @ 2024-11-17 17:26 UTC (permalink / raw)
  To: Ludovic Courtès
  Cc: 74290, Josselin Poiret, Ekaitz Zarraga, Simon Tournier,
	Mathieu Othacehe, Tobias Geerinckx-Rice, Efraim Flashner,
	Andreas Enge, Christopher Baines

Ludovic Courtès writes:

> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>
>> +++ b/gnu/packages/commencement.scm
>> @@ -3643,10 +3643,12 @@ (define-public gcc-toolchain-14
>>  ;; The default GCC
>>  (define (current-gcc-toolchain)
>>    "The current default gcc-toolchain version."
>> -  gcc-toolchain-11)
>> +  (if (target-hurd64?)
>> +      gcc-toolchain-14
>> +      gcc-toolchain-11))
>
> [...]
>
>> +++ b/gnu/packages/gcc.scm
>> @@ -861,10 +861,12 @@ (define-public gcc-14
>>  ;;       the gcc-toolchain-* definitions.
>>  (define (current-gcc)
>>    "The current default gcc version."
>> -  gcc-11)
>> +  (if (target-hurd64?)
>> +      gcc-14
>> +      gcc-11))
>
> This affects not just cross-compilation but also native compilation.

Eh, if you mean for the 64bit Hurd, sure!  That was the idea, it needs
gcc-14...

> Let’s assume we only want cross-compilation to x86_64-gnu for now,

Cross-compilation works pretty well, I've been mostly working on native
compilation the past week...

> how about changing the GCC version used for cross-compilation, and
> only that:
>
> diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
> index 5781341a87..6120740b3c 100644
> --- a/gnu/packages/cross-base.scm
> +++ b/gnu/packages/cross-base.scm
> @@ -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 gcc-14))

Interesting...I would have thought this would cause a world rebuild,
because of the cross-gcc in commencement.  Apparently, it doesn't.

> That would affect also non-Hurd cross-compilation targets, but if it
> works, it’s simpler.

Ok, I very much like the simplicity of this.

> 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?

Greetings,
Janneke


-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 14/40] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-17 16:50     ` Ludovic Courtès
@ 2024-11-17 17:34       ` janneke
  2024-11-20 11:50         ` Ludovic Courtès
  0 siblings, 1 reply; 206+ messages in thread
From: janneke @ 2024-11-17 17:34 UTC (permalink / raw)
  To: Ludovic Courtès
  Cc: 74290, Josselin Poiret, Maxim Cournoyer, Simon Tournier,
	Mathieu Othacehe, Tobias Geerinckx-Rice, Andreas Enge,
	Christopher Baines

Ludovic Courtès writes:

> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>
>> +++ b/gnu/packages/bootstrap.scm
>> @@ -125,6 +125,15 @@ (define %bootstrap-executables
>>        ,(base32 "0nq2c1zb3wv5bf7kd83sziaashydazrn7xgq6kijlk0zj2syzc2m"))
>>       ("xz"
>>        ,(base32 "033rhpk6zrpxpd6ffjyg5y2zwq9x9cnq0zljb7k8jlncbalsayq5")))
>> +    ("x86_64-gnu"
>> +     ("bash"
>> +      ,(base32 "1ib1kk1larki3dm46lhl756856zpjwhhlnzkgdyh9f1yf6wm431y"))
>> +     ("mkdir"
>> +      ,(base32 "15cnckq4qj1nlmgqy9vq3qa3kcbfm1pc2z38pscxix11j4aqswsm"))
>> +     ("tar"
>> +      ,(base32 "1m8v7ddmn42wym2kl9mf7csnwsw6c3jdglg7d7kp7yaa16h5fbck"))
>> +     ("xz"
>> +      ,(base32 "16cnr7vr0zawrwcnhshms3v5kyzb2vz1rp4kxmx507cs6rivd05b")))
>
> Are the i586-gnu binaries usable on x86_64-gnu?

No, at least not currently.  The mach message format even differs, AFAIK.

--8<---------------cut here---------------start------------->8---
root@guixygnu64 ~# file bash-i586
bash-i586: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Hurd 0.0.0, stripped

root@guixygnu64 ~# ./bash-i586 --help
-bash: ./bash-i586: cannot execute binary file: Exec format error
[..]
root@debian:~# ./bash-i586 --help
-bash: ./bash-i586: cannot execute binary file: Exec format error
[..]
root@childhurd ~# ./bash-i586 
I have no name!@childhurd ~# ./bash-i586 --help
GNU bash, version 5.0.16(1)-release-(i586-pc-gnu)
Usage: ./bash-i586 [GNU long option] [option] ...
      ./bash-i586 [GNU long option] [option] script-file ...
--8<---------------cut here---------------end--------------->8---

> That would be sweet, and it would allow us have a single set of binary
> seeds instead of two.

Yeah...but no, and we'd need a gcc-14 anyway.

Greetings,
Janneke

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 00/40] Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-17 17:03   ` [bug#74290] [PATCH v2 00/40] Add support for x86_64-gnu, aka the 64bit Hurd Ludovic Courtès
@ 2024-11-17 17:51     ` janneke
  0 siblings, 0 replies; 206+ messages in thread
From: janneke @ 2024-11-17 17:51 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 74290

Ludovic Courtès writes:

Hi!

> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>
>> root@guixygnu64 ~# uname -a
>> GNU guixygnu64 0.9 GNU-Mach 1.8/Hurd-0.9 x86_64 GNU
>> root@guixygnu64 ~# guix shell --bootstrap -D --expression='(@@ (gnu
>> packages commencement) gnu-make-boot0)'
>> hint: Consider passing the `--check' option once to make sure your shell does not
>> clobber environment variables.
>
> [...]
>
>> building /gnu/store/ps0shilnqwpm40886dnqg4bkazw8pq7i-glibc-bootstrap-0.drv...
>> building /gnu/store/8kqnvyf9i8qgizq69314xa576fj4idy5-gcc-bootstrap-0.drv...
>> building profile with 4 packages...
>
> This is amazing!!

Thank you!  FWIW, I'm currently up to here

--8<---------------cut here---------------start------------->8---
building /gnu/store/b1zafmkrz9dhh8dmglgjiv4yrf29ygqa-file-boot0-5.45.drv...
building /gnu/store/4b0xk1jdggh2vkca4mj3q29zgbmn06h1-findutils-boot0-4.9.0.drv...
building /gnu/store/k1anwx8nm03i6akc3y65gy1vqj2h14c0-gcc-14.2.0.tar.xz.drv...
building /gnu/store/kycw4rv3vc17a9147i4v8b5cy3cpdj7r-binutils-cross-boot0-2.41.drv...
building /gnu/store/jh9kknd4xnml9bxmdrs2j0vmjxixw6jk-expat-2.5.0.drv...
building /gnu/store/ks454i900xdqizkvjzxff9yg78jhzh08-gcc-14.2.0.tar.xz.drv...
building /gnu/store/7sm2cm9dmhjqqq3qz52dsm2nb6ah4yrg-glibc-2.39.tar.xz.drv...
building /gnu/store/2ykm8n6yynnk4mv8b9qy6liccpbhj9h4-gmp-6.0.0a.tar.xz.drv...
building /gnu/store/vbk133fp4ldi2jrgbg5121f29z7x886w-grep-3.11.tar.xz.drv...
building /gnu/store/h4r8v4kv268vksf2sb0fj1l026svbncg-guile-3.0.9.tar.xz.drv...
building /gnu/store/77pq0ygp8xqxp198r1d924wmgyqc2df6-ld-wrapper-boot0-0.drv...
building /gnu/store/w35zl5n42b8q4m095xb6ng8sxvxxm1xw-libstdc++-boot0-14.2.0.drv...
building /gnu/store/jg59zvvl58dkrpvyxcyg9sghax7skgvw-m4-boot0-1.4.19.drv...
building /gnu/store/2ac7j9xyzv96v52z3gnipb30z61f71kf-gcc-cross-boot0-14.2.0.drv...
- 'build' phasebuilder for `/gnu/store/2ac7j9xyzv96v52z3gnipb30z61f71kf-gcc-cross-boot0-14.2.0.drv' failed with exit code 1
build of /gnu/store/2ac7j9xyzv96v52z3gnipb30z61f71kf-gcc-cross-boot0-14.2.0.drv failed
[..]
checking build system compiler gcc... no
configure: error: Specified CC_FOR_BUILD doesn't seem to work
make[1]: *** [Makefile:5118: configure-gmp] Error 1
make[1]: Leaving directory '/tmp/guix-build-gcc-cross-boot0-14.2.0.drv-0/build'

--8<---------------cut here---------------end--------------->8---

but small things like guix copy (and offloading) don't seem to work.
I'm working up towards a v3 (and getting that "merged") so that others
might help :)

> Glad to see it happen.  I’ve just posted a bargaining proposal :-)
> regarding ‘current-gcc’ etc., let’s see where that goes.

Yeah, I think that's a very good call.

> Anyhow, this is great, it makes the OS more usable.

Yes, that's the idea!

Greetings,
Janneke

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 17/40] gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd.
  2024-11-17 16:51     ` Ludovic Courtès
@ 2024-11-17 17:53       ` janneke
  0 siblings, 0 replies; 206+ messages in thread
From: janneke @ 2024-11-17 17:53 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 74290

Ludovic Courtès writes:

> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>
>> * gnu/packages/gnupg.scm (libgcrypt)[propagated-inputs]: When building for the
>> 64bit Hurd, use libgcrypt-1.50.
>>
>> Change-Id: I608d283a4a307527d5b09a81fa1a53cec5d6bb76
>
> [...]
>
>>      (propagated-inputs
>> -     `(("libgpg-error-host" ,libgpg-error)))
>> +     `(("libgpg-error-host" ,(if (target-hurd64?)
>> +                                 libgpg-error-1.50
>> +                                 libgpg-error))))
>
> Could you add a short comment explaining why this version is needed?

Sure.  Upstream added 64bit Hurd support (me looks into git, hmm) in
1.48 with a single patch.  I could also add that patch to
libgpg-error-1.47 when building for the Hurd.  Maybe that's nicer?

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 13/40] gnu: gcc-13, gcc-14: Support being used as parent for gcc-static.
  2024-11-17 16:49     ` Ludovic Courtès
@ 2024-11-17 18:27       ` janneke
  2024-11-17 18:46         ` janneke
  0 siblings, 1 reply; 206+ messages in thread
From: janneke @ 2024-11-17 18:27 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 74290, Andreas Enge

Ludovic Courtès writes:

> Hi!
>
> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>
>> * gnu/packages/gcc.scm (gcc-13)[arguments]: Use quasiquote instead of
>> g-expressions.
>> (gcc-14)[arguments]: Likewise.
>>
>> Change-Id: I22269b31d49868effe967d46247b189ed9a9d394
>
> [...]
>
>> -           #~(modify-phases #$phases
>> -               (delete 'patch-hurd-libpthread))
>> +           `(modify-phases ,phases
>> +              (delete 'patch-hurd-libpthread))
>
> I think we should not do that as this undoes previous changes.
>
> Instead, can we change whichever package expects to get an sexp here to
> use gexps?

Hmm, how would that work?  The package that expects a sexp is
gcc-static.

If we update gcc-static to also use gexps we can no longer build any gcc
< 13 static?  Unless we update also update gcc-4.7, gcc-4.8, and those
in commencement.  Maybe (hopefully!) I'm missing something?

Greetings,
Janneke

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 13/40] gnu: gcc-13, gcc-14: Support being used as parent for gcc-static.
  2024-11-17 18:27       ` janneke
@ 2024-11-17 18:46         ` janneke
  0 siblings, 0 replies; 206+ messages in thread
From: janneke @ 2024-11-17 18:46 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 74290, Andreas Enge

> Ludovic Courtès writes:

>> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>>
>>> * gnu/packages/gcc.scm (gcc-13)[arguments]: Use quasiquote instead of
>>> g-expressions.
>>> (gcc-14)[arguments]: Likewise.
>>>
>>> Change-Id: I22269b31d49868effe967d46247b189ed9a9d394
>>
>> [...]
>>
>>> -           #~(modify-phases #$phases
>>> -               (delete 'patch-hurd-libpthread))
>>> +           `(modify-phases ,phases
>>> +              (delete 'patch-hurd-libpthread))
>>
>> I think we should not do that as this undoes previous changes.
>>
>> Instead, can we change whichever package expects to get an sexp here to
>> use gexps?
>
> Hmm, how would that work?  The package that expects a sexp is
> gcc-static.
>
> If we update gcc-static to also use gexps we can no longer build any gcc
> < 13 static?  Unless we update also update gcc-4.7, gcc-4.8, and those
> in commencement.  Maybe (hopefully!) I'm missing something?

I have upgraded %gcc-static in make-bootstrap to gcc-14, problem solved :)
hopefully.

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 05/40] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
  2024-11-17 17:26       ` janneke
@ 2024-11-18  8:45         ` janneke
  2024-11-18  9:07           ` janneke
  2024-11-20 11:48         ` Ludovic Courtès
  1 sibling, 1 reply; 206+ messages in thread
From: janneke @ 2024-11-18  8:45 UTC (permalink / raw)
  To: Ludovic Courtès
  Cc: 74290, Josselin Poiret, Ekaitz Zarraga, Simon Tournier,
	Mathieu Othacehe, Tobias Geerinckx-Rice, Efraim Flashner,
	Andreas Enge, Christopher Baines


> Ludovic Courtès writes:
>
>> Janneke Nieuwenhuizen <janneke@gnu.org> 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))
 
 \f
 ;;;
--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 <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com




^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 05/40] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
  2024-11-18  8:45         ` janneke
@ 2024-11-18  9:07           ` janneke
  2024-11-20 11:43             ` Ludovic Courtès
  0 siblings, 1 reply; 206+ messages in thread
From: janneke @ 2024-11-18  9:07 UTC (permalink / raw)
  To: Ludovic Courtès
  Cc: 74290, Josselin Poiret, Ekaitz Zarraga, Simon Tournier,
	Mathieu Othacehe, Tobias Geerinckx-Rice, Efraim Flashner,
	Andreas Enge, Christopher Baines

>> Ludovic Courtès writes:
>>
>>> Janneke Nieuwenhuizen <janneke@gnu.org> 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/:
>
> 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?)

Hmm, no that doesn't work; (%current-system) is #f at toplevel.  We
could only do something like

  (define (host-hurd64?)
    (let ((uname-info (uname)))
      (and (equal? (utsname:sysname uname-info) "GNU")
           (equal? (utsname:machine uname-uname) "x86_64"))))

and then it still would not work for offloading.  It might be a cleanish
way to enable development in the 64bit childhurd before the full gcc-14
transition?

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 00/51] Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (32 preceding siblings ...)
  2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
@ 2024-11-19  6:54 ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 01/51] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
                     ` (50 more replies)
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
  34 siblings, 51 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290
  Cc: Andreas Enge, Christopher Baines, Efraim Flashner, Ekaitz Zarraga,
	Josselin Poiret, Ludovic Courtès, Mathieu Othacehe,
	Simon Tournier, Tobias Geerinckx-Rice

New in V3:

  * Change of plans: Remove (current-gcc*) indirections; bump %xgcc to gcc-14,
  * Use gcc-14 in make-bootstrap, not just for 64bit Hurd bootstrap binaries,
  * Fix cross-built guile-lzib for the 64bit Hurd,
  * Add gdb-15.2 with support for the 64bit Hurd,
  * Fix hanging of static tar upon --mtime=@1 warning,
  * Fix hanging of bash while configuring diffutils,
  * Add three must-have patches from Debian to glibc/hurd,
  * Fix bootstrap-glibc's libm.so linker script,
  * Patch libgpg-error-1.47 for the 64bit Hurd instead of juggling v1.50,
  * Use gcc-14 [cross-]build fixes for guile-lzlib, bash-minimal,
    git-minimal, libffi, perl, and texinfo-4 generally when
    cross-building, not just for the 64bit Hurd,
  * Add gcc-14 [cross-]build fixes to 32bit targets for libedit and
    libssh.

Resulting in

--8<---------------cut here---------------start------------->8---
Last login: Mon Nov 18 23:03:05 2024 from 10.0.2.2


  This is the GNU Hurd.  Welcome.
root@guixygnu64 ~# guix shell --bootstrap -D --expression='(@@ (gnu packages commencement) gnu-make-boot0)'
hint: Consider passing the `--check' option once to make sure your shell does not clobber
environment variables.

substitute: updating substitutes from 'http://dezyne.org:8181'... 100.0%
substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
The following derivations will be built:
  /gnu/store/3a5il5hniygz39mx3prp5hp63mzhap37-bash.drv
  /gnu/store/6zx9w9zhhp1azpzjh91y1vkf3n80mb3d-tar.drv
  /gnu/store/ayjm0r6x1j8zzsjyr1shwnp1riwxx99c-guile-static-stripped-3.0.9-x86_64-pc-gnu.tar.xz.drv
  /gnu/store/bc5mrw4zsgxfap7jns5gawm8f3ph7qkc-xz.drv
  /gnu/store/yal3zl9d5z3v04031384ngwf95fnr5lm-mkdir.drv
  /gnu/store/6mm475diy40ndxwb0a0gf1zlbvh3hnzr-guile-bootstrap-2.0.drv
  /gnu/store/8k0hmakcghiz1iwd7k12j7h9jbca5snq-module-import-compiled.drv
  /gnu/store/b80napyrxi4zv7qvjk968ma7j6c9l9j5-module-import-compiled.drv
  /gnu/store/flib02wl6g7kx191vscbz2d4c88q1hn8-binutils-static-stripped-2.41-x86_64-pc-gnu.tar.xz.drv
  /gnu/store/chknjczabywxlq560wv8c90vfcsqly4k-binutils-bootstrap-0.drv
  /gnu/store/nmfksk734hdjs6pdwpn6rz15aba57liw-glibc-stripped-2.39-x86_64-pc-gnu.tar.xz.drv
  /gnu/store/f9zb5fdlyzikz3imcffdw3j2zxjrmigv-glibc-bootstrap-0.drv
  /gnu/store/hx98agiqzh97z6q8lxjrwgndvss72lla-gcc-stripped-14.2.0-x86_64-pc-gnu.tar.xz.drv
  /gnu/store/fpsga1c9a8ziz1bsp0gqjn3vrs2fy5b7-gcc-bootstrap-0.drv
  /gnu/store/vd3cms89c6dd5syk67casrncdf3srp89-static-binaries-0-x86_64-pc-gnu.tar.xz.drv
  /gnu/store/jlymwk4jqarbyndd42a700xhxswx3vjm-bootstrap-binaries-0.drv
  /gnu/store/x433dmz11as7axpkv69lqa2v44lg7npv-profile.drv
[..]
building /gnu/store/fpsga1c9a8ziz1bsp0gqjn3vrs2fy5b7-gcc-bootstrap-0.drv...
building profile with 4 packages...
root@guixygnu64 ~ [env]# guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
[..]
/gnu/store/bnas62xn8zav82h39r5rfal40h0km2mf-make-boot0-4.4.1
root@guixygnu64 ~ [env]# guix build hello --verbosity=2
[..]
building /gnu/store/c7vj6mqaji52ghpc1g3g9bws09fphyn8-Python-3.5.9.tar.xz.drv...
building /gnu/store/4s4673b61571kxgpra9d28lrpp3yz0xq-bash-5.1.tar.xz.drv...
building /gnu/store/7pc112kljri6vsk5s21skaypr4qk3n2g-binutils-2.41.tar.xz.drv...
building /gnu/store/9z61jcjmmbvz4qgxdmkxrhwc9y1fzlmp-diffutils-boot0-3.10.drv...
building /gnu/store/qf3wyl8kgzz2iy6z6bamdn4288sfgmdv-file-5.45.tar.xz.drv...
building /gnu/store/vpjlhqh2nq3rdaw97ajydy9jnwhmy13s-findutils-4.9.0.tar.xz.drv...
building /gnu/store/h2h7hh7kixxisf39lp68psik9jxc2790-file-boot0-5.45.drv...
building /gnu/store/zdzz8hzd7b5jdgrsp8fr8flv3fmpvzpk-findutils-boot0-4.9.0.drv...
building /gnu/store/jcipyysphkwc1dxa9wsc4nnbqylsdbqw-gcc-14.2.0.tar.xz.drv...
building /gnu/store/8zmvmk2v347yw0sh9acgyxqhn10rrzdp-binutils-cross-boot0-2.41.drv...
building /gnu/store/ia44hglqlnvslq5cw7mj1i0hvif9p5vp-expat-2.5.0.drv...
building /gnu/store/skc7yvra95gzcbwgfnc1b1wcj6hw720c-gcc-14.2.0.tar.xz.drv...
building /gnu/store/gi1ghd56yk94iqq2qp0573cypzm0p0sj-glibc-2.39.tar.xz.drv...
building /gnu/store/jgw4blvxhibbmpc2d2fz1n1c5fn9fyak-gmp-6.0.0a.tar.xz.drv...
building /gnu/store/7nfyg7z2g08shl9mc7z19ix3amfjpn0k-grep-3.11.tar.xz.drv...
building /gnu/store/s5and4p7lg21043afbf7kg8qvic2l970-guile-3.0.9.tar.xz.drv...
building /gnu/store/r90wl58jlmkrhv5ln42xvs12j373msi1-ld-wrapper-boot0-0.drv...
building /gnu/store/8mizh7y6p0ypc8wwcbmg863m97qqwpm8-libstdc++-boot0-14.2.0.drv...
building /gnu/store/79bjqzpk6lnmrlrq15qrjipsll59rqig-m4-boot0-1.4.19.drv...
building /gnu/store/97h3533sf4b30mihx2wpia4kr6z1c2yx-gcc-cross-boot0-14.2.0.drv...
checking build system compiler gcc... no
configure: error: Specified CC_FOR_BUILD doesn't seem to work
make[1]: *** [Makefile:5118: configure-gmp] Error 1
make[1]: Leaving directory '/tmp/guix-build-gcc-cross-boot0-14.2.0.drv-0/build'
make: *** [Makefile:1046: all] Error 2
--8<---------------cut here---------------end--------------->8---

not bad, more work to do before we arrive at "hello".

A new `core-packages-team' branch will change the default to gcc-14.
This means that native building on the 64bit Hurd would have to "wait" until
`core-packages-team' is usable enough for the Hurd.  Until that time
we may use (last patch):

    gnu: Use gcc-14, gcc-toolchain-14 on the 64bit Hurd.

that selects gcc-14 when the host system (uname, not %current-system) is
a x86_64-GNU.  WDYT?

Greetings,
Janneke

Janneke Nieuwenhuizen (51):
  gnu: gnumach: Update to v1.8+git20240714.
  gnu: mig: Update to 1.8+git20231217.
  gnu: hurd: Update to 0.9.git20240714.
  gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
  gnu: cross-libc: Support cross-building for the 64bit Hurd.
  gnu: bash-minimal: Support [cross-]build with gcc-14.
  gnu: elfutils: Fix build for 64bit Hurd.
  gnu: grep: Fix build for the 64bit Hurd.
  gnu: patch: Fix build for the 64bit Hurd.
  gnu: libxcrypt: Support the 64bit Hurd.
  gnu: libstdc++: Support the 64bit Hurd.
  gnu: glibc/hurd: Add patches for the 64bit Hurd.
  gnu: bash: Avoid hang when cross-built for the Hurd.
  gnu: git-minimal: Support [cross-]build with gcc-14 and the 64bit
    Hurd.
  gnu: flex: Fix [cross-]build with gcc-14.
  gnu: libffi: Fix [cross-]build with gcc-14.
  gnu: perl: Support [cross-]build with gcc-14 and the 64bit Hurd.
  gnu: texinfo-4: Fix [cross-]build with gcc-14 and the 64bit Hurd.
  gnu: hurd: Fix build with gcc-14.
  gnu: netdde: Fix build with gcc-14.
  gnu: libedit: Fix [cross-]build with gcc-14 for 32bit.
  gnu: libssh: Fix [cross-]build with gcc-14 for 32bit.
  gnu: guile-lzlib: Support [cross-]build with gcc-14 and the 64bit
    Hurd.
  gnu: cross-base: Update %xgcc to gcc-14, to support the 64bit Hurd.
  gnu: make-bootstrap: Update gcc-static to gcc-14, for the 64bit Hurd.
  DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd.
  system: image: Add hurd64 image types.
  gnu: libgpg-error: Support the 64bit Hurd.
  gnu: openssl-3.0: Support the 64bit Hurd.
  gnu: pciutils: Support the 64bit Hurd.
  gnu: libpciaccess: Support the 64bit Hurd.
  gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df.
  gnu: netdde: Support the 64bit Hurd.
  gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337.
  gnu: rumpkernel: Support the 64bit Hurd.
  gnu: hurd: Build fixes for the 64bit Hurd.
  gnu: inetutils: Fix build for the 64bit Hurd.
  gnu: grub: Fix build for the 64bit Hurd.
  gnu: guile-fibers: Fix build for the 64bit Hurd.
  gnu: m4: Fix build for the 64bit Hurd.
  gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714.
  gnu: commencement: mig-boot0: Update to 1.8+git20231217..
  gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714.
  gnu: commencement: libstdc++-boot0-gcc7: Replace by
    make-libstdc++-boot0.
  gnu: gettext: Fix cross-build shebangs.
  gnu: Add gdb-15.2, with support for the 64bit Hurd.
  gnu: bootstrap: %bootstrap-glibc: Also fix libm.so.
  gnu: findutils: Disable tests on the 64bit Hurd.
  system: examples: Add bare-hurd64.tmpl.
  system: examples: Add devel-hurd64.tmpl.
  gnu: Use gcc-14, gcc-toolchain-14 on the 64bit Hurd.

 doc/guix.texi                                 |   9 +-
 gnu/local.mk                                  |  15 +
 gnu/packages/admin.scm                        |  14 +-
 gnu/packages/base.scm                         |  80 +-
 gnu/packages/bash.scm                         |  22 +
 gnu/packages/bootloaders.scm                  |   8 +
 gnu/packages/bootstrap.scm                    |  51 +-
 gnu/packages/commencement.scm                 |  24 +-
 gnu/packages/cross-base.scm                   |  18 +-
 gnu/packages/crypto.scm                       |  13 +
 gnu/packages/elf.scm                          |   6 +-
 gnu/packages/flex.scm                         |   8 +
 gnu/packages/gcc.scm                          |  15 +-
 gnu/packages/gdb.scm                          |  22 +
 gnu/packages/gettext.scm                      |  16 +-
 gnu/packages/gnupg.scm                        |  22 +-
 gnu/packages/guile-xyz.scm                    |   2 +-
 gnu/packages/guile.scm                        |  16 +-
 gnu/packages/hurd.scm                         | 195 ++--
 gnu/packages/libedit.scm                      |   8 +
 gnu/packages/libffi.scm                       |   8 +-
 gnu/packages/m4.scm                           |   9 +-
 gnu/packages/make-bootstrap.scm               |  49 +-
 gnu/packages/patches/gdb-hurd64.patch         | 923 ++++++++++++++++++
 .../glibc-hurd-pthread_setcancelstate.patch   |  92 ++
 gnu/packages/patches/glibc-hurd64-fault.patch |  32 +
 .../glibc-hurd64-intr-msg-clobber.patch       |  62 ++
 gnu/packages/patches/gnumach-version.patch    |  23 +
 gnu/packages/patches/grub-hurd64.patch        |  32 +
 gnu/packages/patches/guile-lzlib-hurd64.patch |  32 +
 gnu/packages/patches/hurd-64bit.patch         |  56 ++
 gnu/packages/patches/inetutils-hurd64.patch   |  65 ++
 .../patches/libgpg-error-hurd64.patch         |  78 ++
 .../patches/libpciaccess-hurd64.patch         |  58 ++
 gnu/packages/patches/libxcrypt-hurd64.patch   |  38 +
 gnu/packages/patches/netdde-csum.patch        |  18 +
 gnu/packages/patches/openssl-hurd64.patch     |  99 ++
 gnu/packages/patches/pciutils-hurd64.patch    |  31 +
 gnu/packages/pciutils.scm                     |  25 +-
 gnu/packages/perl.scm                         |  18 +-
 gnu/packages/ssh.scm                          |   9 +-
 gnu/packages/texinfo.scm                      |  50 +-
 gnu/packages/tls.scm                          |   9 +
 gnu/packages/version-control.scm              |   7 +-
 gnu/packages/xorg.scm                         |  23 +-
 gnu/system.scm                                |   1 -
 gnu/system/examples/bare-hurd.tmpl            |  21 +-
 gnu/system/examples/bare-hurd64.tmpl          |  70 ++
 gnu/system/examples/devel-hurd.tmpl           |  70 +-
 gnu/system/examples/devel-hurd64.tmpl         |  65 ++
 gnu/system/hurd.scm                           |  17 +
 gnu/system/images/hurd.scm                    |  72 +-
 guix/packages.scm                             |   8 +-
 guix/platforms/x86.scm                        |  11 +-
 guix/utils.scm                                |  35 +-
 m4/guix.m4                                    |  12 +-
 56 files changed, 2532 insertions(+), 260 deletions(-)
 create mode 100644 gnu/packages/patches/gdb-hurd64.patch
 create mode 100644 gnu/packages/patches/glibc-hurd-pthread_setcancelstate.patch
 create mode 100644 gnu/packages/patches/glibc-hurd64-fault.patch
 create mode 100644 gnu/packages/patches/glibc-hurd64-intr-msg-clobber.patch
 create mode 100644 gnu/packages/patches/gnumach-version.patch
 create mode 100644 gnu/packages/patches/grub-hurd64.patch
 create mode 100644 gnu/packages/patches/guile-lzlib-hurd64.patch
 create mode 100644 gnu/packages/patches/hurd-64bit.patch
 create mode 100644 gnu/packages/patches/inetutils-hurd64.patch
 create mode 100644 gnu/packages/patches/libgpg-error-hurd64.patch
 create mode 100644 gnu/packages/patches/libpciaccess-hurd64.patch
 create mode 100644 gnu/packages/patches/libxcrypt-hurd64.patch
 create mode 100644 gnu/packages/patches/netdde-csum.patch
 create mode 100644 gnu/packages/patches/openssl-hurd64.patch
 create mode 100644 gnu/packages/patches/pciutils-hurd64.patch
 create mode 100644 gnu/system/examples/bare-hurd64.tmpl
 create mode 100644 gnu/system/examples/devel-hurd64.tmpl


base-commit: 1affd2b5aa7f5467a44cf757c4fc0c6956d3f3c9
-- 
2.46.0





^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 01/51] gnu: gnumach: Update to v1.8+git20240714.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 02/51] gnu: mig: Update to 1.8+git20231217 Janneke Nieuwenhuizen
                     ` (49 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/patches/gnumach-version.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hurd.scm (gnumach-headers): Update to v1.8+git20240714 and use
it.
* gnu/packages/commencement.scm (gnumach-headers-boot0)[origin]: Reset
patches.

Change-Id: I147c64021c2ee79dfc4cd4fd9a29529eef8890c5
---
 gnu/local.mk                               |  1 +
 gnu/packages/commencement.scm              |  1 +
 gnu/packages/hurd.scm                      |  9 ++++-----
 gnu/packages/patches/gnumach-version.patch | 23 ++++++++++++++++++++++
 4 files changed, 29 insertions(+), 5 deletions(-)
 create mode 100644 gnu/packages/patches/gnumach-version.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ff6c6be5f0..cd9ad3aebb 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1463,6 +1463,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gnome-session-support-elogind.patch	\
   %D%/packages/patches/gnome-tweaks-search-paths.patch		\
   %D%/packages/patches/gnulib-bootstrap.patch			\
+  %D%/packages/patches/gnumach-version.patch			\
   %D%/packages/patches/gnupg-default-pinentry.patch		\
   %D%/packages/patches/gnupg-1-build-with-gcc10.patch		\
   %D%/packages/patches/gnutls-skip-trust-store-test.patch	\
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index ce40f0cea6..1cfaaae1e7 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2639,6 +2639,7 @@ (define gnumach-headers-boot0
      (source
       (origin
         (inherit (package-source gnumach-headers))
+        (patches '())
         (method
          (git-fetch-from-tarball
           (origin
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 9c1681f236..a22d0cadce 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -57,21 +57,20 @@ (define (hurd-source-url version)
                  version ".tar.gz"))
 
 (define-public gnumach-headers
-  (let ((revision "0")
-        (commit "2556fdece900d67529d5eda01f1bdaae4ffe96b0"))
+  (let ((commit "v1.8+git20240714"))
     (package
       (name "gnumach-headers")
-      (version (git-version "1.8" revision commit))
+      (version (string-drop commit 1))
       (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://git.savannah.gnu.org/git/hurd/gnumach.git")
                (commit commit)))
+         (patches (search-patches "gnumach-version.patch"))
          (file-name (git-file-name "gnumach" version))
          (sha256
-          (base32
-           "1lzsbix0l4jhab38pvwnmk7ip1lsn7m5smhnrciqajsqnadsnlzs"))))
+          (base32 "0ykav1kx0bgxcxw04bpcsh5s4531fzdkahjgrlsfs2h3w3vfkga0"))))
       (build-system gnu-build-system)
       (arguments
        `(#:phases
diff --git a/gnu/packages/patches/gnumach-version.patch b/gnu/packages/patches/gnumach-version.patch
new file mode 100644
index 0000000000..aec3c86a16
--- /dev/null
+++ b/gnu/packages/patches/gnumach-version.patch
@@ -0,0 +1,23 @@
+Upstream-status: Taken from Debian upstream:
+    <https://salsa.debian.org/hurd-team/gnumach/-/raw/master/debian/patches/12_version_suffix.patch>
+
+Index: gnumach/configure.ac
+===================================================================
+--- gnumach.orig/configure.ac
++++ gnumach/configure.ac
+@@ -19,6 +19,7 @@ AC_PREREQ([2.57])
+ m4_include([version.m4])
+ AC_INIT([AC_PACKAGE_NAME], [AC_PACKAGE_VERSION], [AC_PACKAGE_BUGREPORT],
+   [AC_PACKAGE_TARNAME])
++AC_SUBST([PACKAGE_VERSION_SUFFIX])
+ AC_CONFIG_SRCDIR([kern/ipc_kobject.c])
+ 
+ if test -z "${CFLAGS+set}"; then
+Index: gnumach/version.c.in
+===================================================================
+--- gnumach.orig/version.c.in
++++ gnumach/version.c.in
+@@ -1,2 +1,2 @@
+ /* @configure_input@ */
+-const char version[] = "@PACKAGE_NAME@ @PACKAGE_VERSION@";
++const char version[] = "@PACKAGE_NAME@ @PACKAGE_VERSION@@PACKAGE_VERSION_SUFFIX@";
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 02/51] gnu: mig: Update to 1.8+git20231217.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 01/51] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 03/51] gnu: hurd: Update to 0.9.git20240714 Janneke Nieuwenhuizen
                     ` (48 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (mig): Update to 1.8+git20231217.

Change-Id: I0e531ecc7fdcfbefe2e0e24d7b2fb5e0fe8a3ae2
---
 gnu/packages/hurd.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index a22d0cadce..28f39cc448 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -92,7 +92,7 @@ (define-public gnumach-headers
 (define-public mig
   (package
     (name "mig")
-    (version "1.8+git20230520")
+    (version "1.8+git20231217")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -101,7 +101,7 @@ (define-public mig
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "10r0fdjqjzqsy6ajb21rifvhw0wpjvrw6a1zdyliqlzqny5k0qlz"))))
+                "1mx7w5vzw5ws0zplm1y6s679jb1g2hjkiwl3dlk5lxys0dxs5g4g"))))
     (build-system gnu-build-system)
     ;; Flex is needed both at build and run time.
     (inputs (list gnumach-headers flex))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 03/51] gnu: hurd: Update to 0.9.git20240714.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 01/51] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 02/51] gnu: mig: Update to 1.8+git20231217 Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 04/51] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
                     ` (47 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (hurd-headers): Update to 0.9.git20240714.
(hurd)[arguments]: Remove rumpdisk build hack from "prepare-addons" stage.
Instead, when cross-compiling, add stage "fixup-cross-configure" to enable
rumpdisk.
* gnu/system.scm (hurd-multiboot-modules): Remove
"--x-xattr-translator-records" option that has been removed and is now the
default.

Change-Id: I4609b5a959c1ece98e2fe1aedbb1d31d6edadcca
---
 gnu/packages/hurd.scm | 12 +++++++++---
 gnu/system.scm        |  1 -
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 28f39cc448..06fae1bd3b 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -132,7 +132,7 @@ (define-public mig
 
 (define-public hurd-headers
   (let ((revision "3")
-        (commit "v0.9.git20231217"))
+        (commit "v0.9.git20240714"))
     (package
       (name "hurd-headers")
       (version (string-drop commit 1))
@@ -143,7 +143,7 @@ (define-public hurd-headers
                       (commit commit)))
                 (sha256
                  (base32
-                  "1d138kzhil6s5gf9di8grpz1iziakyfv037wkc8s7qyd61imm31d"))
+                  "0wvzil3llmrjg7ymwqs86d11bm5fl771jwncv7kk679lsvqca0ll"))
                 (file-name (git-file-name name version))))
       (build-system gnu-build-system)
       (native-inputs
@@ -336,7 +336,7 @@ (define-public hurd
              ;; Makefile. libdde_linux26 is built later in its own phase.
              (substitute* "Makefile"
                (("libbpf ")
-                "libbpf libmachdevdde libddekit rumpdisk"))))
+                "libbpf libmachdevdde libddekit "))))
          (add-after 'unpack 'find-tirpc
            (lambda* (#:key inputs #:allow-other-keys)
              (for-each (lambda (var)
@@ -362,6 +362,12 @@ (define-public hurd
                (("#include <rpc/pmap_prot.h>" m)
                 (string-append "#include <rpc/types.h>\n#include <rpc/xdr.h>\n" m)))
              #t))
+         ,@(if (%current-target-system)
+               '((add-after 'configure 'fixup-cross-configure
+                   (lambda _
+                     (substitute* "config.make"
+                       (("HAVE_LIBRUMP = no") "HAVE_LIBRUMP = yes")))))
+               '())
          (add-before 'build 'pre-build
            (lambda _
              ;; Don't change the ownership of any file at this time.
diff --git a/gnu/system.scm b/gnu/system.scm
index 074cd04a0e..dfcb8fb279 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1539,7 +1539,6 @@ (define (hurd-multiboot-modules os)
                 "--multiboot-command-line='${kernel-command-line}'"
                 "--exec-server-task='${exec-task}'"
                 "--store-type=typed"
-                "--x-xattr-translator-records"
                 "'${root}'"
                 "'$(fs-task=task-create)'"))
          (target (%current-target-system))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 04/51] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (2 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 03/51] gnu: hurd: Update to 0.9.git20240714 Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 05/51] gnu: cross-libc: Support cross-building for the " Janneke Nieuwenhuizen
                     ` (46 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290
  Cc: Andreas Enge, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Simon Tournier,
	Tobias Geerinckx-Rice

* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Update comment on where
to find shared linker name.
(make-raw-bag): Also use raw-build-guile3 when building for the 64bit Hurd.
* gnu/packages/cross-base.scm (cross-kernel-headers*): Use target-hurd?
instead of custom "i586..."  matching to also use xhurd-core-headers for
target-hurd64.
* gnu/packages/make-bootstrap.scm (package-with-relocatable-glibc)
[native-inputs]: Move final-inputs before cross-packages.
(%binutils-static)[arguments]: When building for the 64bit Hurd, add
"lt_cv_prog_compiler_static_works=yes", "lt_cv_prog_compiler_static_works_CXX=yes"
to #:make-flags to convince to actually link the binaries statically.
(make-guile-static)[arguments]: When building for the 64bit Hurd, add
"lt_cv_prog_compiler_static_works=yes" to #:configure-flags to convince
libtool to actually link guile statically.
* guix/platforms/x86.scm (x86_64-gnu): New exported variable.
* guix/utils.scm (target-hurd64? system-hurd64?): New procedures.
---
 gnu/packages/bootstrap.scm      |  3 ++-
 gnu/packages/cross-base.scm     |  6 +++---
 gnu/packages/make-bootstrap.scm | 24 +++++++++++++++++-------
 guix/platforms/x86.scm          | 11 ++++++++++-
 guix/utils.scm                  | 15 ++++++++++++++-
 5 files changed, 46 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 3743abf9fe..33cbaa30ae 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -558,7 +558,8 @@ (define* (make-raw-bag name
     (name name)
     (system system)
     (build-inputs inputs)
-    (build (cond ((target-riscv64?)
+    (build (cond ((or (target-riscv64?)
+                      (target-hurd64?))
                   raw-build-guile3)
                  (else raw-build)))))
 
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 5781341a87..83672ab383 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -641,9 +641,9 @@ (define* (cross-kernel-headers* target
                 ("hurd-headers" ,xhurd-headers)
                 ("hurd-minimal" ,xhurd-minimal)))))
 
-  (match target
-    ((or "i586-pc-gnu" "i586-gnu") xhurd-core-headers)
-    (_ xlinux-headers)))
+  (if (target-hurd? target)
+      xhurd-core-headers
+      xlinux-headers))
 
 (define* (cross-libc . args)
   (if (or (= (length args) 1) (contains-keyword? args))
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index edc536bff4..689d48d342 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -145,7 +145,10 @@ (define (package-with-relocatable-glibc p)
                       target
                       #:xbinutils (cross-binutils target)
                       #:libc (cross-bootstrap-libc target))))
-          `(("cross-gcc" ,(package
+          `(,@(%final-inputs)
+            ;; As versions for gcc and cross-gcc can differ, make sure to have
+            ;; cross-gcc behind gcc in CPLUS_INCLUDE_PATH.
+            ("cross-gcc" ,(package
                             (inherit xgcc)
                             (search-paths
                              ;; Ensure the cross libc headers appears on the
@@ -154,8 +157,7 @@ (define (package-with-relocatable-glibc p)
                                     (variable "CROSS_CPLUS_INCLUDE_PATH")
                                     (files '("include")))
                                    (package-search-paths gcc)))))
-            ("cross-binutils" ,(cross-binutils target))
-            ,@(%final-inputs)))
+            ("cross-binutils" ,(cross-binutils target))))
         `(("libc" ,(glibc-for-bootstrap glibc))
           ("libc:static" ,(glibc-for-bootstrap glibc) "static")
           ("gcc" ,(gcc-for-bootstrap glibc))
@@ -395,10 +397,15 @@ (define %binutils-static
                        ((#:configure-flags flags _ ...)
                         flags)))
            #:make-flags
-           (match (memq #:make-flags (package-arguments binutils))
-             ((#:make-flags flags _ ...)
-              flags)
-             (_ #~'()))
+           #~(append
+              #$(if (target-hurd64?)
+                    #~'("lt_cv_prog_compiler_static_works=yes"
+                        "lt_cv_prog_compiler_static_works_CXX=yes")
+                    #~'())
+              #$(match (memq #:make-flags (package-arguments binutils))
+                  ((#:make-flags flags _ ...)
+                   flags)
+                  (_ #~'())))
            #:strip-flags #~'("--strip-all")
            #:phases
            #~(modify-phases %standard-phases
@@ -642,6 +649,9 @@ (define* (make-guile-static guile patches)
 
                   #$@(if (target-hurd?)
                          #~("--disable-jit")
+                         #~())
+                  #$@(if (target-hurd64?)
+                         #~("lt_cv_prog_compiler_static_works=yes")
                          #~())))
          ((#:phases phases '%standard-phases)
           #~(modify-phases #$phases
diff --git a/guix/platforms/x86.scm b/guix/platforms/x86.scm
index 0c8fc7296c..5617e6dd68 100644
--- a/guix/platforms/x86.scm
+++ b/guix/platforms/x86.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
 ;;; Copyright © 2023, 2024 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,7 +26,8 @@ (define-module (guix platforms x86)
             x86_64-linux-x32
             i686-mingw
             x86_64-mingw
-            i586-gnu))
+            i586-gnu
+            x86_64-gnu))
 
 (define i686-linux
   (platform
@@ -71,3 +73,10 @@ (define i586-gnu
    (system "i586-gnu")
    (rust-target "i686-unknown-hurd-gnu")
    (glibc-dynamic-linker "/lib/ld.so.1")))
+
+(define x86_64-gnu
+  (platform
+   (target "x86_64-pc-gnu")
+   (system "x86_64-gnu")
+   (rust-target "x86_64-unknown-hurd-gnu")
+   (glibc-dynamic-linker "/lib/ld-x86-64.so.1")))
diff --git a/guix/utils.scm b/guix/utils.scm
index f161cb4ef3..e100c03365 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -17,7 +17,7 @@
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
 ;;; Copyright © 2023 Philip McGrath <philip@philipmcgrath.com>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com>
 ;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
@@ -94,6 +94,8 @@ (define-module (guix utils)
             target-linux?
             target-hurd?
             system-hurd?
+            target-hurd64?
+            system-hurd64?
             target-mingw?
             target-x86-32?
             target-x86-64?
@@ -716,6 +718,17 @@ (define* (system-hurd?)
   "Is the current system the GNU(/Hurd) system?"
   (and=> (%current-system) target-hurd?))
 
+(define* (target-hurd64? #:optional (target (or (%current-target-system)
+                                                (%current-system))))
+  "Does TARGET represent the 64bit GNU(/Hurd) system?"
+  (and (target-hurd?)
+       (target-64bit? target)))
+
+(define* (system-hurd64?)
+  "Is the current system the 64bit GNU(/Hurd) system?"
+  (and (system-hurd?)
+       (target-64bit? (%current-system))))
+
 (define* (target-mingw? #:optional (target (%current-target-system)))
   "Is the operating system of TARGET Windows?"
   (and target
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 05/51] gnu: cross-libc: Support cross-building for the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (3 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 04/51] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 06/51] gnu: bash-minimal: Support [cross-]build with gcc-14 Janneke Nieuwenhuizen
                     ` (45 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/base.scm (glibc)[arguments]: When building for the Hurd, in
phase "create-machine-symlink", do not assume CPU is i386, also cater for
x86_64.
* gnu/packages/cross-base.scm (cross-libc*)[arguments]: Likewise.

Change-Id: Ib009b7bd301b543b8629382330cca9d963b7a812
---
 gnu/packages/base.scm       | 9 +++++++--
 gnu/packages/bootstrap.scm  | 2 +-
 gnu/packages/cross-base.scm | 8 ++++++--
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 90c25b54e1..02ef71f20d 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1079,7 +1079,7 @@ (define-public glibc
                                (string-append locale "/C.UTF-8")))))
 
                  ,@(if (target-hurd?)
-                       '((add-after 'install 'augment-libc.so
+                       `((add-after 'install 'augment-libc.so
                            (lambda* (#:key outputs #:allow-other-keys)
                              (let ((out (assoc-ref outputs "out")))
                                (substitute* (string-append out "/lib/libc.so")
@@ -1089,7 +1089,12 @@ (define-public glibc
                          (add-after 'install 'create-machine-symlink
                            (lambda* (#:key outputs #:allow-other-keys)
                              (let* ((out (assoc-ref outputs "out"))
-                                    (cpu "i386")
+                                    (cpu ,(match (or (%current-target-system)
+                                                     (%current-system))
+                                            ((? target-x86-32?)
+                                             "i386")
+                                            ((? target-x86-64?)
+                                             "x86_64")))
                                     (machine (string-append
                                               out "/include/mach/machine")))
                                (unless (file-exists? machine)
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 33cbaa30ae..27798fe278 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -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/cross-base.scm b/gnu/packages/cross-base.scm
index 83672ab383..4961b3b4c0 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -738,7 +738,7 @@ (define* (cross-libc* target
                (delete 'install-utf8-c-locale)
 
                ,@(if (target-hurd? target)
-                     '((add-after 'install 'augment-libc.so
+                     `((add-after 'install 'augment-libc.so
                          (lambda* (#:key outputs #:allow-other-keys)
                            (let ((out (assoc-ref outputs "out")))
                              (substitute* (string-append out "/lib/libc.so")
@@ -748,7 +748,11 @@ (define* (cross-libc* target
                        (add-after 'install 'create-machine-symlink
                          (lambda* (#:key outputs #:allow-other-keys)
                            (let* ((out (assoc-ref outputs "out"))
-                                  (cpu "i386")
+                                  (cpu ,(match target
+                                          ((? target-x86-32?)
+                                           "i386")
+                                          ((? target-x86-64?)
+                                           "x86_64")))
                                   (machine (string-append
                                             out "/include/mach/machine")))
                              (unless (file-exists? machine)
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 06/51] gnu: bash-minimal: Support [cross-]build with gcc-14.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (4 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 05/51] gnu: cross-libc: Support cross-building for the " Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 07/51] gnu: elfutils: Fix build for 64bit Hurd Janneke Nieuwenhuizen
                     ` (44 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/bash-minimal.scm (bash)[arguments]: When building for the 64bit
hurd, or cross-building, use "CFLAGS=-g -O2 -Wno-implicit-function-declaration".

Change-Id: I1356c0aeac303bdf0254c28815716c83884008a0
---
 gnu/packages/bash.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index 93641a78d5..56918d79bd 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
 ;;; Copyright © 2021 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2024 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -251,6 +252,13 @@ (define-public bash-minimal
                ;; modules and related code.
                "ac_cv_func_dlopen=no"
 
+               ,@(if (or (target-hurd64?) (%current-target-system))
+                     ;; gcc-14 implictly uses -Wimplicit-function-declaration
+                     ;; which together with -Werror causes:
+                     ;; ./enable.def:492:11: error: implicit declaration of function ‘dlclose’;
+                     '("CFLAGS=-g -O2 -Wno-implicit-function-declaration")
+                     '())
+
                ,@(if (%current-target-system)
                      '("bash_cv_job_control_missing=no"
                        "bash_cv_getcwd_malloc=yes")
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 07/51] gnu: elfutils: Fix build for 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (5 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 06/51] gnu: bash-minimal: Support [cross-]build with gcc-14 Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 08/51] gnu: grep: Fix build for the " Janneke Nieuwenhuizen
                     ` (43 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/elf.scm (elfutils)[arguments]: When building for a 64bit Hurd,
set #:make-flags.

Change-Id: I00abf360a7de5b1f78c1e912f0dcf27c62c1af68
---
 gnu/packages/elf.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm
index 119f8d13dd..81a753a483 100644
--- a/gnu/packages/elf.scm
+++ b/gnu/packages/elf.scm
@@ -10,7 +10,7 @@
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2021 Leo Le Bouter <lle-bout@zaclys.net>
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -86,6 +86,10 @@ (define-public elfutils
                                "--disable-libdebuginfod"
                                "--disable-debuginfod")
 
+       ,@(if (target-hurd64?)
+             '(#:make-flags '("core-file_no_Werror=yes"))
+             '())
+
        ;; Disable tests on MIPS and PowerPC (without changing
        ;; the arguments list on other systems).
        ,@(if (any (cute string-prefix? <> (or (%current-target-system)
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 08/51] gnu: grep: Fix build for the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (6 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 07/51] gnu: elfutils: Fix build for 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 09/51] gnu: patch: " Janneke Nieuwenhuizen
                     ` (42 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/base.scm (grep)[arguments]: When building for the 64bit Hurd,
add patch-sigsegv.h stage.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/packages/base.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 02ef71f20d..010be631d7 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -154,6 +154,13 @@ (define-public grep
                                        (string-append bin "/fgrep"))
                       (("^exec grep")
                        (string-append "exec " bin "/grep"))))))
+              #$@(if (target-hurd64?)
+                     #~((add-after 'unpack 'patch-sigsegv
+                          (lambda _
+                            ;; Stack overflow recovery does not compile
+                            (substitute* "lib/sigsegv.in.h"
+                              (("__GNU__") "__XGNU__")))))
+                     #~())
               #$@(if (system-hurd?)
                      #~((add-before 'check 'skip-test
                           (lambda _
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 09/51] gnu: patch: Fix build for the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (7 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 08/51] gnu: grep: Fix build for the " Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 10/51] gnu: libxcrypt: Support " Janneke Nieuwenhuizen
                     ` (41 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/base.scm (patch)[arguments]: When building for the 64bit Hurd,
set #:configure-flags.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/packages/base.scm | 49 ++++++++++++++++++++++++-------------------
 1 file changed, 28 insertions(+), 21 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 010be631d7..83f8c0d9e9 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -339,27 +339,34 @@ (define-public patch
                   "1bk38169c0xh01b0q0zmnrjqz8k9byz3arp4q7q66sn6xwf94nvz"))
                 (patches (search-patches "patch-hurd-path-max.patch"))))
       (arguments
-       (substitute-keyword-arguments (package-arguments base)
-         ((#:phases phases '%standard-phases)
-          #~(modify-phases #$phases
-              (add-after 'unpack 'copy-gnulib-sources
-                (lambda _
-                  ;; XXX: We copy the source instead of using 'gnulib' as a
-                  ;; native input to avoid introducing a dependency cycle.
-                  (copy-recursively #+gnulib "gnulib")
-                  (setenv "GNULIB_SRCDIR"
-                          (string-append (getcwd) "/gnulib/src/gnulib"))))
-              (add-after 'copy-gnulib-sources 'update-bootstrap-script
-                (lambda _
-                  (copy-file "gnulib/src/gnulib/build-aux/bootstrap"
-                             "bootstrap")))
-              (add-after 'unpack 'patch-configure.ac
-                (lambda _
-                  (substitute* "configure.ac"
-                    ;; The gnulib-provided git-version-gen script has a plain
-                    ;; shebang of #!/bin/sh; avoid using it.
-                    (("build-aux/git-version-gen" all)
-                     (string-append "sh " all)))))))))
+       (let ((arguments
+         (substitute-keyword-arguments (package-arguments base)
+           ((#:phases phases '%standard-phases)
+            #~(modify-phases #$phases
+                (add-after 'unpack 'copy-gnulib-sources
+                  (lambda _
+                    ;; XXX: We copy the source instead of using 'gnulib' as a
+                    ;; native input to avoid introducing a dependency cycle.
+                    (copy-recursively #+gnulib "gnulib")
+                    (setenv "GNULIB_SRCDIR"
+                            (string-append (getcwd) "/gnulib/src/gnulib"))))
+                (add-after 'copy-gnulib-sources 'update-bootstrap-script
+                  (lambda _
+                    (copy-file "gnulib/src/gnulib/build-aux/bootstrap"
+                               "bootstrap")))
+                (add-after 'unpack 'patch-configure.ac
+                  (lambda _
+                    (substitute* "configure.ac"
+                      ;; The gnulib-provided git-version-gen script has a plain
+                      ;; shebang of #!/bin/sh; avoid using it.
+                      (("build-aux/git-version-gen" all)
+                       (string-append "sh " all))))))))))
+         (if (target-hurd64?)
+             (substitute-keyword-arguments arguments
+               ((#:configure-flags flags '())
+                #~(list "--disable-threads"
+                        "gl_cv_func_working_mktime=yes")))
+             arguments)))
       (native-inputs (list autoconf automake bison ed))
       (properties '()))))
 
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 10/51] gnu: libxcrypt: Support the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (8 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 09/51] gnu: patch: " Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 11/51] gnu: libstdc++: " Janneke Nieuwenhuizen
                     ` (40 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/libxcrypt-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/crypto.scm (libxcrypt)[arguments]: When building for the 64bit
Hurd, use it in new phase `apply-hurd64-patch'.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/local.mk                                |  1 +
 gnu/packages/crypto.scm                     | 13 +++++++
 gnu/packages/patches/libxcrypt-hurd64.patch | 38 +++++++++++++++++++++
 3 files changed, 52 insertions(+)
 create mode 100644 gnu/packages/patches/libxcrypt-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index cd9ad3aebb..9a775cc160 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1730,6 +1730,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libvpx-CVE-2016-2818.patch		\
   %D%/packages/patches/libvpx-CVE-2023-5217.patch		\
   %D%/packages/patches/libvpx-CVE-2023-44488.patch		\
+  %D%/packages/patches/libxcrypt-hurd64.patch			\
   %D%/packages/patches/libxml2-xpath0-Add-option-xpath0.patch	\
   %D%/packages/patches/libwpd-gcc-compat.patch			\
   %D%/packages/patches/libxslt-generated-ids.patch		\
diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index 2a298c4caf..9ef1a53fa6 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -27,6 +27,7 @@
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;; Copyright © 2023 Ivan Vilata-i-Balaguer <ivan@selidor.net>
 ;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1661,6 +1662,18 @@ (define-public libxcrypt
     (build-system gnu-build-system)
     (native-inputs
      (list perl))
+    (arguments
+     (if (target-hurd64?)
+         (list
+          #:phases
+          #~(modify-phases %standard-phases
+              (add-after 'unpack 'apply-hurd64-patch
+                (lambda _
+                  (let ((patch
+                         #$(local-file
+                            (search-patch "libxcrypt-hurd64.patch"))))
+                    (invoke "patch" "--force" "-p1" "-i" patch))))))
+              '()))
     (synopsis
      "Extended crypt library for descrypt, md5crypt, bcrypt, and others")
     (description
diff --git a/gnu/packages/patches/libxcrypt-hurd64.patch b/gnu/packages/patches/libxcrypt-hurd64.patch
new file mode 100644
index 0000000000..9fc3018539
--- /dev/null
+++ b/gnu/packages/patches/libxcrypt-hurd64.patch
@@ -0,0 +1,38 @@
+Upstream-status: Taken from upstream:
+    <https://github.com/besser82/libxcrypt/commit/b2c1da2e1ce2d3e72f511f5bc94a6ffa68b70917>
+
+From b2c1da2e1ce2d3e72f511f5bc94a6ffa68b70917 Mon Sep 17 00:00:00 2001
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date: Sun, 14 Jul 2024 13:13:07 +0200
+Subject: [PATCH] Add binary compatibility for x86_64 GNU/Hurd
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+
+diff --git a/lib/libcrypt.map.in b/lib/libcrypt.map.in
+index 88ea911..a56b7bf 100644
+--- a/lib/libcrypt.map.in
++++ b/lib/libcrypt.map.in
+@@ -43,5 +43,5 @@ fcrypt			-		GLIBC_2.0
+ %chain GLIBC_2.0 GLIBC_2.2 GLIBC_2.2.1 GLIBC_2.2.2 GLIBC_2.2.5 GLIBC_2.2.6
+ %chain GLIBC_2.3 GLIBC_2.4 GLIBC_2.12 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18
+ %chain GLIBC_2.21 GLIBC_2.27 GLIBC_2.29 GLIBC_2.32 GLIBC_2.33 GLIBC_2.35
+-%chain GLIBC_2.36
++%chain GLIBC_2.36 GLIBC_2.38
+ %chain OW_CRYPT_1.0 XCRYPT_2.0 XCRYPT_4.3 XCRYPT_4.4
+diff --git a/lib/libcrypt.minver b/lib/libcrypt.minver
+index 8478077..c5a5bf2 100644
+--- a/lib/libcrypt.minver
++++ b/lib/libcrypt.minver
+@@ -51,6 +51,7 @@
+ #VERSION     SYSTEM          CPU_FAMILY    PREPROCESSOR_CHECK
+ 
+ # GNU Hurd
++GLIBC_2.38   gnu             x86_64
+ GLIBC_2.2.6  gnu             i[3-9]86
+ ERROR        gnu             .
+ 
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 11/51] gnu: libstdc++: Support the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (9 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 10/51] gnu: libxcrypt: Support " Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 12/51] gnu: glibc/hurd: Add patches for " Janneke Nieuwenhuizen
                     ` (39 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/gcc.scm (make-libstdc++)[arguments]: When building for the
64bit Hurd, add stage patch-hurd64.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/packages/gcc.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index c9e475b676..64ba37fd69 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -1024,7 +1024,15 @@ (define-public (make-libstdc++ gcc)
                   (("/lib64") "/lib")))))
           (add-before 'configure 'chdir
             (lambda _
-              (chdir "libstdc++-v3"))))
+              (chdir "libstdc++-v3")))
+          #$@(let ((version (package-version gcc)))
+               (if (target-hurd64?)
+                   #~((add-after 'unpack 'patch-hurd64
+                        (lambda _
+                          (substitute* "libstdc++-v3/src/c++20/tzdb.cc"
+                            (("#if ! defined _GLIBCXX_ZONEINFO_DIR")
+                             "#if __GNU__ || ! defined _GLIBCXX_ZONEINFO_DIR")))))
+                   '())))
 
       #:configure-flags '`("--disable-libstdcxx-pch"
                            ,(string-append "--with-gxx-include-dir="
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 12/51] gnu: glibc/hurd: Add patches for the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (10 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 11/51] gnu: libstdc++: " Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 13/51] gnu: bash: Avoid hang when cross-built for the Hurd Janneke Nieuwenhuizen
                     ` (38 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

These patches fix:

  * Statically linked tar to hang/segfault upon issuing the "--mtime=@1"
  warning; this is also applicable for the 32bit Hurd using glibc-2.39!

See <https://lists.gnu.org/archive/html/bug-hurd/2024-11/msg00115.html>.

  * Shell replacement problems for the 64bit Hurd.

See <https://lists.debian.org/debian-hurd/2024/07/msg00063.html>.

* gnu/packages/patches/glibc-hurd-pthread_setcancelstate.patch,
gnu/packages/patches/glibc-hurd64-fault.patch,
gnu/packages/patches/glibc-hurd64-intr-msg-clobber.patch: New files.
* gnu/local.mk (dist_patch_DATA): Register them.
* gnu/packages/base.scm (glibc/hurd): Use them.

Change-Id: I9ee65983876cd22ad1dc01aabb41a34074631599
---
 gnu/local.mk                                  |  3 +
 gnu/packages/base.scm                         | 11 ++-
 .../glibc-hurd-pthread_setcancelstate.patch   | 92 +++++++++++++++++++
 gnu/packages/patches/glibc-hurd64-fault.patch | 32 +++++++
 .../glibc-hurd64-intr-msg-clobber.patch       | 62 +++++++++++++
 5 files changed, 199 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/glibc-hurd-pthread_setcancelstate.patch
 create mode 100644 gnu/packages/patches/glibc-hurd64-fault.patch
 create mode 100644 gnu/packages/patches/glibc-hurd64-intr-msg-clobber.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 9a775cc160..eb50df6e13 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1439,7 +1439,10 @@ dist_patch_DATA =						\
   %D%/packages/patches/glibc-hurd-getauxval.patch		\
   %D%/packages/patches/glibc-hurd-gettyent.patch		\
   %D%/packages/patches/glibc-hurd-mach-print.patch		\
+  %D%/packages/patches/glibc-hurd-pthread_setcancelstate.patch	\
   %D%/packages/patches/glibc-hurd-signal-sa-siginfo.patch	\
+  %D%/packages/patches/glibc-hurd64-fault.patch			\
+  %D%/packages/patches/glibc-hurd64-intr-msg-clobber.patch	\
   %D%/packages/patches/glibc-ldd-powerpc.patch			\
   %D%/packages/patches/glibc-ldd-x86_64.patch			\
   %D%/packages/patches/glibc-locales.patch			\
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 83f8c0d9e9..bab1f258c6 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1588,7 +1588,16 @@ (define-public which
 command.")
     (license gpl3+))) ; some files are under GPLv2+
 
-(define-public glibc/hurd glibc)
+(define-public glibc/hurd
+  (package/inherit glibc
+    (source
+     (origin
+       (inherit (package-source glibc))
+       (patches
+        (append (origin-patches (package-source glibc))
+                (search-patches "glibc-hurd-pthread_setcancelstate.patch"
+                                "glibc-hurd64-fault.patch"
+                                "glibc-hurd64-intr-msg-clobber.patch")))))))
 
 (define-public glibc/hurd-headers
   (package/inherit glibc/hurd
diff --git a/gnu/packages/patches/glibc-hurd-pthread_setcancelstate.patch b/gnu/packages/patches/glibc-hurd-pthread_setcancelstate.patch
new file mode 100644
index 0000000000..1d7c81b98e
--- /dev/null
+++ b/gnu/packages/patches/glibc-hurd-pthread_setcancelstate.patch
@@ -0,0 +1,92 @@
+Upstream-status: Taken from <https://salsa.debian.org/glibc-team/glibc/-/blob/25a0a47767fe7dc5151eb36afaade17218728efe/debian/patches/hurd-i386/local-static_pthread_setcancelstate.diff>.
+
+This is needed for the 64bit Hurd statically linked tar non to hang when
+issuing a warning.
+
+since the move of libpthread functions to libc, glibc dropped the use
+of __libc_ptf_call. But htl hasn't made the move yet, so we have to use
+__libc_ptf_call there for now.
+
+Index: glibc-2.36/misc/error.c
+===================================================================
+--- glibc-2.36.orig/misc/error.c
++++ glibc-2.36/misc/error.c
+@@ -240,7 +240,8 @@ __error_internal (int status, int errnum
+   /* We do not want this call to be cut short by a thread
+      cancellation.  Therefore disable cancellation for now.  */
+   int state = PTHREAD_CANCEL_ENABLE;
+-  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
++  __libc_ptf_call (__pthread_setcancelstate,
++		   (PTHREAD_CANCEL_DISABLE, &state), 0);
+ #endif
+ 
+   flush_stdout ();
+@@ -262,7 +263,7 @@ __error_internal (int status, int errnum
+ 
+ #ifdef _LIBC
+   _IO_funlockfile (stderr);
+-  __pthread_setcancelstate (state, NULL);
++  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
+ #endif
+ }
+ 
+@@ -306,7 +307,9 @@ __error_at_line_internal (int status, in
+   /* We do not want this call to be cut short by a thread
+      cancellation.  Therefore disable cancellation for now.  */
+   int state = PTHREAD_CANCEL_ENABLE;
+-  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
++  __libc_ptf_call (__pthread_setcancelstate,
++		   (PTHREAD_CANCEL_DISABLE, &state),
++		   0);
+ #endif
+ 
+   flush_stdout ();
+@@ -336,7 +339,7 @@ __error_at_line_internal (int status, in
+ 
+ #ifdef _LIBC
+   _IO_funlockfile (stderr);
+-  __pthread_setcancelstate (state, NULL);
++  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
+ #endif
+ }
+ 
+Index: glibc-2.36/libio/iopopen.c
+===================================================================
+--- glibc-2.36.orig/libio/iopopen.c
++++ glibc-2.36/libio/iopopen.c
+@@ -281,9 +281,10 @@ _IO_new_proc_close (FILE *fp)
+   do
+     {
+       int state;
+-      __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
++      __libc_ptf_call (__pthread_setcancelstate,
++		       (PTHREAD_CANCEL_DISABLE, &state), 0);
+       wait_pid = __waitpid (((_IO_proc_file *) fp)->pid, &wstatus, 0);
+-      __pthread_setcancelstate (state, NULL);
++      __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
+     }
+   while (wait_pid == -1 && errno == EINTR);
+   if (wait_pid == -1)
+Index: glibc-2.36/stdlib/fmtmsg.c
+===================================================================
+--- glibc-2.36.orig/stdlib/fmtmsg.c
++++ glibc-2.36/stdlib/fmtmsg.c
+@@ -124,7 +124,8 @@ fmtmsg (long int classification, const c
+   /* We do not want this call to be cut short by a thread
+      cancellation.  Therefore disable cancellation for now.  */
+   int state = PTHREAD_CANCEL_ENABLE;
+-  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
++  __libc_ptf_call (__pthread_setcancelstate,
++		   (PTHREAD_CANCEL_DISABLE, &state), 0);
+ 
+   __libc_lock_lock (lock);
+ 
+@@ -193,7 +194,7 @@ fmtmsg (long int classification, const c
+ 
+   __libc_lock_unlock (lock);
+ 
+-  __pthread_setcancelstate (state, NULL);
++  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
+ 
+   return result;
+ }
diff --git a/gnu/packages/patches/glibc-hurd64-fault.patch b/gnu/packages/patches/glibc-hurd64-fault.patch
new file mode 100644
index 0000000000..24980e8c2a
--- /dev/null
+++ b/gnu/packages/patches/glibc-hurd64-fault.patch
@@ -0,0 +1,32 @@
+Upstream-status: Taken from: <https://salsa.debian.org/glibc-team/glibc/-/blob/c36c87acb1a35d6e06db6cef1e28cf2f405e1a9e/debian/patches/hurd-i386/git-fault-64bit.diff>.
+
+See <https://lists.gnu.org/archive/html/bug-hurd/2024-11/msg00115.html>.
+
+commit 11ad033e1c09c8b8e7bbaa72420f41ab8bcf0f63
+Author: Flavio Cruz <flaviocruz@gmail.com>
+Date:   Tue Jul 30 00:51:20 2024 -0400
+
+    x86_64 hurd: ensure we have a large enough buffer to receive exception_raise requests.
+    
+    Message-ID: <gtxd6s4s7fi7hdrlb7zayq3akij7x6jqawwq3zfl3v4nqspulo@euucuzeonrl6>
+
+diff --git a/hurd/hurdfault.c b/hurd/hurdfault.c
+index 5110c6030f..1fe973f54d 100644
+--- a/hurd/hurdfault.c
++++ b/hurd/hurdfault.c
+@@ -121,7 +121,14 @@ faulted (void)
+   struct
+     {
+       mach_msg_header_t head;
+-      char buf[64];
++        /* This is the size of the exception_raise request
++         * including mach_msg_header_t.
++         * See generated code in faultexc_server.c.  */
++#ifdef __LP64__
++        char buf[112];
++#else
++        char buf[64];
++#endif
+     } request;
+   mig_reply_header_t reply;
+   extern int _hurdsig_fault_exc_server (mach_msg_header_t *,
diff --git a/gnu/packages/patches/glibc-hurd64-intr-msg-clobber.patch b/gnu/packages/patches/glibc-hurd64-intr-msg-clobber.patch
new file mode 100644
index 0000000000..600f89a711
--- /dev/null
+++ b/gnu/packages/patches/glibc-hurd64-intr-msg-clobber.patch
@@ -0,0 +1,62 @@
+Upstream-status: Taken from <https://salsa.debian.org/glibc-team/glibc/-/blob/c36c87acb1a35d6e06db6cef1e28cf2f405e1a9e/debian/patches/hurd-i386/git-intr-msg-clobber.diff>.
+
+See <https://lists.gnu.org/archive/html/bug-hurd/2024-11/msg00115.html>,
+and <https://lists.debian.org/debian-hurd/2024/07/msg00063.html>.
+
+Commited for 2.40
+
+commit c8b4ce0b368115714bd4cce131e1683759471099
+Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date:   Sat Jul 13 17:00:55 2024 +0200
+
+    hurd: Fix restoring message to be retried
+    
+    save_data stores the start of the original message to be retried,
+    overwritten by the EINTR reply. In 64b builds the overwrite is however
+    rounded up to the 64b pointer size, so we have to save more than just
+    the 32b err.
+    
+    Thanks a lot to Luca Dariz for the investigation!
+
+diff --git a/hurd/intr-msg.c b/hurd/intr-msg.c
+index 2c2e7dc463..424c1fc700 100644
+--- a/hurd/intr-msg.c
++++ b/hurd/intr-msg.c
+@@ -42,7 +42,10 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
+   struct clobber
+   {
+     mach_msg_type_t type;
+-    error_t err;
++    union {
++      error_t err;
++      uintptr_t align;
++    };
+   };
+   union msg
+   {
+
+Taken from: <https://salsa.debian.org/glibc-team/glibc/-/blob/027f94215a633cbf53794d4b48675fde36706e35/debian/patches/hurd-i386/local-intr-msg-clobber.diff>
+
+Force putting save_data on the stack rather than in SSE register
+
+The signal management does not yet properly save SSE state, so that save_data
+would get overwritten by signal handlers, notably leading to `` shell
+replacement getting empty content because then the io_read RPC retry gets an
+MIG_BAD_ARGUMENTS error.
+
+XXX: This is only temporary to fix the common shll replacement issue, and is
+waiting for proper SSE state restoration.
+
+Index: glibc-2.38/hurd/intr-msg.c
+===================================================================
+--- glibc-2.38.orig/hurd/intr-msg.c
++++ glibc-2.38/hurd/intr-msg.c
+@@ -79,7 +79,7 @@ _hurd_intr_rpc_mach_msg (mach_msg_header
+   mach_msg_bits_t msgh_bits;
+   mach_port_t remote_port;
+   mach_msg_id_t msgid;
+-  struct clobber save_data;
++  volatile struct clobber save_data;
+ 
+   if ((option & (MACH_SEND_MSG|MACH_RCV_MSG)) != (MACH_SEND_MSG|MACH_RCV_MSG)
+       || _hurd_msgport_thread == MACH_PORT_NULL)
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 13/51] gnu: bash: Avoid hang when cross-built for the Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (11 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 12/51] gnu: glibc/hurd: Add patches for " Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 14/51] gnu: git-minimal: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
                     ` (37 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

For example, without this patch bash hangs while configuring diffutils.
Reproducer:

cat >x.awk <<EOF
x... repeat 16384 (the actual pipe size) times
EOF

* gnu/packages/bash.scm (bash): When cross-building for the Hurd, add new
"create-pipesize.h" stage.

Change-Id: I02c1dcf2d63849626ba3448cd52766db822dc77c
---
 gnu/packages/bash.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index 56918d79bd..642a405985 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -175,6 +175,20 @@ (define-public bash
 
         #:phases
         (modify-phases %standard-phases
+          ,@(if (and (target-hurd?) (not (system-hurd?)))
+                `((add-after 'configure 'create-pipesize.h
+                    ;; The Bash Makefile mentions how PIPESIZE calculation is
+                    ;; "technically wrong" when cross-compiling, and offers no
+                    ;; way to override it.  On the 64bit Hurd, it can make
+                    ;; bash hang.
+                    (lambda _
+                      (with-directory-excursion "builtins"
+                        (with-output-to-file "psize.aux"
+                          (lambda _ (display "dummy to pacify make\n")))
+                        (with-output-to-file "pipesize.h"
+                          (lambda _ (display "#define PIPESIZE 16384\n")))))))
+                '())
+
           (add-after 'install 'install-sh-symlink
             (lambda* (#:key outputs #:allow-other-keys)
               ;; Add a `sh' -> `bash' link.
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 14/51] gnu: git-minimal: Support [cross-]build with gcc-14 and the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (12 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 13/51] gnu: bash: Avoid hang when cross-built for the Hurd Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 15/51] gnu: flex: Fix [cross-]build with gcc-14 Janneke Nieuwenhuizen
                     ` (36 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/version-control.scm (git-minimal)[arguments]: When building for
the 64bit Hurd, or cross-compiling, use "-Wno-implicit-function-declaration"
in #:make-flags.  Use target-hurd? instead of comparing with "i586-pc-gnu" in
"use-host-uname_S" phase.

Change-Id: Ib9836be8a1e389a82c8a89adf22aaeac0d85bd14
---
 gnu/packages/version-control.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index c892a83a98..ca77b485ad 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -296,7 +296,10 @@ (define-public git-minimal
               ;; By default 'make install' creates hard links for
               ;; things in 'libexec/git-core', which leads to huge
               ;; nars; see <https://bugs.gnu.org/21949>.
-              "NO_INSTALL_HARDLINKS=indeed")
+              "NO_INSTALL_HARDLINKS=indeed"
+              #$@(if (or (target-hurd64?) (%current-target-system))
+                     #~("-Wno-implicit-function-declaration")
+                     #~()))
       #:phases
       #~(modify-phases %standard-phases
           #$@(if (%current-target-system)
@@ -305,7 +308,7 @@ (define-public git-minimal
                       (lambda _
                         (substitute* "config.mak.uname"
                           (("uname_S := .*" all)
-                           (if (equal? #$(%current-target-system) "i586-pc-gnu")
+                           (if #$(target-hurd?)
                                "uname_S := GNU\n"
                                all))))))
                  ;; We do not have a full bash when cross-compiling.
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 15/51] gnu: flex: Fix [cross-]build with gcc-14.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (13 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 14/51] gnu: git-minimal: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 16/51] gnu: libffi: " Janneke Nieuwenhuizen
                     ` (35 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/flex.scm (flex): When building for the 64bit Hurd, or
cross-compiling, add "-Wno-int-conversion "-Wno-implicit-function-declaration"
to #:configure-flags.

Change-Id: Ia0503e3f5c7aa5354a949b69035a1be6f93ec85f
---
 gnu/packages/flex.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/flex.scm b/gnu/packages/flex.scm
index 7972675971..4ad1e1382a 100644
--- a/gnu/packages/flex.scm
+++ b/gnu/packages/flex.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,6 +23,7 @@ (define-module (gnu packages flex)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix gexp)
   #:use-module (guix utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages m4)
@@ -53,6 +55,12 @@ (define-public flex
                  ((#:tests? _ #f) #f)))
               (inputs (alist-delete "flex" (package-inputs bison))))))
        `(("bison" ,bison-for-tests))))
+    (arguments
+     (if (or (target-hurd64?) (%current-target-system))
+         (list #:configure-flags
+               #~'(#$(string-append "CFLAGS=-Wno-int-conversion"
+                                    " -Wno-implicit-function-declaration")))
+         '()))
     ;; m4 is not present in PATH when cross-building
     (native-inputs
      (list help2man m4))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 16/51] gnu: libffi: Fix [cross-]build with gcc-14.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (14 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 15/51] gnu: flex: Fix [cross-]build with gcc-14 Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 17/51] gnu: perl: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
                     ` (34 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/libffi.scm (libffi)[arguments]: When building for the 64bit
Hurd, or cross-building, add "CFLAGS" to #:configure-flags to disable breaking
warning.

Change-Id: I05bf3f460f3e292626de1894b7a3cf381cb07702
---
 gnu/packages/libffi.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm
index ba3fc6bc79..62be8f0c4a 100644
--- a/gnu/packages/libffi.scm
+++ b/gnu/packages/libffi.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2020 John Doe <dftxbs3e@free.fr>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -60,7 +61,12 @@ (define-public libffi
      `(;; Prevent the build system from passing -march and -mtune to the
        ;; compiler.  See "ax_cc_maxopt.m4" and "ax_gcc_archflag.m4".
        #:configure-flags '("--enable-portable-binary"
-                           "--without-gcc-arch")))
+                           "--without-gcc-arch"
+                           ,@(if (or (target-hurd64?) (%current-target-system))
+                                 (list (string-append
+                                        "CFLAGS=-g -O2"
+                                        " -Wno-implicit-function-declaration"))
+                                 '()))))
     (outputs '("out" "debug"))
     (synopsis "Foreign function call interface library")
     (description
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 17/51] gnu: perl: Support [cross-]build with gcc-14 and the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (15 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 16/51] gnu: libffi: " Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 18/51] gnu: texinfo-4: Fix " Janneke Nieuwenhuizen
                     ` (33 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/cross-base.scm (perl)[native-inputs]: Update perl-cross to 1.6.

Change-Id: I4a77f51a6757ad4aed9bcca8f9bbbf2cbd162e15
---
 gnu/packages/perl.scm | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index faaac13bf1..3941ad4831 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -248,14 +248,16 @@ (define-public perl
     (native-inputs
      (if (%current-target-system)
          `(("perl-cross"
-            ,(origin
-               (method git-fetch)
-               (uri (git-reference
-                     (url "https://github.com/arsv/perl-cross")
-                     (commit "1.4")))
-               (file-name (git-file-name "perl-cross" "1.4"))
-               (sha256
-                (base32 "1ydjvlhrk06ccyj4bm8by7xk90krsll2k380mc3x1mhfrc7r9gzy")))))
+            ,(let ((version "1.6"))
+               (origin
+                 (method git-fetch)
+                 (uri (git-reference
+                       (url "https://github.com/arsv/perl-cross")
+                       (commit version)))
+                 (file-name (git-file-name "perl-cross" version))
+                 (sha256
+                  (base32
+                   "0s06lkx5b79r9cn6pm5p6d4jbdjq7wg7rjr75nw5xdhw1z3wnl2d"))))))
          '()))
     (native-search-paths (list (search-path-specification
                                 (variable "PERL5LIB")
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 18/51] gnu: texinfo-4: Fix [cross-]build with gcc-14 and the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (16 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 17/51] gnu: perl: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 19/51] gnu: hurd: Fix build with gcc-14 Janneke Nieuwenhuizen
                     ` (32 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/texinfo.scm (texinfo-4): When building for the 64bit Hurd, or
cross-compiling, add "-Wno-incompatible-pointer-types" to #:configure-flags.

Change-Id: Ia0503e3f5c7aa5354a949b69035a1be6f93ec85f
---
 gnu/packages/texinfo.scm | 50 ++++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/texinfo.scm b/gnu/packages/texinfo.scm
index 81afdaf7a7..c30ca3c788 100644
--- a/gnu/packages/texinfo.scm
+++ b/gnu/packages/texinfo.scm
@@ -7,7 +7,7 @@
 ;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
 ;;; Copyright © 2019, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2022 ( <paren@disroot.org>
 ;;;
@@ -165,31 +165,35 @@ (define-public texinfo-4
       (modify-inputs (package-native-inputs texinfo)
         (prepend automake)))
     (arguments
-     (substitute-keyword-arguments (package-arguments texinfo)
-       ((#:phases phases)
-        `(modify-phases ,phases
-           (add-after 'unpack 'fix-configure
-             (lambda* (#:key inputs native-inputs #:allow-other-keys)
-               ;; Replace outdated config.sub and config.guess.
-               (with-directory-excursion "build-aux"
-                 (for-each
-                  (lambda (file)
-                    (install-file (string-append
-                                   (assoc-ref
-                                    (or native-inputs inputs) "automake")
-                                   "/share/automake-"
-                                   ,(version-major+minor
-                                     (package-version automake))
-                                   "/" file) "."))
-                  '("config.sub" "config.guess")))
-               #t))
-           ;; Build native version of tools before running 'build phase.
-           ,@(if (%current-target-system)
-                 `((add-before 'build 'make-native-gnu-lib
+     (append
+      (substitute-keyword-arguments (package-arguments texinfo)
+        ((#:phases phases)
+         `(modify-phases ,phases
+            (add-after 'unpack 'fix-configure
+              (lambda* (#:key inputs native-inputs #:allow-other-keys)
+                ;; Replace outdated config.sub and config.guess.
+                (with-directory-excursion "build-aux"
+                  (for-each
+                   (lambda (file)
+                     (install-file (string-append
+                                    (assoc-ref
+                                     (or native-inputs inputs) "automake")
+                                    "/share/automake-"
+                                    ,(version-major+minor
+                                      (package-version automake))
+                                    "/" file) "."))
+                   '("config.sub" "config.guess")))
+                #t))
+            ;; Build native version of tools before running 'build phase.
+            ,@(if (%current-target-system)
+                  `((add-before 'build 'make-native-gnu-lib
                       (lambda* (#:key inputs #:allow-other-keys)
                         (invoke "make" "-C" "tools/gnulib/lib")
                         #t)))
-                 '())))))))
+                  '()))))
+      (if (or (target-hurd64?) (%current-target-system))
+          (list #:configure-flags ''("CFLAGS=-Wno-incompatible-pointer-types"))
+          '())))))
 
 (define-public info-reader
   ;; The idea of this package is to have the standalone Info reader without
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 19/51] gnu: hurd: Fix build with gcc-14.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (17 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 18/51] gnu: texinfo-4: Fix " Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 20/51] gnu: netdde: " Janneke Nieuwenhuizen
                     ` (31 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (hurd)[arguments]: In phase "build-libdde-linux",
disable some warnings breaking the build, using "WARNINGS=...".

Change-Id: Ib70926a90e1d37080c5b9dd333f19636cdae3013
---
 gnu/packages/hurd.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 06fae1bd3b..5a60d8ac13 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -478,6 +478,12 @@ (define-public hurd
                                     "/bin/bash")
                      (string-append "CC="
                                     ,(cc-for-target))
+                     (string-append "WARNINGS="
+                                    " -Wno-declaration-missing-parameter-type"
+                                    " -Wno-implicit-function-declaration"
+                                    " -Wno-implicit-int"
+                                    " -Wno-int-conversion"
+                                    " -Wno-strict-prototypes")
                      "ARCH=x86")))
          (add-after 'install 'install-goodies
            (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 20/51] gnu: netdde: Fix build with gcc-14.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (18 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 19/51] gnu: hurd: Fix build with gcc-14 Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 21/51] gnu: libedit: Fix [cross-]build with gcc-14 for 32bit Janneke Nieuwenhuizen
                     ` (30 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (netdde)[arguments]: Disable some warnings breaking
the build, using "WARNINGS=..." in #:make-flags.

Change-Id: I39f577c51eaa3d86abf80a54f7c172324cf56749
---
 gnu/packages/hurd.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 5a60d8ac13..5fdb6359d1 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -592,6 +592,12 @@ (define-public netdde
                               (search-input-file %build-inputs "/bin/bash"))
                "PKGDIR=libdde_linux26"
                (string-append "CC=" ,(cc-for-target))
+               (string-append "WARNINGS="
+                              " -Wno-declaration-missing-parameter-type"
+                              " -Wno-implicit-function-declaration"
+                              " -Wno-implicit-int"
+                              " -Wno-int-conversion"
+                              " -Wno-strict-prototypes")
                "ARCH=x86")
          #:configure-flags
          ,#~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 21/51] gnu: libedit: Fix [cross-]build with gcc-14 for 32bit.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (19 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 20/51] gnu: netdde: " Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 22/51] gnu: libssh: " Janneke Nieuwenhuizen
                     ` (29 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/libedit.scm (libedit)[arguments]: When cross-compiling to a
32bit host, add CFLAGS to #:configure-flags to disable a breaking warning.

Change-Id: Ibab7332af162aed38158a50e9b4fc288b4286922
---
 gnu/packages/libedit.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/libedit.scm b/gnu/packages/libedit.scm
index f04d3aafe4..252f8a4966 100644
--- a/gnu/packages/libedit.scm
+++ b/gnu/packages/libedit.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,8 +22,10 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages libedit)
+  #:use-module (guix gexp)
   #:use-module (guix licenses)
   #:use-module (guix packages)
+  #:use-module (guix utils)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages ncurses))
@@ -39,6 +42,11 @@ (define-public libedit
       (sha256
        (base32 "0wch48nml28jj6ild889745dsg2agm7mpvrmbl1gi98nw6vjrf6v"))))
     (build-system gnu-build-system)
+    (arguments
+     (if (and (%current-target-system) (target-x86-32?))
+         (list #:configure-flags
+               #~(list "CFLAGS=-g -O2 -Wno-incompatible-pointer-types"))
+         '()))
     (inputs
      (list ncurses))
     (home-page "https://thrysoee.dk/editline/")
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 22/51] gnu: libssh: Fix [cross-]build with gcc-14 for 32bit.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (20 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 21/51] gnu: libedit: Fix [cross-]build with gcc-14 for 32bit Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 23/51] gnu: guile-lzlib: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
                     ` (28 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/ssh.scm (libssh)[arguments]: When cross-compiling to a
32bit host, add CFLAGS to #:configure-flags to disable a breaking warning.

Change-Id: Ibab7332af162aed38158a50e9b4fc288b4286922
---
 gnu/packages/ssh.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm
index a29a10e954..1f33259246 100644
--- a/gnu/packages/ssh.scm
+++ b/gnu/packages/ssh.scm
@@ -13,7 +13,7 @@
 ;;; Copyright © 2018 Manuel Graf <graf@init.at>
 ;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
 ;;; Copyright © 2019, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
 ;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
@@ -156,7 +156,12 @@ (define-public libssh
     (build-system cmake-build-system)
     (outputs '("out" "debug"))
     (arguments
-     '(#:configure-flags '("-DWITH_GCRYPT=ON")
+     `(#:configure-flags '("-DWITH_GCRYPT=ON"
+                           ,@(if (and (%current-target-system) (target-x86-32?))
+                                 (list (string-append
+                                        "-DCMAKE_C_FLAGS=-g -O2"
+                                        " -Wno-incompatible-pointer-types"))
+                                 '()))
 
        ;; TODO: Add 'CMockery' and '-DWITH_TESTING=ON' for the test suite.
        #:tests? #f))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 23/51] gnu: guile-lzlib: Support [cross-]build with gcc-14 and the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (21 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 22/51] gnu: libssh: " Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 24/51] gnu: cross-base: Update %xgcc to gcc-14, to support " Janneke Nieuwenhuizen
                     ` (27 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/patches/guile-lzlib-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/guile.scm (guile-lzlib)[arguments]: Use G-expressions.  When
building for the 64bit Hurd, or cross-compiling, use it in new
"apply-hurd64-patch" stage.

Change-Id: Id03f71baa80e2f4f967f54037ce7d9f1c5dc4bb6
---
 gnu/local.mk                                  |  1 +
 gnu/packages/guile.scm                        | 16 ++++++++--
 gnu/packages/patches/guile-lzlib-hurd64.patch | 32 +++++++++++++++++++
 3 files changed, 46 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/guile-lzlib-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb50df6e13..be6befb921 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1516,6 +1516,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/guile-fix-invalid-unicode-handling.patch \
   %D%/packages/patches/guile-gdbm-ffi-support-gdbm-1.14.patch	\
   %D%/packages/patches/guile-hurd-posix-spawn.patch		\
+  %D%/packages/patches/guile-lzlib-hurd64.patch			\
   %D%/packages/patches/guile-present-coding.patch		\
   %D%/packages/patches/guile-rsvg-pkgconfig.patch		\
   %D%/packages/patches/guile-ssh-rename-bool.patch		\
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 8dabbb2c5e..69dff9211f 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -4,7 +4,7 @@
 ;;; Copyright © 2014, 2016, 2018 David Thompson <davet@gnu.org>
 ;;; Copyright © 2014, 2017, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015, 2017 Christine Lemmer-Webber <cwebber@dustycloud.org>
-;;; Copyright © 2016, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2016, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
@@ -962,8 +962,18 @@ (define-public guile-lzlib
          "1whgmwkr1v8m63p4aaqn8blwl9vcrswwhbfv4bm0aghl5a6rryd7"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:make-flags
-       '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
+     (list
+      #:make-flags #~'("GUILE_AUTO_COMPILE=0") ;prevent guild warnings
+      #:phases (if (or (%current-target-system) (target-hurd64?))
+                   #~(modify-phases %standard-phases
+                       (add-after 'unpack 'apply-hurd64-patch
+                         (lambda _
+                           (let ((patch
+                                  #$(local-file
+                                     (search-patch
+                                      "guile-lzlib-hurd64.patch"))))
+                             (invoke "patch" "--force" "-p1" "-i" patch)))))
+                   #~%standard-phases)))
     (native-inputs (list autoconf automake pkg-config guile-3.0))
     (inputs (list guile-3.0 lzlib))
     (synopsis "Guile bindings to lzlib")
diff --git a/gnu/packages/patches/guile-lzlib-hurd64.patch b/gnu/packages/patches/guile-lzlib-hurd64.patch
new file mode 100644
index 0000000000..12e8c3617d
--- /dev/null
+++ b/gnu/packages/patches/guile-lzlib-hurd64.patch
@@ -0,0 +1,32 @@
+Upstream-status: Presented upstream.
+
+From 80dcd31562827f4b6d085affe9d9f22164f7ed34 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Fri, 15 Nov 2024 16:18:29 +0100
+Subject: [PATCH] build: Support the 64bit Hurd.
+
+* configure.ac: When cross-compiling declare LZ_decompress_open before
+using it in conftest.c.
+---
+ configure.ac | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 50dc5ac..4c56768 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -32,7 +32,10 @@ AC_DEFUN([GUILE_LIBLZ_FILE_NAME], [
+     [if test "$cross_compiling" = yes; then
+        # When cross-compiling, we cannot rely on 'ldd'.  Instead, look
+        # the output of 'ld --verbose', assuming we're using GNU ld.
+-       echo 'int main () { return LZ_decompress_open(); }' > conftest.c
++       cat > conftest.c <<EOF
++int LZ_decompress_open ();
++int main () { return LZ_decompress_open(); }
++EOF
+        guile_cv_liblz_libdir="\
+           `$CC conftest.c -o conftest$EXEEXT -llz -Wl,--verbose 2>/dev/null \
+           | grep -E '^/.*/liblz\.(a|so)'`"
+-- 
+2.46.0
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 24/51] gnu: cross-base: Update %xgcc to gcc-14, to support the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (22 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 23/51] gnu: guile-lzlib: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 25/51] gnu: make-bootstrap: Update gcc-static to gcc-14, for " Janneke Nieuwenhuizen
                     ` (26 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

Gcc-14 adds support for the 64bit Hurd.

* gnu/packages/cross-base.scm (%xgcc): Bump to gcc-14.

Change-Id: Idf7696c50532aa4def2b2d37cdb5c70715125123
---
 gnu/packages/cross-base.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 4961b3b4c0..ad3616eaba 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 gcc-14))
 
 (define %gcc-include-paths
   ;; Environment variables for header search paths.
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 25/51] gnu: make-bootstrap: Update gcc-static to gcc-14, for the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (23 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 24/51] gnu: cross-base: Update %xgcc to gcc-14, to support " Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 26/51] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (25 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/make-bootstrap.scm (%gcc-static): Use gcc-14.  Update to use
G-Expressions.
[inputs]: Remove libstdc++ and libstdc++-headers.
(%gcc-stripped): Use gcc-14.
[inputs, native-inputs]: Clear fields.

Change-Id: I4e6d779cb457b256d80d1882f182b72a6f7d2be2
---
 gnu/packages/make-bootstrap.scm | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index 689d48d342..e0dcca7b33 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -488,11 +488,11 @@ (define (%glibc-stripped)
 (define %gcc-static
   ;; A statically-linked GCC, with stripped-down functionality.
   (package-with-relocatable-glibc
-   (package (inherit gcc)
+   (package (inherit gcc-14)
      (name "gcc-static")
      (outputs '("out"))                           ; all in one
      (arguments
-      (substitute-keyword-arguments (package-arguments gcc)
+      (substitute-keyword-arguments (package-arguments gcc-14)
         ((#:modules modules %default-gnu-modules)
          `((srfi srfi-1)
            (srfi srfi-26)
@@ -501,7 +501,7 @@ (define %gcc-static
         ((#:guile _) #f)
         ((#:implicit-inputs? _) #t)
         ((#:configure-flags flags)
-         `(append (list
+         #~(append (list
                    ;; We don't need a full bootstrap here.
                    "--disable-bootstrap"
 
@@ -526,9 +526,9 @@ (define %gcc-static
                    "--disable-libssp"
                    "--disable-libquadmath")
                   (remove (cut string-match "--(.*plugin|enable-languages)" <>)
-                          ,flags)))
+                          #$flags)))
         ((#:phases phases)
-         `(modify-phases ,phases
+         #~(modify-phases #$phases
             (add-after 'pre-configure 'remove-lgcc_s
               (lambda _
                 ;; Remove the '-lgcc_s' added to GNU_USER_TARGET_LIB_SPEC in
@@ -538,12 +538,12 @@ (define %gcc-static
                 (substitute* (cons "gcc/config/rs6000/sysv4.h"
                                    (find-files "gcc/config"
                                                "^gnu-user.*\\.h$"))
-                  ((" -lgcc_s}}") "}}"))
-                #t))))))
+                  ((" -lgcc_s}}") "}}"))))))))
      (inputs
       `(("zlib:static" ,zlib "static")
         ("isl:static" ,isl "static")
-        ,@(package-inputs gcc)))
+        ,@(fold alist-delete (package-inputs gcc-14)
+                '("libstdc++" "libstdc++-headers"))))
      (native-inputs
       (if (%current-target-system)
           `(;; When doing a Canadian cross, we need GMP/MPFR/MPC both
@@ -556,17 +556,19 @@ (define %gcc-static
             ("gmp-native" ,gmp)
             ("mpfr-native" ,mpfr)
             ("mpc-native" ,mpc)
-            ,@(package-native-inputs gcc))
-          (package-native-inputs gcc))))))
+            ,@(package-native-inputs gcc-14))
+          (package-native-inputs gcc-14))))))
 
 (define %gcc-stripped
   ;; The subset of GCC files needed for bootstrap.
   (package
-    (inherit gcc)
+    (inherit gcc-14)
     (name "gcc-stripped")
     (build-system trivial-build-system)
     (source #f)
     (outputs '("out"))                            ;only one output
+    (inputs '())
+    (native-inputs '())
     (arguments
      (list #:modules '((guix build utils))
            #:builder
@@ -632,6 +634,7 @@ (define* (make-guile-static guile patches)
       (propagated-inputs
        (modify-inputs (package-propagated-inputs guile)
          (replace "libgc" libgc/static-libs)))
+
       (arguments
        (substitute-keyword-arguments (package-arguments guile)
          ((#:configure-flags flags #~'())
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 26/51] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (24 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 25/51] gnu: make-bootstrap: Update gcc-static to gcc-14, for " Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 27/51] system: image: Add hurd64 image types Janneke Nieuwenhuizen
                     ` (24 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290
  Cc: Andreas Enge, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Maxim Cournoyer,
	Simon Tournier, Tobias Geerinckx-Rice

XXX TODO:

   v Boot a 64bit hurd, and
   v Guix shell --bootstrap -D -e '(@@ (gnu packages commencement) gnu-make-boot0)'
   v Guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
   o Guix build hello,
   o Guix shell --bootstrap -D guix,
   o Push the commit below,
   o Re-check the bootstrap-tarballs build/hash,
   o Update this commit message with new commit hash,
   o Push it with remainder of hurd-team branch,
   o Update blog post draft,
   o Release blog post!

On commit:
    610e996dcc82ab7819e9c19d81fdc78b7a9c822c
    gnu: make-bootstrap: Update gcc-static to gcc-14, for the 64bit Hurd.

Run:
    ./pre-inst-env guix build --target=x86_64-gnu bootstrap-tarballs

Producing:
    /gnu/store/7n1vcnzgad4cppzcmd7vnadsggrfm9as-bootstrap-tarballs-0/

With guix hash -r:
    0m66rvp5728c12xab5042gd4v0l1df0821l68brscrc5qr08imsj

* gnu/packages/bootstrap.scm (%bootstrap-executables): Add entries for
x86_64-gnu.
(%bootstrap-guile-hash, %bootstrap-coreutils&co, %bootstrap-binutils,
%bootstrap-glibc, %bootstrap-gcc): Add entry for x86_64-gnu.
* guix/packages.scm (%supported-systems, %hurd-systems): Add x86_64-gnu.
(%cuirass-supported-systems): Remove x86_64-gnu.
* guix/utils.scm (target-64bit?): Add x86_64-gnu.
* m4/guix.m4: Add x86_64-gnu as a supported system.
* doc/guix.texi (GNU Distribution): Add x86_64-gnu.

Change-Id: I828159aedb3f66caba98e935083cc3682429f219
---
 doc/guix.texi              |  9 ++++++++-
 gnu/packages/bootstrap.scm | 34 ++++++++++++++++++++++++++++++++++
 guix/packages.scm          |  8 +++++---
 m4/guix.m4                 | 12 +++++++++---
 4 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index ba4bd2cc79..ce00811b49 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -36,7 +36,7 @@
 Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Efraim Flashner@*
 Copyright @copyright{} 2016 John Darrington@*
 Copyright @copyright{} 2016, 2017 Nikita Gillmann@*
-Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Jan Nieuwenhuizen@*
+Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Janneke Nieuwenhuizen@*
 Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021 Julien Lepiller@*
 Copyright @copyright{} 2016 Alex ter Weele@*
 Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021 Christopher Baines@*
@@ -639,6 +639,13 @@ GNU Distribution
 (@pxref{transparent-emulation-qemu, @code{hurd-vm-service-type}}).
 @xref{Contributing}, on how to help!
 
+@item x86_64-gnu
+@uref{https://hurd.gnu.org, GNU/Hurd} on the @code{x86_64} Intel/AMD
+64-bit architecture.
+
+This configuration is even more experimental and under heavy upstream
+development.
+
 @item mips64el-linux (unsupported)
 little-endian 64-bit MIPS processors, specifically the Loongson series,
 n32 ABI, and Linux-Libre kernel.  This configuration is no longer fully
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 27798fe278..301ee3ca12 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -125,6 +125,15 @@ (define %bootstrap-executables
       ,(base32 "0nq2c1zb3wv5bf7kd83sziaashydazrn7xgq6kijlk0zj2syzc2m"))
      ("xz"
       ,(base32 "033rhpk6zrpxpd6ffjyg5y2zwq9x9cnq0zljb7k8jlncbalsayq5")))
+    ("x86_64-gnu"
+     ("bash"
+      ,(base32 "0zrcb59s6zm53p74yk0kw8kya5nndcscj4cqvz99fppcblq6c83g"))
+     ("mkdir"
+      ,(base32 "1lbfl66nyvrc8n2ngd9y2gpsm31p4hkn8k6viln0gvd434pf9hnl"))
+     ("tar"
+      ,(base32 "005d5xpnhiyyy2p0widygc65hnrvqd1ryc8ja2q5vpm5ranvbayr"))
+     ("xz"
+      ,(base32 "1qbqxjqm3jsi0av40s62n1nskc98lwl7r12phlw4ca6c1zrlij12")))
     ("mips64el-linux"
      ("bash"
       ,(base32 "1aw046dhda240k9pb9iaj5aqkm23gkvxa9j82n4k7fk87nbrixw6"))
@@ -165,6 +174,7 @@ (define (bootstrap-executable-file-name system program)
   (match system
     ("powerpc64le-linux" (string-append system "/20210106/" program))
     ("i586-gnu" (string-append system "/20200326/" program))
+    ("x86_64-gnu" (string-append system "/20241118/" program))
     ("powerpc-linux" (string-append system "/20200923/bin/" program))
     ("riscv64-linux" (string-append system "/20210725/bin/" program))
     (_ (string-append system "/" program
@@ -366,6 +376,8 @@ (define (bootstrap-guile-url-path system)
                     "/20150101/guile-2.0.11.tar.xz")
                    ("i586-gnu"
                     "/20200326/guile-static-stripped-2.0.14-i586-pc-gnu.tar.xz")
+                   ("x86_64-gnu"
+                    "/20241118/guile-static-stripped-3.0.9-x86_64-pc-gnu.tar.xz")
                    ("powerpc64le-linux"
                     "/20210106/guile-static-stripped-2.0.14-powerpc64le-linux-gnu.tar.xz")
                    ("riscv64-linux"
@@ -390,6 +402,8 @@ (define (bootstrap-guile-hash system)
      (base32 "1giy2aprjmn5fp9c4s9r125fljw4wv6ixy5739i5bffw4jgr0f9r"))
     ("i586-gnu"
      (base32 "0wgqpsmvg25rnqn49ap7kwd2qxccd8dr4lllzp7i3rjvgav27vac"))
+    ("x86_64-gnu"
+     (base32 "1ymp3lck1l5fybsa542ny2fdkfydfcfvqbgr3qh03yvq4fwfn6mc"))
     ("powerpc-linux"
      (base32 "1by2p7s27fbyjzfkcw8h65h4kkqh7d23kv4sgg5jppjn2qx7swq4"))
     ("riscv64-linux"
@@ -599,6 +613,8 @@ (define %bootstrap-coreutils&co
                                              "/20210106/static-binaries-0-powerpc64le-linux-gnu.tar.xz")
                                             ("i586-gnu"
                                              "/20200326/static-binaries-0-i586-pc-gnu.tar.xz")
+                                            ("x86_64-gnu"
+                                             "/20241118/static-binaries-0-x86_64-pc-gnu.tar.xz")
                                             ("powerpc-linux"
                                              "/20200923/static-binaries.tar.xz")
                                             ("riscv64-linux"
@@ -626,6 +642,9 @@ (define %bootstrap-coreutils&co
                               ("i586-gnu"
                                (base32
                                 "17kllqnf3fg79gzy9ansgi801c46yh9c23h4d923plvb0nfm1cfn"))
+                              ("x86_64-gnu"
+                               (base32
+                                "0g5rn94a2kd6g9ggf5m59hypawkwm7r07wwm5730s1mi9w62p248"))
                               ("powerpc-linux"
                                (base32
                                 "0kspxy0yczan2vlih6aa9hailr2inz000fqa0gn5x9d1fxxa5y8m"))
@@ -682,6 +701,8 @@ (define %bootstrap-binutils
                                              "/20210106/binutils-static-stripped-2.34-powerpc64le-linux-gnu.tar.xz")
                                             ("i586-gnu"
                                              "/20200326/binutils-static-stripped-2.34-i586-pc-gnu.tar.xz")
+                                            ("x86_64-gnu"
+                                             "/20241118/binutils-static-stripped-2.41-x86_64-pc-gnu.tar.xz")
                                             ("powerpc-linux"
                                              "/20200923/binutils-2.35.1.tar.xz")
                                             ("riscv64-linux"
@@ -712,6 +733,9 @@ (define %bootstrap-binutils
                               ("i586-gnu"
                                (base32
                                 "11kykv1kmqc5wln57rs4klaqa13hm952smkc57qcsyss21kfjprs"))
+                              ("x86_64-gnu"
+                               (base32
+                                "1zia5fpap35dcpfmmfy6i4p8l3h0d7lzk9bg8apv7vwgw4l1rv9z"))
                               ("powerpc-linux"
                                (base32
                                 "0asbg1c4avkrvh057mx0942xwddd136jni382zqsxzn79ls42yq8"))
@@ -772,6 +796,8 @@ (define %bootstrap-glibc
                                        "/20210106/glibc-stripped-2.31-powerpc64le-linux-gnu.tar.xz")
                                       ("i586-gnu"
                                        "/20240816/glibc-stripped-2.39-i586-pc-gnu.tar.xz")
+                                      ("x86_64-gnu"
+                                       "/20241118/glibc-stripped-2.39-x86_64-pc-gnu.tar.xz")
                                       ("powerpc-linux"
                                        "/20200923/glibc-2.32.tar.xz")
                                       ("riscv64-linux"
@@ -802,6 +828,9 @@ (define %bootstrap-glibc
                         ("i586-gnu"
                          (base32
                           "0x2x6w611k6v9qdabacawamw2475p04hm3s0q95xcg063wjq4ig2"))
+                        ("x86_64-gnu"
+                         (base32
+                          "0d21cy22bhvf11gc859s8ig7gc680ish8mv5xy2l8vrnc12k3q68"))
                         ("powerpc-linux"
                          (base32
                           "0smmssyjrlk5cvx49586smmk81gkwff0i6r91n4rir4jm6ba25sb"))
@@ -878,6 +907,8 @@ (define %bootstrap-gcc
                                         "/20210106/gcc-stripped-5.5.0-powerpc64le-linux-gnu.tar.xz")
                                        ("i586-gnu"
                                         "/20200326/gcc-stripped-5.5.0-i586-pc-gnu.tar.xz")
+                                       ("x86_64-gnu"
+                                        "/20241118/gcc-stripped-14.2.0-x86_64-pc-gnu.tar.xz")
                                        ("powerpc-linux"
                                         "/20200923/gcc-5.5.0.tar.xz")
                                        ("riscv64-linux"
@@ -908,6 +939,9 @@ (define %bootstrap-gcc
                          ("i586-gnu"
                           (base32
                            "1j2zc58wzil71a34h7c70sd68dmqvcscrw3rmn2whq79vd70zvv5"))
+                         ("x86_64-gnu"
+                          (base32
+                           "1di5zbnwnkw679fnhih10c4q8rg2qgqzs424c3dg91sd9l0y0a4j"))
                          ("powerpc-linux"
                           (base32
                            "1p7df3yixhm87dw5sccc6yn1i9db1r9hnmsg87wq5xi4rfmirq7w"))
diff --git a/guix/packages.scm b/guix/packages.scm
index f373136d22..403217d711 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -419,7 +420,7 @@ (define %32bit-supported-systems
 (define %64bit-supported-systems
   ;; This is the list of 64-bit system types that are supported.
   '("x86_64-linux" "mips64el-linux" "aarch64-linux" "powerpc64le-linux"
-    "riscv64-linux"))
+    "riscv64-linux" "x86_64-gnu"))
 
 (define %supported-systems
   ;; This is the list of system types that are supported.  By default, we
@@ -428,14 +429,15 @@ (define %supported-systems
 
 (define %hurd-systems
   ;; The GNU/Hurd systems for which support is being developed.
-  '("i586-gnu"))
+  '("i586-gnu" "x86_64-gnu"))
 
 (define %cuirass-supported-systems
   ;; This is the list of system types for which build machines are available.
   ;;
   ;; XXX: MIPS is unavailable in CI:
   ;; <https://lists.gnu.org/archive/html/guix-devel/2017-03/msg00790.html>.
-  (fold delete %supported-systems '("mips64el-linux" "powerpc-linux" "riscv64-linux")))
+  (fold delete %supported-systems '("mips64el-linux" "powerpc-linux"
+                                    "riscv64-linux" "x86_64-gnu")))
 
 (define (maybe-add-input-labels inputs)
   "Add labels to INPUTS unless it already has them."
diff --git a/m4/guix.m4 b/m4/guix.m4
index b93daba5c3..8c2757a8b7 100644
--- a/m4/guix.m4
+++ b/m4/guix.m4
@@ -3,6 +3,7 @@ dnl Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020, 2021 Ludovic Co
 dnl Copyright © 2014 Mark H Weaver <mhw@netris.org>
 dnl Copyright © 2017, 2020, 2021, 2023 Efraim Flashner <efraim@flashner.co.il>
 dnl Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
+dnl Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 dnl
 dnl This file is part of GNU Guix.
 dnl
@@ -61,8 +62,13 @@ AC_DEFUN([GUIX_SYSTEM_TYPE], [
        linux-musl*)
 	  guix_system="$machine_name-linux";;
        gnu*)
-          # Always use i586 for GNU/Hurd.
-          guix_system="i586-gnu";;
+          case "$machine_name" in
+            i386|i486|i586|i686)
+              # Always use i586 for 32bit GNU/Hurd.
+              guix_system="i586-gnu";;
+            *)
+	      guix_system="$machine_name-gnu";;
+          esac;;
        *)
 	  # Strip the version number from names such as `gnu0.3',
 	  # `darwin10.2.0', etc.
@@ -91,7 +97,7 @@ courageous and port the GNU System distribution to it (see
   # Currently only Linux-based systems are supported, and only on some
   # platforms.
   case "$guix_system" in
-    x86_64-linux|i686-linux|armhf-linux|aarch64-linux|powerpc64le-linux|riscv64-linux|i586-gnu)
+    x86_64-linux|i686-linux|armhf-linux|aarch64-linux|powerpc64le-linux|riscv64-linux|i586-gnu|x86_64-gnu)
       ;;
     mips64el-linux|powerpc-linux)
       AC_MSG_WARN([building Guix on `$guix_system', which is not supported])
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 27/51] system: image: Add hurd64 image types.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (25 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 26/51] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 28/51] gnu: libgpg-error: Support the 64bit Hurd Janneke Nieuwenhuizen
                     ` (23 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/system/hurd.scm (%hurd64-default-operating-system-kernel,
%hurd64-default-operating-system): New variables.
* gnu/system/images/hurd.scm (hurd64-disk-image, hurd64-image-type,
hurd64-qcow2-image-type, hurd64-barebones-disk-image,
hurd64-barebones-qcow2-image): New variables.

* gnu/system/images/hurd.scm (hurd64-barebones-os): New variable.
---
 gnu/system/hurd.scm        | 17 +++++++++
 gnu/system/images/hurd.scm | 72 ++++++++++++++++++++++++++++++++++++--
 2 files changed, 87 insertions(+), 2 deletions(-)

diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 9a351529e8..6263d3de71 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)
@@ -51,6 +52,8 @@ (define-module (gnu system hurd)
             %desktop-services/hurd
             %hurd-default-operating-system
             %hurd-default-operating-system-kernel
+            %hurd64-default-operating-system
+            %hurd64-default-operating-system-kernel
             %setuid-programs/hurd))
 
 ;;; Commentary:
@@ -68,6 +71,14 @@ (define %hurd-default-operating-system-kernel
                         (%current-target-system #f))
         gnumach)))
 
+(define %hurd64-default-operating-system-kernel
+  (if (system-hurd?)
+      gnumach
+      ;; A cross-built GNUmach does not work
+      (with-parameters ((%current-system "x86_64-linux")
+                        (%current-target-system #f))
+        gnumach)))
+
 (define %base-packages/hurd
   ;; Note: the Shepherd comes before the Hurd, not just because its duty is to
   ;; shepherd the herd, but also because we want its 'halt' and 'reboot'
@@ -142,3 +153,9 @@ (define %hurd-default-operating-system
     (essential-services (hurd-default-essential-services this-operating-system))
     (privileged-programs '())
     (setuid-programs %setuid-programs/hurd)))
+
+(define %hurd64-default-operating-system
+  (operating-system
+    (inherit %hurd-default-operating-system)
+    (kernel %hurd64-default-operating-system-kernel)))
+
diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm
index 01c422a54f..67815aeb9b 100644
--- a/gnu/system/images/hurd.scm
+++ b/gnu/system/images/hurd.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,7 +36,14 @@ (define-module (gnu system images hurd)
             hurd-image-type
             hurd-qcow2-image-type
             hurd-barebones-disk-image
-            hurd-barebones-qcow2-image))
+            hurd-barebones-qcow2-image
+
+            hurd64-barebones-os
+            hurd64-disk-image
+            hurd6-image-type
+            hurd64-qcow2-image-type
+            hurd64-barebones-disk-image
+            hurd64-barebones-qcow2-image))
 
 (define hurd-barebones-os
   (operating-system
@@ -62,6 +69,30 @@ (define hurd-barebones-os
                               (password-authentication? #t)))
                     %base-services+qemu-networking/hurd))))
 
+(define hurd64-barebones-os
+  (operating-system
+    (inherit %hurd64-default-operating-system)
+    (bootloader (bootloader-configuration
+                 (bootloader grub-minimal-bootloader)
+                 (targets '("/dev/sdX"))))
+    (file-systems (cons (file-system
+                          (device (file-system-label "my-root"))
+                          (mount-point "/")
+                          (type "ext2"))
+                        %base-file-systems))
+    (host-name "guixygnu")
+    (timezone "Europe/Amsterdam")
+    (packages (cons openssh-sans-x %base-packages/hurd))
+    (services (cons (service openssh-service-type
+                             (openssh-configuration
+                              (openssh openssh-sans-x)
+                              (use-pam? #f)
+                              (port-number 2222)
+                              (permit-root-login #t)
+                              (allow-empty-passwords? #t)
+                              (password-authentication? #t)))
+                    %base-services+qemu-networking/hurd))))
+
 (define hurd-initialize-root-partition
   #~(lambda* (#:rest args)
       (apply initialize-root-partition
@@ -115,5 +146,42 @@ (define hurd-barebones-qcow2-image
                         #:type hurd-qcow2-image-type))
    (name 'hurd-barebones.qcow2)))
 
+\f
+;;;
+;;; 64bit Hurd
+;;;
+(define hurd64-disk-image
+  (image
+   (inherit hurd-disk-image)
+   (platform x86_64-gnu)))
+
+(define hurd64-image-type
+  (image-type
+   (name 'hurd64-raw)
+   (constructor (cut image-with-os hurd64-disk-image <>))))
+
+(define hurd64-qcow2-image-type
+  (image-type
+   (name 'hurd64-qcow2)
+   (constructor (lambda (os)
+                  (image
+                   (inherit hurd64-disk-image)
+                   (format 'compressed-qcow2)
+                   (operating-system os))))))
+
+(define hurd64-barebones-disk-image
+  (image
+   (inherit
+    (os+platform->image hurd64-barebones-os x86_64-gnu
+                        #:type hurd64-image-type))
+   (name 'hurd64-barebones-disk-image)))
+
+(define hurd64-barebones-qcow2-image
+  (image
+   (inherit
+    (os+platform->image hurd64-barebones-os x86_64-gnu
+                        #:type hurd64-qcow2-image-type))
+   (name 'hurd64-barebones.qcow2)))
+
 ;; Return the default image.
 hurd-barebones-qcow2-image
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 28/51] gnu: libgpg-error: Support the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (26 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 27/51] system: image: Add hurd64 image types Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 29/51] gnu: openssl-3.0: " Janneke Nieuwenhuizen
                     ` (22 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/libgpg-error-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/gnupg.scm (libgpg-error)[arguments]: Use it when building for
the 64bit Hurd.

Change-Id: Icabb7cd7bb5bcc771ccee5b8a7f57f52b9b58183
---
 gnu/local.mk                                  |  1 +
 gnu/packages/gnupg.scm                        | 22 +++++-
 .../patches/libgpg-error-hurd64.patch         | 78 +++++++++++++++++++
 3 files changed, 98 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/libgpg-error-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index be6befb921..147f8d8709 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1625,6 +1625,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libgeotiff-fix-tests-with-proj-9.3.0.patch	\
   %D%/packages/patches/libgeotiff-fix-tests-with-proj-9.3.1.patch	\
   %D%/packages/patches/libgeotiff-fix-tests-on-i386.patch	\
+  %D%/packages/patches/libgpg-error-hurd64.patch		\
   %D%/packages/patches/libguestfs-syms.patch            	\
   %D%/packages/patches/libobjc2-unbundle-robin-map.patch	\
   %D%/packages/patches/libvirt-add-install-prefix.patch	\
diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index 2e97c2244a..6535f94cb8 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -22,7 +22,7 @@
 ;;; Copyright © 2021 Nikita Domnitskii <nikita@domnitskii.me>
 ;;; Copyright © 2021 Aleksandr Vityazev <avityazev@posteo.org>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -144,9 +144,25 @@ (define-public libgpg-error
                                     ;; configuration, as this is not correct for
                                     ;; all architectures.
                                     (_ #t)))
-                            (#t #t)))))))
+                            (#t #t)))))
+              #$@(if (target-hurd64?)
+                     #~((add-after 'unpack 'apply-hurd64-patch
+                         (lambda _
+                           (let ((patch
+                                  #$(local-file
+                                     (search-patch
+                                      "libgpg-error-hurd64.patch"))))
+                             (invoke "patch" "--force" "-p1" "-i" patch)))))
+                     #~())))
           ((system-hurd?)
-           #~((add-after 'unpack 'skip-tests
+           #~((add-after 'unpack 'apply-hurd64-patch
+                         (lambda _
+                           (let ((patch
+                                  #$(local-file
+                                     (search-patch
+                                      "libgpg-error-hurd64.patch"))))
+                             (invoke "patch" "--force" "-p1" "-i" patch))))
+              (add-after 'unpack 'skip-tests
                 (lambda _
                   (substitute* "tests/t-syserror.c"
                     (("(^| )main *\\(.*" all)
diff --git a/gnu/packages/patches/libgpg-error-hurd64.patch b/gnu/packages/patches/libgpg-error-hurd64.patch
new file mode 100644
index 0000000000..aac8ce61f1
--- /dev/null
+++ b/gnu/packages/patches/libgpg-error-hurd64.patch
@@ -0,0 +1,78 @@
+Upstream-status: Taken from upstream (1.48 series).
+
+From c62157c615a6379677c8f106bf9413d2611fd95e Mon Sep 17 00:00:00 2001
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date: Sat, 6 May 2023 16:10:55 +0200
+Subject: [PATCH] core: Add hurd-amd64 support
+
+--
+This supports the x86_64-pc-gnu triplet
+
+Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
+---
+ src/Makefile.am                              |  1 +
+ src/mkheader.c                               |  2 ++
+ src/syscfg/lock-obj-pub.x86_64-unknown-gnu.h | 24 ++++++++++++++++++++
+ 3 files changed, 27 insertions(+)
+ create mode 100644 src/syscfg/lock-obj-pub.x86_64-unknown-gnu.h
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index c61adde..9389e99 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -67,6 +67,7 @@ lock_obj_pub = \
+         syscfg/lock-obj-pub.sparc-unknown-linux-gnu.h       \
+         syscfg/lock-obj-pub.sparc64-unknown-linux-gnu.h     \
+ 	syscfg/lock-obj-pub.x86_64-apple-darwin.h           \
++        syscfg/lock-obj-pub.x86_64-unknown-gnu.h              \
+         syscfg/lock-obj-pub.x86_64-unknown-kfreebsd-gnu.h   \
+         syscfg/lock-obj-pub.x86_64-unknown-linux-gnu.h      \
+         syscfg/lock-obj-pub.x86_64-unknown-linux-gnux32.h   \
+diff --git a/src/mkheader.c b/src/mkheader.c
+index 8fbfbd6..cc0eaa3 100644
+--- a/src/mkheader.c
++++ b/src/mkheader.c
+@@ -108,6 +108,8 @@ canon_host_triplet (const char *triplet, int no_vendor_hack, char **r_os)
+     {"x86_64-pc-linux-gnuhardened1", "x86_64-unknown-linux-gnu" },
+     {"x86_64-pc-linux-gnu" },
+ 
++    {"x86_64-pc-gnu"},
++
+     {"powerpc-unknown-linux-gnuspe", "powerpc-unknown-linux-gnu" },
+ 
+     {"arm-unknown-linux-gnueabihf",  "arm-unknown-linux-gnueabi" },
+diff --git a/src/syscfg/lock-obj-pub.x86_64-unknown-gnu.h b/src/syscfg/lock-obj-pub.x86_64-unknown-gnu.h
+new file mode 100644
+index 0000000..7c7e6f1
+--- /dev/null
++++ b/src/syscfg/lock-obj-pub.x86_64-unknown-gnu.h
+@@ -0,0 +1,24 @@
++## lock-obj-pub.x86_64-pc-gnu.h
++## File created by gen-posix-lock-obj - DO NOT EDIT
++## To be included by mkheader into gpg-error.h
++
++typedef struct
++{
++  long _vers;
++  union {
++    volatile char _priv[32];
++    long _x_align;
++    long *_xp_align;
++  } u;
++} gpgrt_lock_t;
++
++#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
++                                    0,0,0,0,0,0,0,0, \
++                                    0,0,0,0,0,0,0,0, \
++                                    0,0,0,0,0,0,0,0}}}
++##
++## Local Variables:
++## mode: c
++## buffer-read-only: t
++## End:
++##
+
+base-commit: 7a42ff0ec971f4f2add28b0edad6cf381b5b8acc
+-- 
+2.46.0
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 29/51] gnu: openssl-3.0: Support the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (27 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 28/51] gnu: libgpg-error: Support the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-19  6:54   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 30/51] gnu: pciutils: " Janneke Nieuwenhuizen
                     ` (21 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/openssl-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/tls.scm (openssl-3.0)[arguments]: When building for
the 64bit Hurd, use it in new "apply-hurd-patch" phase.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/local.mk                              |  1 +
 gnu/packages/patches/openssl-hurd64.patch | 99 +++++++++++++++++++++++
 gnu/packages/tls.scm                      |  9 +++
 3 files changed, 109 insertions(+)
 create mode 100644 gnu/packages/patches/openssl-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 147f8d8709..a0408d20f2 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1901,6 +1901,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/opensles-add-license-file.patch			\
   %D%/packages/patches/openssl-1.1-c-rehash-in.patch		\
   %D%/packages/patches/openssl-3.0-c-rehash-in.patch		\
+  %D%/packages/patches/openssl-hurd64.patch			\
   %D%/packages/patches/opentaxsolver-file-browser-fix.patch     \
   %D%/packages/patches/open-zwave-hidapi.patch			\
   %D%/packages/patches/orangeduck-mpc-fix-pkg-config.patch	\
diff --git a/gnu/packages/patches/openssl-hurd64.patch b/gnu/packages/patches/openssl-hurd64.patch
new file mode 100644
index 0000000000..372fda834a
--- /dev/null
+++ b/gnu/packages/patches/openssl-hurd64.patch
@@ -0,0 +1,99 @@
+Upstream-status: Taken from upstream:
+
+<https://github.com/openssl/openssl/commit/7c729851d169f30d9e0c0ad6e7c1cf6cefb37935>.
+
+From 795699363be8f717e36802c3ac503011b74ad752 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Thu, 7 Nov 2024 14:08:05 +0100
+Subject: [PATCH] Add support for the 64bit Hurd.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+Taken from <https://salsa.debian.org/debian/openssl>.
+---
+ Configurations/10-main.conf | 45 ++++++++++++++++++++++++++++++++-----
+ util/perl/OpenSSL/config.pm |  3 ++-
+ 2 files changed, 41 insertions(+), 7 deletions(-)
+
+diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
+index b578a3c2a8..740460ebd3 100644
+--- a/Configurations/10-main.conf
++++ b/Configurations/10-main.conf
+@@ -1685,20 +1685,53 @@ my %targets = (
+     },
+ 
+ ##### GNU Hurd
+-    "hurd-x86" => {
++    "hurd-generic32" => {
+         inherit_from     => [ "BASE_unix" ],
+         CC               => "gcc",
+-        CFLAGS           => "-O3 -fomit-frame-pointer -Wall",
++        CXX              => "g++",
++        CFLAGS           => picker(default => "-Wall",
++                                   debug   => "-O0 -g",
++                                   release => "-O3"),
++        CXXFLAGS         => picker(default => "-Wall",
++                                   debug   => "-O0 -g",
++                                   release => "-O3"),
+         cflags           => threads("-pthread"),
+-        lib_cppflags     => "-DL_ENDIAN",
++        cxxflags         => combine("-std=c++11", threads("-pthread")),
+         ex_libs          => add("-ldl", threads("-pthread")),
+-        bn_ops           => "BN_LLONG",
+-        asm_arch         => 'x86',
+-        perlasm_scheme   => 'elf',
++        bn_ops           => "BN_LLONG RC4_CHAR",
+         thread_scheme    => "pthreads",
+         dso_scheme       => "dlfcn",
+         shared_target    => "linux-shared",
+         shared_cflag     => "-fPIC",
++        shared_ldflag    => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
++    },
++
++    "hurd-generic64" => {
++        inherit_from     => [ "hurd-generic32" ],
++        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
++    },
++
++    #### X86 / X86_64 targets
++    "hurd-x86" => {
++        inherit_from     => [ "hurd-generic32" ],
++        CFLAGS           => add(picker(release => "-fomit-frame-pointer")),
++        cflags           => add("-m32"),
++        cxxflags         => add("-m32"),
++        lib_cppflags     => add("-DL_ENDIAN"),
++        bn_ops           => "BN_LLONG",
++        asm_arch         => 'x86',
++        perlasm_scheme   => 'elf',
++    },
++
++    "hurd-x86_64" => {
++        inherit_from     => [ "hurd-generic64" ],
++        cflags           => add("-m64"),
++        cxxflags         => add("-m64"),
++        lib_cppflags     => add("-DL_ENDIAN"),
++        bn_ops           => "SIXTY_FOUR_BIT_LONG",
++        asm_arch         => 'x86_64',
++        perlasm_scheme   => 'elf',
++        multilib         => "64",
+     },
+ 
+ ##### VxWorks for various targets
+diff --git a/util/perl/OpenSSL/config.pm b/util/perl/OpenSSL/config.pm
+index 2f1edcafb6..707db71537 100755
+--- a/util/perl/OpenSSL/config.pm
++++ b/util/perl/OpenSSL/config.pm
+@@ -92,7 +92,8 @@ my $guess_patterns = [
+     [ 'IRIX64:.*',                  'mips4-sgi-irix64' ],
+     [ 'Linux:[2-9]\..*',            '${MACHINE}-whatever-linux2' ],
+     [ 'Linux:1\..*',                '${MACHINE}-whatever-linux1' ],
+-    [ 'GNU.*',                      'hurd-x86' ],
++    [ 'GNU:.*86-AT386',             'hurd-x86' ],
++    [ 'GNU:.*86_64-AT386',          'hurd-x86_64' ],
+     [ 'LynxOS:.*',                  '${MACHINE}-lynx-lynxos' ],
+     # BSD/OS always says 386
+     [ 'BSD\/OS:4\..*',              'i486-whatever-bsdi4' ],
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 43806e24da..fab88518ce 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -589,6 +589,15 @@ (define-public openssl-3.0
                                            "/bin/perl"))))
             #$@(if (target-hurd?)
                    #~((delete 'patch-configure))
+                   #~())
+            #$@(if (target-hurd64?)
+                   #~((add-after 'unpack 'apply-hurd-patch
+                        (lambda _
+                          (let ((patch-file
+                                 #$(local-file
+                                    (search-patch "openssl-hurd64.patch"))))
+                            (invoke "patch" "--force" "-p1" "-i"
+                                    patch-file)))))
                    #~())))
        ((#:configure-flags flags #~'())
         (if (system-hurd?)
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 30/51] gnu: pciutils: Support the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (28 preceding siblings ...)
  2024-11-19  6:54   ` [bug#74290] [PATCH v3 29/51] gnu: openssl-3.0: " Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 31/51] gnu: libpciaccess: " Janneke Nieuwenhuizen
                     ` (20 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/pciutils-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/pciutils.scm (pciutils)[arguments]: Use g-expressions.  When
building for the 64bit Hurd, use it in new "apply-hurd64-patch" phase.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/local.mk                               |  1 +
 gnu/packages/patches/pciutils-hurd64.patch | 31 ++++++++++++++++++++++
 gnu/packages/pciutils.scm                  | 25 +++++++++++------
 3 files changed, 49 insertions(+), 8 deletions(-)
 create mode 100644 gnu/packages/patches/pciutils-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index a0408d20f2..89042a0716 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1916,6 +1916,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/pam-krb5-CVE-2020-10595.patch		\
   %D%/packages/patches/pango-skip-libthai-test.patch		\
   %D%/packages/patches/password-store-tree-compat.patch		\
+  %D%/packages/patches/pciutils-hurd64.patch			\
   %D%/packages/patches/pdfpc-build-with-vala-0.56.patch         \
   %D%/packages/patches/petri-foo-0.1.87-fix-recent-file-not-exist.patch			\
   %D%/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch \
diff --git a/gnu/packages/patches/pciutils-hurd64.patch b/gnu/packages/patches/pciutils-hurd64.patch
new file mode 100644
index 0000000000..316f12e131
--- /dev/null
+++ b/gnu/packages/patches/pciutils-hurd64.patch
@@ -0,0 +1,31 @@
+Upstream-status: Not presented upstream.
+
+--- pciutils-3.8.0/lib/hurd.c.orig	2024-11-07 15:09:20.728973822 +0100
++++ pciutils-3.8.0/lib/hurd.c	2024-11-07 15:05:08.524682813 +0100
+@@ -213,7 +213,7 @@
+ hurd_read(struct pci_dev *d, int pos, byte * buf, int len)
+ {
+   int err;
+-  size_t nread;
++  mach_msg_type_number_t nread;
+   char *data;
+   mach_port_t device_port = device_port_lookup(d);
+ 
+@@ -266,7 +266,7 @@
+   mach_port_t device_port = device_port_lookup(d);
+   struct pci_bar regions[6];
+   char *buf = (char *) &regions;
+-  size_t size = sizeof(regions);
++  mach_msg_type_number_t size = sizeof(regions);
+ 
+   int err = pci_get_dev_regions(device_port, &buf, &size);
+   if (err)
+@@ -305,7 +305,7 @@
+   struct pci_xrom_bar rom;
+   mach_port_t device_port = device_port_lookup(d);
+   char *buf = (char *) &rom;
+-  size_t size = sizeof(rom);
++  mach_msg_type_number_t size = sizeof(rom);
+ 
+   int err = pci_get_dev_rom(device_port, &buf, &size);
+   if (err)
diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index d2a352eb6b..08f1634113 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2022 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
 ;;;
@@ -81,25 +81,34 @@ (define-public pciutils
                 "01aglgw9ds9qiswcbi2lx90lswncikrlyv8mmp4haix8542bvvci"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
          (add-after 'unpack 'unbundle-pci.ids
            (lambda* (#:key native-inputs inputs #:allow-other-keys)
              (copy-file (search-input-file (or native-inputs inputs)
                                            "share/hwdata/pci.ids")
                         "pci.ids")))
+         #$@(if (target-hurd64?)
+               #~((add-after 'unpack 'apply-hurd64-patch
+                    (lambda _
+                      (let ((patch-file
+                             #$(local-file
+                                (search-patch "pciutils-hurd64.patch"))))
+                        (invoke "patch" "--force" "-p1" "-i" patch-file)))))
+               #~())
          (replace 'configure
            (lambda* (#:key outputs #:allow-other-keys)
              ;; There's no 'configure' script, just a raw makefile.
              (substitute* "Makefile"
-               ,@(if (%current-target-system)
-                     `((("^CROSS_COMPILE=.*$")
+               #$@(if (%current-target-system)
+                     #~((("^CROSS_COMPILE=.*$")
                         (string-append "CROSS_COMPILE="
-                                       ,(%current-target-system) "-"
+                                       #$(%current-target-system) "-"
                                        "\n"))
                        (("^HOST=.*$")
                         (string-append "HOST="
-                                       ,(gnu-triplet->nix-system
+                                       #$(gnu-triplet->nix-system
                                          (%current-target-system)) "\n"))
                        ;; Disable 'install' strip option, that would fail when
                        ;; we are cross-compiling.
@@ -139,7 +148,7 @@ (define-public pciutils
              (invoke "make" "install" "install-lib"))))
 
        ;; Make sure programs have an RPATH so they can find libpciutils.so.
-       #:make-flags (list ,(string-append "CC="
+       #:make-flags #~(list #$(string-append "CC="
                                           (if (%current-target-system)
                                               (cc-for-target)
                                               "gcc"))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 31/51] gnu: libpciaccess: Support the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (29 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 30/51] gnu: pciutils: " Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 32/51] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df Janneke Nieuwenhuizen
                     ` (19 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/libpciaccess-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/xorg.scm (libpciaccess) [arguments]: Use g-expressions.  When
building for the 64bit Hurd, use it in new "apply-hurd64-patch" phase.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/local.mk                                  |  1 +
 .../patches/libpciaccess-hurd64.patch         | 58 +++++++++++++++++++
 gnu/packages/xorg.scm                         | 23 +++++---
 3 files changed, 75 insertions(+), 7 deletions(-)
 create mode 100644 gnu/packages/patches/libpciaccess-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 89042a0716..b6e25cd43d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1711,6 +1711,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libmpeg2-global-symbol-test.patch	\
   %D%/packages/patches/libmygpo-qt-fix-qt-5.11.patch		\
   %D%/packages/patches/libmygpo-qt-missing-qt5-modules.patch	\
+  %D%/packages/patches/libpciaccess-hurd64.patch		\
   %D%/packages/patches/libphonenumber-reproducible-build.patch	\
   %D%/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch	\
   %D%/packages/patches/libquicktime-ffmpeg.patch 		\
diff --git a/gnu/packages/patches/libpciaccess-hurd64.patch b/gnu/packages/patches/libpciaccess-hurd64.patch
new file mode 100644
index 0000000000..f7e11059b1
--- /dev/null
+++ b/gnu/packages/patches/libpciaccess-hurd64.patch
@@ -0,0 +1,58 @@
+Upstream-status: Taken from upstream:
+
+<https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/commit/6cd5a4afbb70868c7746de8d50dea59e02e9acf2>.
+
+From 6cd5a4afbb70868c7746de8d50dea59e02e9acf2 Mon Sep 17 00:00:00 2001
+From: Flavio Cruz <flaviocruz@gmail.com>
+Date: Wed, 28 Jun 2023 01:02:34 -0400
+Subject: [PATCH] Fix compilation warnings when building against hurd-amd64.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+Passes mach_msg_type_number_t instead of size_t which have different
+sizes. Example warning:
+
+/hurd_pci.c:101:53: warning: passing argument 3 of 'pci_get_dev_regions' from incompatible pointer type [-Wincompatible-pointer-types]
+  101 |     err = pci_get_dev_regions(d->device_port, &buf, &size);
+      |                                                     ^~~~~
+      |                                                     |
+      |                                                     size_t * {aka long unsigned int *}
+---
+ src/hurd_pci.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/hurd_pci.c b/src/hurd_pci.c
+index 8653e1b..9ac3813 100644
+--- a/src/hurd_pci.c
++++ b/src/hurd_pci.c
+@@ -82,7 +82,7 @@ pci_device_hurd_probe(struct pci_device *dev)
+     struct pci_bar regions[6];
+     struct pci_xrom_bar rom;
+     struct pci_device_private *d;
+-    size_t size;
++    mach_msg_type_number_t size;
+     char *buf;
+ 
+     /* Many of the fields were filled in during initial device enumeration.
+@@ -323,7 +323,7 @@ pciclient_cfg_read(mach_port_t device_port, int reg, char *buf,
+                    size_t * nbytes)
+ {
+     int err;
+-    size_t nread;
++    mach_msg_type_number_t nread;
+     char *data;
+ 
+     data = buf;
+@@ -473,7 +473,7 @@ simple_readdir(mach_port_t port, uint32_t *first_entry)
+ {
+     char *data;
+     int nentries = 0;
+-    vm_size_t size;
++    mach_msg_type_number_t size;
+ 
+     dir_readdir (port, &data, &size, *first_entry, 1, 0, &nentries);
+ 
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 0de08a4ad1..b106a604a7 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -36,7 +36,7 @@
 ;;; Copyright © 2021 Lu Hui <luhux76@gmail.com>
 ;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
 ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2023, 2024 John Kehayias <john.kehayias@protonmail.com>
 ;;; Copyright © 2023, 2024 Kaelyn Takata <kaelyn.alexi@protonmail.com>
 ;;;
@@ -1157,16 +1157,17 @@ (define-public libpciaccess
             "12glp4w1kgvmqn89lk19cgr6jccd3awxra4dxisp7pagi06rsk11"))))
     (build-system gnu-build-system)
     (arguments
-     '(;; Make sure libpciaccess can read compressed 'pci.ids' files as
-       ;; provided by pciutils.
-       #:configure-flags
-       (list "--with-zlib"
+     (list
+      ;; Make sure libpciaccess can read compressed 'pci.ids' files as
+      ;; provided by pciutils.
+      #:configure-flags
+      #~(list "--with-zlib"
              (string-append "--with-pciids-path="
                             (assoc-ref %build-inputs "pciutils")
                             "/share/hwdata"))
 
        #:phases
-       (modify-phases %standard-phases
+       #~(modify-phases %standard-phases
          (add-after 'install 'add-L-zlib
            (lambda* (#:key inputs outputs #:allow-other-keys)
              ;; Provide '-LZLIB/lib' next to '-lz' in the .la file.
@@ -1175,7 +1176,15 @@ (define-public libpciaccess
                (substitute* (string-append out "/lib/libpciaccess.la")
                  (("-lz")
                   (string-append "-L" zlib "/lib -lz")))
-               #t))))))
+               #t)))
+         #$@(if (target-hurd64?)
+                #~((add-after 'unpack 'apply-hurd64-patch
+                     (lambda _
+                       (let ((patch-file
+                              #$(local-file
+                                 (search-patch "libpciaccess-hurd64.patch"))))
+                         (invoke "patch" "--force" "-p1" "-i" patch-file)))))
+                #~()))))
     (inputs
      (list zlib pciutils))                   ;for 'pci.ids.gz'
     (native-inputs
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 32/51] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (30 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 31/51] gnu: libpciaccess: " Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 33/51] gnu: netdde: Support the 64bit Hurd Janneke Nieuwenhuizen
                     ` (18 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (netdde): Update to
c0ef248dc7c5ccc1273e2a796f3ece30c5b645df.
(dde-sources): Update to b6c8526c703f3ba76294d9002f195c63897ec661.

Change-Id: Id03f5c5124f16e9ffd6a77cbb2507d274e0f325a
---
 gnu/packages/hurd.scm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 5fdb6359d1..2c231425aa 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -294,7 +294,7 @@ (define unifont
 
 (define dde-sources
   ;; This is the current tip of the dde branch
-  (let ((commit "066797b576ebf8364ad157f50bef2a655597deeb"))
+  (let ((commit "b6c8526c703f3ba76294d9002f195c63897ec661"))
     (origin
       (method git-fetch)
       (uri (git-reference
@@ -302,7 +302,7 @@ (define dde-sources
             (commit commit)))
       (sha256
        (base32
-        "19f2awlfnar5gyhi0w5zawla5brzck2s88iv0f20022pd1l5v9hl"))
+        "0k1ilj8ghli8x43xaksbc4y419pqh0w16k374914c07svq419bbr"))
       (file-name (git-file-name "dde" (string-take commit 7))))))
 
 (define %import-from-dde
@@ -567,8 +567,8 @@ (define-public hurd
     (license gpl2+)))
 
 (define-public netdde
-  (let ((commit "e67c284ac113d939b10b4578334f27dab29d5b08")
-        (revision "2"))
+  (let ((commit "c0ef248dc7c5ccc1273e2a796f3ece30c5b645df")
+        (revision "3"))
     (package
       (name "netdde")
       ;; The version prefix corresponds to the version of Linux from which the
@@ -582,7 +582,7 @@ (define-public netdde
                 (patches (list (search-patch "netdde-build-fix.patch")))
                 (sha256
                  (base32
-                  "0vnkls7sr7srzib5mnw6gybzl5qa8c5a4zf3h08w6gdr7zqbndh0"))
+                  "070fpmd4nvn3mp8dj9w4if63iwz7j2m0h6ywq888znw70wlrc6sh"))
                 (file-name (git-file-name name commit))))
       (build-system gnu-build-system)
       (arguments
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 33/51] gnu: netdde: Support the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (31 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 32/51] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 34/51] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337 Janneke Nieuwenhuizen
                     ` (17 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/netdde-csum.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hurd.scm (netdde)[source]: Use it.
[arguments]: Do not assume x86, rather use actual ARCH in #:make-flags, and
follow upstream's "amd64" symlinking voodoo.

Change-Id: Ie825e56779dae2f489066569dc3c4405bac778c1
---
 gnu/local.mk                           |  1 +
 gnu/packages/hurd.scm                  | 19 ++++++++++++++++++-
 gnu/packages/patches/netdde-csum.patch | 18 ++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/netdde-csum.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index b6e25cd43d..e4b6de83cb 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1826,6 +1826,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ncftp-reproducible.patch			\
   %D%/packages/patches/netcdf-date-time.patch			\
   %D%/packages/patches/netdde-build-fix.patch			\
+  %D%/packages/patches/netdde-csum.patch			\
   %D%/packages/patches/netpbm-CVE-2017-2586.patch		\
   %D%/packages/patches/netpbm-CVE-2017-2587.patch		\
   %D%/packages/patches/netsurf-message-timestamp.patch		\
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 2c231425aa..defa3f2689 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -579,7 +579,8 @@ (define-public netdde
                 (uri (git-reference
                       (url "https://git.savannah.gnu.org/git/hurd/incubator.git")
                       (commit commit)))
-                (patches (list (search-patch "netdde-build-fix.patch")))
+                (patches (search-patches "netdde-build-fix.patch"
+                                         "netdde-csum.patch"))
                 (sha256
                  (base32
                   "070fpmd4nvn3mp8dj9w4if63iwz7j2m0h6ywq888znw70wlrc6sh"))
@@ -599,6 +600,13 @@ (define-public netdde
                               " -Wno-int-conversion"
                               " -Wno-strict-prototypes")
                "ARCH=x86")
+               (let ((arch ,(match (or (%current-target-system)
+                                       (%current-system))
+                              ((? target-x86-32?)
+                               "x86")
+                              ((? target-x86-64?)
+                               "amd64"))))
+                 (string-append "ARCH=" arch)))
          #:configure-flags
          ,#~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
          #:phases
@@ -616,6 +624,15 @@ (define-public netdde
                  (("/bin/bash") (which "bash")))))
            (add-after 'patch-generated-file-shebangs 'build-libdde-linux26
              (lambda* (#:key make-flags #:allow-other-keys)
+               (when ,(target-hurd64?)
+                 (let ((dir "libdde_linux26/build/include"))
+                   (mkdir-p (string-append dir "/x86"))
+                   (format #t "symlink ~a -> ~a\n"
+                           (string-append dir "/x86/amd64") "x86")
+                   (symlink "x86" (string-append dir "/amd64"))
+                   (format #t "symlink ~a -> ~a\n"
+                           (string-append dir "/amd64/asm-x86_64") "asm-x86")
+                   (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64"))))
                (with-directory-excursion "libdde_linux26"
                  (apply invoke "make"
                         (delete "PKGDIR=libdde_linux26" make-flags)))))
diff --git a/gnu/packages/patches/netdde-csum.patch b/gnu/packages/patches/netdde-csum.patch
new file mode 100644
index 0000000000..4fdd004898
--- /dev/null
+++ b/gnu/packages/patches/netdde-csum.patch
@@ -0,0 +1,18 @@
+Upstream-status: Taken from debian.
+
+<https://salsa.debian.org/hurd-team/netdde/raw/master/debian/patches/csum>.
+
+---
+ linux/drivers/net/vmxnet3/vmxnet3_drv.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/linux/drivers/net/vmxnet3/vmxnet3_drv.c
++++ b/linux/drivers/net/vmxnet3/vmxnet3_drv.c
+@@ -25,6 +25,7 @@
+  */
+ 
+ #include "vmxnet3_int.h"
++#include <net/ip6_checksum.h>
+ 
+ char vmxnet3_driver_name[] = "vmxnet3";
+ #define VMXNET3_DRIVER_DESC "VMware vmxnet3 virtual NIC driver"
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 34/51] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (32 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 33/51] gnu: netdde: Support the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 35/51] gnu: rumpkernel: Support the 64bit Hurd Janneke Nieuwenhuizen
                     ` (16 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (rumpkernel): Update to
f1ffd6405f225336e595a0f99f01095ed7438337.
[arguments]: In stage "build", add "-Wno-error=sign-compare" to CWARNFLAGS.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/packages/hurd.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index defa3f2689..0df514cc78 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -676,8 +676,8 @@ (define-public netdde
       (license gpl2))))
 
 (define-public rumpkernel
-  (let ((commit "81043d42fabda9baed7ac9ca36e3f3f5ed11ba81")
-        (revision "3"))
+  (let ((commit "f1ffd6405f225336e595a0f99f01095ed7438337")
+        (revision "0"))
     (package
       (name "rumpkernel")
       (version (git-version "0-20211031" revision commit))
@@ -691,7 +691,7 @@ (define-public rumpkernel
                       (commit commit)))
                 (sha256
                  (base32
-                  "0fv0k52qqcg3nq9012hibgsamvsd7mnvn2ikdasmzjhsp8qh5q3r"))
+                  "1ygn3ysji06ik3k44sf906fjpdmabznkspw70llldbk2zkrcdw7i"))
                 (file-name (git-file-name name version))))
       (build-system gnu-build-system)
       (arguments
@@ -811,7 +811,8 @@ (define-public rumpkernel
                            " -Wno-error=stack-protector"
                            " -Wno-error=array-parameter"
                            " -Wno-error=array-bounds"
-                           " -Wno-error=stringop-overflow")
+                           " -Wno-error=stringop-overflow"
+                           " -Wno-error=sign-compare")
                      "-V" "LIBCRTBEGIN="
                      "-V" "LIBCRTEND="
                      "-V" "LIBCRT0="
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 35/51] gnu: rumpkernel: Support the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (33 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 34/51] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337 Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 36/51] gnu: hurd: Build fixes for " Janneke Nieuwenhuizen
                     ` (15 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (rumpkernel)[argument]: In stage "build", follow
Debian upstream to use -DPAE disable the DTRACE and ZFS builds.

Change-Id: I534da31eefb378c72b4896d64a51a73109e38aa6
---
 gnu/packages/hurd.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 0df514cc78..6701d00251 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -792,6 +792,9 @@ (define-public rumpkernel
                      "-V" "MKBINUTILS=no"
                      "-V" "MKGDB=no"
                      "-V" "MKGROFF=no"
+                     "-V" "MKDTRACE=no"
+                     "-V" "MKZFS=no"
+
                      "-V" (string-append "TOPRUMP=" toprump)
                      "-V" "BUILDRUMP_CPPFLAGS=-Wno-error=stringop-overread"
                      "-V" "RUMPUSER_EXTERNAL_DPLIBS=pthread"
@@ -802,7 +805,8 @@ (define-public rumpkernel
                            " -DRUMP_REGISTER_T=int"
                            " -DRUMPUSER_CONFIG=yes"
                            " -DNO_PCI_MSI_MSIX=yes"
-                           " -DNUSB_DMA=1")
+                           " -DNUSB_DMA=1"
+                           " -DPAE")
                      "-V" (string-append
                            "CWARNFLAGS="
                            " -Wno-error=maybe-uninitialized"
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 36/51] gnu: hurd: Build fixes for the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (34 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 35/51] gnu: rumpkernel: Support the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 37/51] gnu: inetutils: Fix build " Janneke Nieuwenhuizen
                     ` (14 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/hurd-64bit.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hurd.scm (hurd)[source]: Use it.
[arguments]: When building for the 64bit Hurd, add "create-machine-symlink"
phase.  In phases "build-libdde-linux" and "install-goodies", do not assume
x86, rather use actual ARCH, and follow upstream's "amd64" symlinking voodoo.

Change-Id: If264a91b2433add13f9121c482f0abe67ae5f1e9
---
 gnu/local.mk                          |   1 +
 gnu/packages/hurd.scm                 | 126 ++++++++++++++++----------
 gnu/packages/patches/hurd-64bit.patch |  56 ++++++++++++
 3 files changed, 135 insertions(+), 48 deletions(-)
 create mode 100644 gnu/packages/patches/hurd-64bit.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index e4b6de83cb..8a607e5df7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1553,6 +1553,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/htslib-for-stringtie.patch		\
   %D%/packages/patches/hubbub-sort-entities.patch		\
   %D%/packages/patches/hueplusplus-mbedtls.patch		\
+  %D%/packages/patches/hurd-64bit.patch				\
   %D%/packages/patches/hurd-rumpdisk-no-hd.patch		\
   %D%/packages/patches/hurd-startup.patch			\
   %D%/packages/patches/hwloc-1-test-btrfs.patch			\
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 6701d00251..63249b4ef7 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -317,7 +317,8 @@ (define-public hurd
     (source (origin
               (inherit (package-source hurd-headers))
               (patches (search-patches "hurd-rumpdisk-no-hd.patch"
-                                       "hurd-startup.patch"))))
+                                       "hurd-startup.patch"
+                                       "hurd-64bit.patch"))))
     (version (package-version hurd-headers))
     (arguments
      `(#:tests? #f                      ;no "check" target
@@ -467,54 +468,84 @@ (define-public hurd
                          (find-files (string-append out "/libexec")))
                #t)))
          (add-after 'build 'build-libdde-linux
-           (lambda* (#:key inputs native-inputs #:allow-other-keys)
-             (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
-                                    "/bin/make")
-                     ;; XXX There can be a race condition because subdirs
-                     ;; aren't interdependent targets in the Makefile.
-                     "-j1" "-C" "libdde_linux26"
-                     (string-append "SHELL="
-                                    (assoc-ref (or native-inputs inputs) "bash")
-                                    "/bin/bash")
-                     (string-append "CC="
-                                    ,(cc-for-target))
-                     (string-append "WARNINGS="
-                                    " -Wno-declaration-missing-parameter-type"
-                                    " -Wno-implicit-function-declaration"
-                                    " -Wno-implicit-int"
-                                    " -Wno-int-conversion"
-                                    " -Wno-strict-prototypes")
-                     "ARCH=x86")))
+          (lambda* (#:key inputs native-inputs #:allow-other-keys)
+            (let ((arch ,(match (or (%current-target-system)
+                                    (%current-system))
+                           ((? target-x86-32?)
+                            "x86")
+                           ((? target-x86-64?)
+                            "amd64"))))
+              (when ,(target-hurd64?)
+                (let ((dir "libdde_linux26/build/include"))
+                  (mkdir-p (string-append dir "/x86"))
+                  (format #t "symlink ~a -> ~a\n"
+                          (string-append dir "/x86/amd64") "x86")
+                  (symlink "x86" (string-append dir "/amd64"))
+                  (format #t "symlink ~a -> ~a\n"
+                          (string-append dir "/amd64/asm-x86_64") "asm-x86")
+                  (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64"))))
+              (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
+                                     "/bin/make")
+                      ;; XXX There can be a race condition because subdirs
+                      ;; aren't interdependent targets in the Makefile.
+                      "-j1" "-C" "libdde_linux26"
+                      (string-append "SHELL="
+                                     (assoc-ref (or native-inputs inputs) "bash")
+                                     "/bin/bash")
+                      (string-append "CC="
+                                     ,(cc-for-target))
+                      (string-append "WARNINGS="
+                                     " -Wno-declaration-missing-parameter-type"
+                                     " -Wno-implicit-function-declaration"
+                                     " -Wno-implicit-int"
+                                     " -Wno-int-conversion"
+                                     " -Wno-strict-prototypes")
+                      (string-append "ARCH=" arch)))))
          (add-after 'install 'install-goodies
-           (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
-             ;; Install additional goodies.
-             ;; TODO: Build & install *.msgids for rpctrace.
-             (let* ((out (assoc-ref outputs "out"))
-                    (datadir (string-append out "/share/hurd")))
-               ;; Install libdde_linux26.
-               (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
-                                      "/bin/make")
-                       "-C" "libdde_linux26" "install"
-                       (string-append "SHELL="
-                                      (assoc-ref (or native-inputs inputs) "bash")
-                                      "/bin/bash")
-                       (string-append "INSTALLDIR="
-                                      out
-                                      "/share/libdde_linux26/build/include")
-                       "ARCH=x86")
-               ;; Install the fancy UTF-8 motd.
-               (mkdir-p (string-append out "/etc"))
-               (copy-file "console/motd.UTF8"
-                          (string-append out "/etc/motd"))
+          (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
+            ;; Install additional goodies.
+            ;; TODO: Build & install *.msgids for rpctrace.
+            (let* ((out (assoc-ref outputs "out"))
+                   (datadir (string-append out "/share/hurd"))
+                   (arch ,(match (or (%current-target-system)
+                                     (%current-system))
+                            ((? target-x86-32?)
+                             "x86")
+                            ((? target-x86-64?)
+                             "amd64")))
+                   (dir (string-append out "/share/libdde_linux26/build/include")))
+              (mkdir-p dir)
+              (when ,(target-hurd64?)
+                (mkdir-p (string-append dir "/amd64"))
+                (format #t "symlink ~a -> ~a\n"
+                        (string-append dir "/amd64/asm-x86_64")
+                        "x86")
+                (symlink "x86" (string-append dir "/amd46")))
+              (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
+                                     "/bin/make")
+                      "-C" "libdde_linux26" "install"
+                      (string-append "SHELL="
+                                     (assoc-ref (or native-inputs inputs) "bash")
+                                     "/bin/bash")
+                      (string-append "INSTALLDIR=" dir)
+                      (string-append "ARCH=" arch))
+              (when ,(target-hurd64?)
+                (format #t "symlink ~a -> ~a\n"
+                        (string-append dir "/amd64/asm-x86_64")
+                        "asm-x86")
+                (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64")))
+              ;; Install the fancy UTF-8 motd.
+              (mkdir-p (string-append out "/etc"))
+              (copy-file "console/motd.UTF8"
+                         (string-append out "/etc/motd"))
 
-               ;; Install the BDF font for use by the console client.
-               (copy-file (assoc-ref inputs "unifont")
-                          "unifont.gz")
-               (invoke "gunzip" "unifont.gz")
-               (mkdir-p datadir)
-               (copy-file "unifont"
-                          (string-append datadir "/vga-system.bdf"))
-               #t))))
+              ;; Install the BDF font for use by the console client.
+              (copy-file (assoc-ref inputs "unifont")
+                         "unifont.gz")
+              (invoke "gunzip" "unifont.gz")
+              (mkdir-p datadir)
+              (copy-file "unifont"
+                         (string-append datadir "/vga-system.bdf"))))))
        #:configure-flags
        ,#~(list (string-append "LDFLAGS=-Wl,-rpath="
                                #$output "/lib")
@@ -599,7 +630,6 @@ (define-public netdde
                               " -Wno-implicit-int"
                               " -Wno-int-conversion"
                               " -Wno-strict-prototypes")
-               "ARCH=x86")
                (let ((arch ,(match (or (%current-target-system)
                                        (%current-system))
                               ((? target-x86-32?)
diff --git a/gnu/packages/patches/hurd-64bit.patch b/gnu/packages/patches/hurd-64bit.patch
new file mode 100644
index 0000000000..643550ad68
--- /dev/null
+++ b/gnu/packages/patches/hurd-64bit.patch
@@ -0,0 +1,56 @@
+Upstream-status: Taken from upstream:
+    <https://git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=d494333e7607ea03819adcfb69d89f8248ec2044>.
+
+From d494333e7607ea03819adcfb69d89f8248ec2044 Mon Sep 17 00:00:00 2001
+From: Flavio Cruz <flaviocruz@gmail.com>
+Date: Sun, 21 Jul 2024 17:20:55 -0400
+Subject: [PATCH] nfsd: fix -Werror=incompatible-pointer-types issues for
+ x86_64
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+Message-ID: <3pmgbk2myx4phdb6wcso54solmybulrvbytols5md3nri2p2qp@xjmfmpvwjp6t>
+---
+ nfsd/cache.c | 2 +-
+ nfsd/ops.c   | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/nfsd/cache.c b/nfsd/cache.c
+index cd5524af..864739c0 100644
+--- a/nfsd/cache.c
++++ b/nfsd/cache.c
+@@ -387,7 +387,7 @@ create_cached_handle (int fs, struct cache_handle *credc, file_t userport)
+   struct cache_handle *c;
+   int hash;
+   char *bp = fhandle.array + sizeof (int);
+-  size_t handlelen = NFS2_FHSIZE - sizeof (int);
++  mach_msg_type_number_t handlelen = NFS2_FHSIZE - sizeof (int);
+   mach_port_t newport, ref;
+ 
+   /* Authenticate USERPORT so that we can call file_getfh on it.  */
+diff --git a/nfsd/ops.c b/nfsd/ops.c
+index 463a9c87..64e94b93 100644
+--- a/nfsd/ops.c
++++ b/nfsd/ops.c
+@@ -292,7 +292,7 @@ op_write (struct cache_handle *c,
+   off_t offset;
+   size_t count;
+   error_t err;
+-  mach_msg_type_number_t amt;
++  vm_size_t amt;
+   char *bp;
+   struct stat st;
+ 
+@@ -583,7 +583,7 @@ op_readdir (struct cache_handle *c,
+   error_t err;
+   char *buf;
+   struct dirent *dp;
+-  size_t bufsize;
++  mach_msg_type_number_t bufsize;
+   int nentries;
+   int i;
+   int *replystart;
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 37/51] gnu: inetutils: Fix build for the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (35 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 36/51] gnu: hurd: Build fixes for " Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 38/51] gnu: grub: " Janneke Nieuwenhuizen
                     ` (13 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290; +Cc: Ricardo Wurmus

* gnu/packages/patches/inetutils-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/admin.scm (inetutils)[arguments]: When building for the 64bit
Hurd, use it in new "apply-hurd64-patch" stage.

Change-Id: I780f6a92418b49e5fe0d23eb1c90e155216f1428
---
 gnu/local.mk                                |  1 +
 gnu/packages/admin.scm                      | 14 ++++-
 gnu/packages/patches/inetutils-hurd64.patch | 65 +++++++++++++++++++++
 3 files changed, 78 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/inetutils-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 8a607e5df7..0979414ec2 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1577,6 +1577,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/indent-CVE-2024-0911.patch	\
   %D%/packages/patches/instead-use-games-path.patch		\
   %D%/packages/patches/intltool-perl-compatibility.patch	\
+  %D%/packages/patches/inetutils-hurd64.patch			\
   %D%/packages/patches/irrlicht-use-system-libs.patch		\
   %D%/packages/patches/irrlicht-link-against-needed-libs.patch	\
   %D%/packages/patches/isl-0.11.1-aarch64-support.patch	\
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 9c765b51a9..311d613b68 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -31,7 +31,7 @@
 ;;; Copyright © 2019, 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2019, 2020, 2021 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
@@ -1044,7 +1044,17 @@ (define-public inetutils
                              "\\\""))
       ;; On some systems, 'libls.sh' may fail with an error such as:
       ;; "Failed to tell switch -a apart from -A".
-      #:parallel-tests? #f))
+      #:parallel-tests? #f
+      #:phases (if (target-hurd64?)
+                   #~(modify-phases %standard-phases
+                       (add-after 'unpack 'apply-hurd64-patch
+                         (lambda _
+                           (let ((patch
+                                  #$(local-file
+                                     (search-patch
+                                      "inetutils-hurd64.patch"))))
+                             (invoke "patch" "--force" "-p1" "-i" patch)))))
+                   #~%standard-phases)))
     (inputs
      (list coreutils
            shadow                     ;for login (used in telnetd and rlogind)
diff --git a/gnu/packages/patches/inetutils-hurd64.patch b/gnu/packages/patches/inetutils-hurd64.patch
new file mode 100644
index 0000000000..3fb238bcdc
--- /dev/null
+++ b/gnu/packages/patches/inetutils-hurd64.patch
@@ -0,0 +1,65 @@
+Upstream-status: Not presented upstream.
+
+From 0804e655a7abfd22dc3a053f03fab8f811405f84 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Fri, 8 Nov 2024 11:07:56 +0100
+Subject: [PATCH] ifconfig hurd: Build fix for the 64bit HUrd.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+* ifconfig/system/hurd.c (check_driving): Use mach_msg_type_number_t
+instead of size_t for file_get_fs_options.
+---
+ ifconfig/system/hurd.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/ifconfig/system/hurd.c b/ifconfig/system/hurd.c
+index 70b2ed27..86fe6375 100644
+--- a/ifconfig/system/hurd.c
++++ b/ifconfig/system/hurd.c
+@@ -47,7 +47,7 @@ check_driving (const char *name)
+   error_t err;
+ 
+   char *argz = 0, *new_argz = 0;
+-  size_t argz_len = 0;
++  mach_msg_type_number_t argz_len = 0;
+   char *entry = 0;
+   const char *socket = _SERVERS_SOCKET "/2";
+ 
+@@ -106,7 +106,9 @@ check_driving (const char *name)
+   new_argz = malloc (argz_len);
+   memcpy (new_argz, argz, argz_len);
+ 
+-  err = argz_insert (&new_argz, &argz_len, new_argz, name);
++  size_t new_argz_len = 0;
++
++  err = argz_insert (&new_argz, &new_argz_len, new_argz, name);
+   if (err)
+     {
+       error (0, err, "Could not prepend name %s to '%s' for %s", name,
+@@ -114,7 +116,7 @@ check_driving (const char *name)
+       goto out;
+     }
+ 
+-  err = argz_insert (&new_argz, &argz_len, new_argz, "-i");
++  err = argz_insert (&new_argz, &new_argz_len, new_argz, "-i");
+   if (err)
+     {
+       argz_stringify (new_argz, argz_len, ' ');
+@@ -122,10 +124,10 @@ check_driving (const char *name)
+       goto out;
+     }
+ 
+-  err = fsys_set_options (fsys, new_argz, argz_len, 1);
++  err = fsys_set_options (fsys, new_argz, new_argz_len, 1);
+   if (err)
+     {
+-      argz_stringify (new_argz, argz_len, ' ');
++      argz_stringify (new_argz, new_argz_len, ' ');
+       error (0, err, "Could not make pfinet %s drive %s with '%s'", socket,
+ 	     name, new_argz);
+       goto out;
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 38/51] gnu: grub: Fix build for the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (36 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 37/51] gnu: inetutils: Fix build " Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 39/51] gnu: guile-fibers: " Janneke Nieuwenhuizen
                     ` (12 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290; +Cc: Efraim Flashner, Vagrant Cascadian

* gnu/packages/patches/grub-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/bootloaders.scm (grub)[arguments]: When building for the 64bit
Hurd, use it in new "apply-hurd64-patch" stage.

Change-Id: I780f6a92418b49e5fe0d23eb1c90e155216f1428
---
 gnu/local.mk                           |  1 +
 gnu/packages/bootloaders.scm           |  8 +++++++
 gnu/packages/patches/grub-hurd64.patch | 32 ++++++++++++++++++++++++++
 3 files changed, 41 insertions(+)
 create mode 100644 gnu/packages/patches/grub-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 0979414ec2..84966efdb5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1494,6 +1494,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gromacs-tinyxml2.patch			\
   %D%/packages/patches/groovy-add-exceptionutilsgenerator.patch	\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
+  %D%/packages/patches/grub-hurd64.patch			\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index da5abaca55..61ea74b69a 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -192,6 +192,14 @@ (define-public grub
                        (setenv "BUILD_FREETYPE_CFLAGS"
                                (string-append "-I" freetype
                                               "/include/freetype2"))))))
+               #$@(if (target-hurd64?)
+                      #~((add-after 'unpack 'apply-hurd64-patch
+                           (lambda _
+                             (let ((patch
+                                    #$(local-file
+                                       (search-patch "grub-hurd64.patch"))))
+                               (invoke "patch" "--force" "-p1" "-i" patch)))))
+                      #~())
                (add-before 'check 'disable-flaky-test
                  (lambda _
                    ;; This test is unreliable. For more information, see:
diff --git a/gnu/packages/patches/grub-hurd64.patch b/gnu/packages/patches/grub-hurd64.patch
new file mode 100644
index 0000000000..d5acd99eb8
--- /dev/null
+++ b/gnu/packages/patches/grub-hurd64.patch
@@ -0,0 +1,32 @@
+Upstream-status: Not presented upstream.
+
+From a4eb7d1f2cbd02132a9f5512f1294182576d4653 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Fri, 8 Nov 2024 11:47:49 +0100
+Subject: [PATCH] osdep/hurd: Support the 64bit Hurd.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+* grub-core/osdep/hurd/getroot.c (grub_util_find_hurd_root_device):
+Use mach_msg_type_number_t instead of size_t.
+---
+ grub-core/osdep/hurd/getroot.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/grub-core/osdep/hurd/getroot.c b/grub-core/osdep/hurd/getroot.c
+index 0efefdab4..b849700e6 100644
+--- a/grub-core/osdep/hurd/getroot.c
++++ b/grub-core/osdep/hurd/getroot.c
+@@ -58,7 +58,7 @@ grub_util_find_hurd_root_device (const char *path)
+   file_t file;
+   error_t err;
+   char *argz = NULL, *name = NULL, *ret;
+-  size_t argz_len = 0;
++  mach_msg_type_number_t argz_len = 0;
+   int i;
+ 
+   file = file_name_lookup (path, 0, 0);
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 39/51] gnu: guile-fibers: Fix build for the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (37 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 38/51] gnu: grub: " Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 40/51] gnu: m4: " Janneke Nieuwenhuizen
                     ` (11 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/guile-xyz.scm (guile-fibers)[arguments]: Also modify phases for
the 64bit Hurd.

Change-Id: I780f6a92418b49e5fe0d23eb1c90e155216f1428
---
 gnu/packages/guile-xyz.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 044a491259..f0f16125d6 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -856,7 +856,7 @@ (define-public guile-fibers
      (list #:make-flags
            #~(list "GUILE_AUTO_COMPILE=0")
            #:phases
-           (if (target-x86-64?)
+           (if (and (target-x86-64?) (not (target-hurd?)))
                #~%standard-phases
                #~(modify-phases %standard-phases
                    (add-before 'check 'disable-some-tests
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 40/51] gnu: m4: Fix build for the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (38 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 39/51] gnu: guile-fibers: " Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 41/51] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714 Janneke Nieuwenhuizen
                     ` (10 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/base.scm (grep)[arguments]: When building for the 64bit Hurd,
add patch-sigsegv.h stage.

Change-Id: I82993ebde268867348893556a9476faa5c4e9453
---
 gnu/packages/m4.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/m4.scm b/gnu/packages/m4.scm
index 39b50b6800..081304db34 100644
--- a/gnu/packages/m4.scm
+++ b/gnu/packages/m4.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -64,6 +64,13 @@ (define-public m4
                       (("(^| )main *\\(.*" all)
                        (string-append all "{\n  exit (77);//"))))))
               '())
+        ,@(if (target-hurd64?)
+              '((add-after 'unpack 'patch-sigsegv
+                  (lambda _
+                    ;; Stack overflow recovery does not compile
+                    (substitute* "lib/sigsegv.in.h"
+                      (("__GNU__") "__XGNU__")))))
+              '())
         (add-after 'unpack 'configure-shell
           (lambda* (#:key native-inputs inputs #:allow-other-keys)
             (let ((/bin/sh (search-input-file (or native-inputs inputs)
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 41/51] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (39 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 40/51] gnu: m4: " Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 42/51] gnu: commencement: mig-boot0: Update to 1.8+git20231217 Janneke Nieuwenhuizen
                     ` (9 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (gnumach-headers-boot0): Update to
1.8+git20240714.

Change-Id: If30d7b4a688070d70741173c97a60284ca8299ef
---
 gnu/packages/commencement.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 1cfaaae1e7..2f805b3e63 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2635,7 +2635,7 @@ (define gnumach-headers-boot0
    (package
      (inherit gnumach-headers)
      (name "gnumach-headers-boot0")
-     (version "1.8+git20230410")
+     (version "1.8+git20240714")
      (source
       (origin
         (inherit (package-source gnumach-headers))
@@ -2649,7 +2649,7 @@ (define gnumach-headers-boot0
                   "gnumach-" version ".tar.gz"))
             (sha256
              (base32
-              "1s09256g2ny46idrn8frzs7r51la9ni45bmglmswlsmz9ii7dpi4")))))))
+              "1bnw5vdbq91zjxklx23qvim40fb0yw1qdxhn9n37jdfypm6q3xir")))))))
      (native-inputs (list autoconf-boot0 automake-boot0 texinfo-boot0))
      (arguments
       (substitute-keyword-arguments (package-arguments gnumach-headers)
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 42/51] gnu: commencement: mig-boot0: Update to 1.8+git20231217..
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (40 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 41/51] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714 Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 43/51] gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714 Janneke Nieuwenhuizen
                     ` (8 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (mig-boot0): Update to 1.8+git20231217.

Change-Id: I591ff7cb84ac1e567d49f51eb40be19fa6b15f5b
---
 gnu/packages/commencement.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 2f805b3e63..742ccbc63b 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2670,7 +2670,7 @@ (define mig-boot0
    (package
      (inherit mig)
      (name "mig-boot0")
-     (version "1.8+git20230520")
+     (version "1.8+git20231217")
      (source
       (origin
         (inherit (package-source mig))
@@ -2683,7 +2683,7 @@ (define mig-boot0
                   "mig-" version ".tar.gz"))
             (sha256
              (base32
-              "1l1vfm4wap5yxylv91wssgpy7fnq22wp3akgd5nv995kychfa9jy")))))))
+              "18vz3ifrhhlvrdmlv70h63wl0kh5w8jcpsjx9yscsw9yazm1lzs7")))))))
      (native-inputs (list autoconf-boot0 automake-boot0 bison-boot0 flex-boot0
                           gnumach-headers-boot0))
      (inputs (list flex-boot0 gnumach-headers-boot0))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 43/51] gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (41 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 42/51] gnu: commencement: mig-boot0: Update to 1.8+git20231217 Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 44/51] gnu: commencement: libstdc++-boot0-gcc7: Replace by make-libstdc++-boot0 Janneke Nieuwenhuizen
                     ` (7 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (hurd-headers-boot0): Update to
0.9.git20240714.

Change-Id: Ib3edaa3adb9cfe4cb8c5a3af83cb2701ee9dda1b
---
 gnu/packages/commencement.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 742ccbc63b..ad70bae501 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2699,7 +2699,7 @@ (define hurd-headers-boot0
    (package
      (inherit hurd-headers)
      (name "hurd-headers-boot0")
-     (version "0.9.git20230520")
+     (version "0.9.git20240714")
      (source
       (origin
         (inherit (package-source hurd-headers))
@@ -2712,7 +2712,7 @@ (define hurd-headers-boot0
                   "hurd-v" version ".tar.gz"))
             (sha256
              (base32
-              "0ybmx7bhy21zv1if2hfdspn13zn68vki1na72sw2jj87gj8przna")))))))
+              "0wcihffclwijjamx4cjbr8i92yg780538ipg2z208ahg96jjrmgq")))))))
      (native-inputs
       (list autoconf-boot0 automake-boot0 mig-boot0))
      (inputs '()))))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 44/51] gnu: commencement: libstdc++-boot0-gcc7: Replace by make-libstdc++-boot0.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (42 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 43/51] gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714 Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 45/51] gnu: gettext: Fix cross-build shebangs Janneke Nieuwenhuizen
                     ` (6 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (libstdc++-boot0-gcc7): Change variable to...
(make-libstdc++-boot0): ...this new procedure and update accordingly.
(gcc-boot0): Update accordingly, and cater for x86_64-gnu.

Change-Id: Ib0bc84e4dab90b080e5a01e6ab932f8be456c656
---
 gnu/packages/commencement.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index ad70bae501..a14de3002f 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2273,9 +2273,9 @@ (define libstdc++-boot0
       (inputs (%boot0-inputs))
       (native-inputs '()))))
 
-(define libstdc++-boot0-gcc7
+(define (make-libstdc++-boot0 gcc)
   ;; GCC >= 7 is needed by architectures which use C++-14 features.
-  (let ((lib (make-libstdc++ gcc-7)))
+  (let ((lib (make-libstdc++ gcc)))
     (package
       (inherit lib)
       (source (bootstrap-origin (package-source lib)))
@@ -2446,7 +2446,8 @@ (define gcc-boot0
 
               ;; The libstdc++ that libcc1 links against.
               ("libstdc++" ,(match (%current-system)
-                                   ("riscv64-linux" libstdc++-boot0-gcc7)
+                                   ("riscv64-linux" (make-libstdc++-boot0 gcc-7))
+                                   ("x86_64-gnu" (make-libstdc++-boot0 gcc-14))
                                    (_ libstdc++-boot0)))
 
               ;; Call it differently so that the builder can check whether
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 45/51] gnu: gettext: Fix cross-build shebangs.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (43 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 44/51] gnu: commencement: libstdc++-boot0-gcc7: Replace by make-libstdc++-boot0 Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 46/51] gnu: Add gdb-15.2, with support for the 64bit Hurd Janneke Nieuwenhuizen
                     ` (5 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290

This fixes running autopoint from a cross-built gettext[-minimal].

* gnu/packages/gettext.scm (gettext-minimal): When cross-building, add stage
"patch-cross-shebangs".

Change-Id: I5029a3be0b5cee3c173de66d8f0b027b02c3bc47
---
 gnu/packages/gettext.scm | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm
index cabe4f3be9..7862c296bd 100644
--- a/gnu/packages/gettext.scm
+++ b/gnu/packages/gettext.scm
@@ -9,7 +9,7 @@
 ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Miguel <rosen644835@gmail.com>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020 EuAndreh <eu@euandre.org>
 ;;; Copyright © 2022, 2024 gemmaro <gemmaro.dev@gmail.com>
 ;;; Copyright © 2023 Maxim Cournoyer maxim.cournoyer@gmail.com>
@@ -130,7 +130,19 @@ (define-public gettext-minimal
                                    ((" test-tls\\$\\(EXEEXT\\) ") " ")))
                               '())
 
-                       #t)))))
+                       #t))))
+          #$@(if (%current-target-system)
+                 #~((add-after 'install 'patch-cross-shebangs
+                      (lambda _
+                        (let ((path (list (string-append #$bash-minimal "/bin"))))
+                          (define (patch-cross-shebang file)
+                            (patch-shebang file path))
+                          (with-directory-excursion
+                              (string-append #$output "/bin")
+                            (for-each
+                             patch-cross-shebang
+                             '("autopoint" "gettext.sh" "gettextize")))))))
+                 '()))
 
        ;; When tests fail, we want to know the details.
        #:make-flags #~'("VERBOSE=yes")))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 46/51] gnu: Add gdb-15.2, with support for the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (44 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 45/51] gnu: gettext: Fix cross-build shebangs Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 47/51] gnu: bootstrap: %bootstrap-glibc: Also fix libm.so Janneke Nieuwenhuizen
                     ` (4 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/gdb-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/gdb.scm (gdb-15): Use it in new variable.
(gdb-minmal-15): New variable.
(gdb/pinned): When building for the 64bit Hurd, set #:configure-flags to
"--enable-targets=i586-pc-gnu,x86_64-pc-gnu".

Change-Id: I52d28092be6c415b8668bb5a77d41c87df841351
---
 gnu/local.mk                          |   1 +
 gnu/packages/gdb.scm                  |  22 +
 gnu/packages/patches/gdb-hurd64.patch | 923 ++++++++++++++++++++++++++
 3 files changed, 946 insertions(+)
 create mode 100644 gnu/packages/patches/gdb-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 84966efdb5..552eefeaeb 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1374,6 +1374,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gcolor3-update-libportal-usage.patch	\
   %D%/packages/patches/gd-fix-tests-on-i686.patch		\
   %D%/packages/patches/gd-brect-bounds.patch			\
+  %D%/packages/patches/gdb-hurd64.patch				\
   %D%/packages/patches/gdm-default-session.patch		\
   %D%/packages/patches/gdm-elogind-support.patch		\
   %D%/packages/patches/gdm-remove-hardcoded-xwayland-path.patch	\
diff --git a/gnu/packages/gdb.scm b/gnu/packages/gdb.scm
index bf46716047..af5ebde3f6 100644
--- a/gnu/packages/gdb.scm
+++ b/gnu/packages/gdb.scm
@@ -67,6 +67,9 @@ (define-public gdb/pinned
       #:out-of-source? #t
       #:modules `((srfi srfi-1)
                   ,@%default-gnu-modules)
+      #:configure-flags (if (target-hurd64?)
+                            #~'("--enable-targets=i586-pc-gnu,x86_64-pc-gnu")
+                            #~'())
       #:phases #~(modify-phases %standard-phases
                    (add-after 'unpack 'patch-paths
                      (lambda* (#:key inputs #:allow-other-keys)
@@ -160,6 +163,19 @@ (define-public gdb-14
                 "0wkprsjyyh204fdjlkaz20k847l88i9y8m9zqsv15vcd3l3dhk9d"))))
     (properties '())))
 
+(define-public gdb-15
+  (package
+    (inherit gdb-14)
+    (version "15.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://gnu/gdb/gdb-"
+                                  version ".tar.xz"))
+              (patches (search-patches "gdb-hurd64.patch"))
+              (sha256
+               (base32
+                "0k9i8mizg4hby020k53kqmc835pajh9c8d5klv5s1ddm6p6hqdc3"))))))
+
 (define-public gdb
   ;; The "default" version.
   gdb-14)
@@ -184,6 +200,12 @@ (define-public gdb-minimal
     (inputs (fold alist-delete (package-inputs gdb)
                   '("libxml2" "ncurses" "python-wrapper" "source-highlight")))))
 
+(define-public gdb-minimal-15
+  (package/inherit gdb-15
+    (name "gdb-minimal")
+    (inputs (fold alist-delete (package-inputs gdb-15)
+                  '("libxml2" "ncurses" "python-wrapper" "source-highlight")))))
+
 (define-public avr-gdb
   (package/inherit gdb-14
     (name "avr-gdb")
diff --git a/gnu/packages/patches/gdb-hurd64.patch b/gnu/packages/patches/gdb-hurd64.patch
new file mode 100644
index 0000000000..50e44b3684
--- /dev/null
+++ b/gnu/packages/patches/gdb-hurd64.patch
@@ -0,0 +1,923 @@
+Upstream-status: Taken from bug-hurd
+
+    <https://lists.gnu.org/archive/html/bug-hurd/2024-07/msg00001.html>.
+
+and gdb-patches
+
+    <https://inbox.sourceware.org/gdb-patches/cw5yn6mfyjxdxv4kzhmqy76tjclttc3cykptidqwdfd5syrw36@r6j6p4cewhs6/T/>
+
+mailing lists.
+
+From 6131a7a8951bc255d6c013de126c46b620434d2f Mon Sep 17 00:00:00 2001
+From: Flavio Cruz <flaviocruz@gmail.com>
+Date: Wed, 3 Jul 2024 22:45:33 +0100
+Subject: [PATCH 1/2] Port GDB to Hurd x86_64.
+
+This port extends the existing i686 port to support x86_64 by trying to
+reuse existing code whenever it makes sense.
+
+* gdb/amd64-gnu-tdep.c: Adds logic for handling signal frames and
+  position of amd64 registers in the different Hurd structs.
+  The signal code is very similar to i686, except the trampoline code
+  is adapted.
+* gdb/config/i386/nm-i386gnu.h: renamed to gdb/config/i386/nm-x86-gnu.h
+  and adapt it for x86_64.
+* gdb/config/i386/i386gnu.mn: renamed to gdb/config/i386/nm-x86-gnu.mn
+  and reuse it for x86_64.
+* gdb/configure.host: recognize gnu64 as a host.
+* gdb/configure.nat: recognize gnu64 host and update existing i386gnu to
+  reuse the new shared files.
+* gdb/configure.tgt: recognize x86_64-*-gnu* triplet and use
+  amd64-gnu-tdep.c.
+* gdb/i386-gnu-tdep.c: added i386_gnu_thread_state_reg_offset that is
+  copied from i386-gnu-nat.c. This makes it similar to amd64.
+* gdb/i386-gnu-nat.c: rename it to x86-gnu-nat.c since we reuse this for
+  i386 and amd64. Updated REG_ADDR to use one of the structures. Added
+  VALID_REGISTER to make sure it's a register we can provide at this time
+  (not all of them are available in amd64). FLAGS_REGISTER is either rfl
+  or efl depending on the arch. Renamed functions and class from i386 to x86
+  whenever they can be reused.
+
+Tested on Hurd x86_64 and i686.
+---
+ gdb/Makefile.in                               |   4 +-
+ gdb/amd64-gnu-tdep.c                          | 231 ++++++++++++++++++
+ .../i386/{nm-i386gnu.h => nm-x86-gnu.h}       |   7 +
+ gdb/config/i386/{i386gnu.mn => x86-gnu.mn}    |   0
+ gdb/configure.host                            |   1 +
+ gdb/configure.nat                             |  27 +-
+ gdb/configure.tgt                             |   6 +-
+ gdb/i386-gnu-tdep.c                           |  13 +-
+ gdb/{i386-gnu-nat.c => x86-gnu-nat.c}         | 171 +++++++++----
+ 9 files changed, 403 insertions(+), 57 deletions(-)
+ create mode 100644 gdb/amd64-gnu-tdep.c
+ rename gdb/config/i386/{nm-i386gnu.h => nm-x86-gnu.h} (83%)
+ rename gdb/config/i386/{i386gnu.mn => x86-gnu.mn} (100%)
+ rename gdb/{i386-gnu-nat.c => x86-gnu-nat.c} (68%)
+
+diff --git a/gdb/Makefile.in b/gdb/Makefile.in
+index 84bc54b303e..67a15e2cc68 100644
+--- a/gdb/Makefile.in
++++ b/gdb/Makefile.in
+@@ -737,6 +737,7 @@ ALL_64_TARGET_OBS = \
+ 	amd64-darwin-tdep.o \
+ 	amd64-dicos-tdep.o \
+ 	amd64-fbsd-tdep.o \
++	amd64-gnu-tdep.o \
+ 	amd64-linux-tdep.o \
+ 	amd64-netbsd-tdep.o \
+ 	amd64-obsd-tdep.o \
+@@ -1688,6 +1689,7 @@ ALLDEPFILES = \
+ 	amd64-dicos-tdep.c \
+ 	amd64-fbsd-nat.c \
+ 	amd64-fbsd-tdep.c \
++	amd64-gnu-tdep.c \
+ 	amd64-linux-nat.c \
+ 	amd64-linux-tdep.c \
+ 	amd64-nat.c \
+@@ -1743,7 +1745,6 @@ ALLDEPFILES = \
+ 	i386-dicos-tdep.c \
+ 	i386-fbsd-nat.c \
+ 	i386-fbsd-tdep.c \
+-	i386-gnu-nat.c \
+ 	i386-gnu-tdep.c \
+ 	i386-linux-nat.c \
+ 	i386-linux-tdep.c \
+@@ -1872,6 +1873,7 @@ ALLDEPFILES = \
+ 	vax-tdep.c \
+ 	windows-nat.c \
+ 	windows-tdep.c \
++	x86-gnu-nat.c \
+ 	x86-nat.c \
+ 	x86-tdep.c \
+ 	xcoffread.c \
+diff --git a/gdb/amd64-gnu-tdep.c b/gdb/amd64-gnu-tdep.c
+new file mode 100644
+index 00000000000..435095e3359
+--- /dev/null
++++ b/gdb/amd64-gnu-tdep.c
+@@ -0,0 +1,231 @@
++/* Target-dependent code for the GNU Hurd.
++   Copyright (C) 2024 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   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
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include "defs.h"
++#include "extract-store-integer.h"
++#include "gdbcore.h"
++#include "osabi.h"
++#include "solib-svr4.h"
++
++#include "amd64-tdep.h"
++#include "glibc-tdep.h"
++
++/* Recognizing signal handler frames.  */
++
++/* When the GNU/Hurd libc calls a signal handler, the return address points
++   inside the trampoline assembly snippet.
++
++   If the trampoline function name can not be identified, we resort to reading
++   memory from the process in order to identify it.  */
++
++static const gdb_byte gnu_sigtramp_code[] =
++{
++/* rpc_wait_trampoline: */
++  0x48, 0xc7, 0xc0, 0xe7, 0xff, 0xff, 0xff,	/* mov    $-25,%rax */
++  0x0f, 0x05,					/* syscall */
++  0x49, 0x89, 0x04, 0x24,			/* mov    %rax,(%r12) */
++  0x48, 0x89, 0xdc,				/* mov    %rbx,%rsp */
++
++/* trampoline: */
++  0x5f,			                        /* pop    %rdi */
++  0x5e,						/* pop    %rsi */
++  0x5a,						/* pop    %rdx */
++  0x48, 0x83, 0xc4, 0x08,			/* add    $0x8,%rsp */
++  0x41, 0xff, 0xd5,				/* call   *%r13 */
++
++/* RA HERE */
++  0x48, 0x8b, 0x7c, 0x24, 0x10,			/* mov    0x10(%rsp),%rdi */
++  0xc3,						/* ret */
++
++/* firewall: */
++  0xf4,						/* hlt */
++};
++
++#define GNU_SIGTRAMP_LEN (sizeof gnu_sigtramp_code)
++#define GNU_SIGTRAMP_TAIL 7			/* length of tail after RA */
++
++/* If THIS_FRAME is a sigtramp routine, return the address of the
++   start of the routine.  Otherwise, return 0.  */
++
++static CORE_ADDR
++amd64_gnu_sigtramp_start (frame_info_ptr this_frame)
++{
++  CORE_ADDR pc = get_frame_pc (this_frame);
++  gdb_byte buf[GNU_SIGTRAMP_LEN];
++
++  if (!safe_frame_unwind_memory (this_frame,
++				 pc + GNU_SIGTRAMP_TAIL - GNU_SIGTRAMP_LEN,
++				 buf))
++    return 0;
++
++  if (memcmp (buf, gnu_sigtramp_code, GNU_SIGTRAMP_LEN) != 0)
++    return 0;
++
++  return pc;
++}
++
++/* Return whether THIS_FRAME corresponds to a Hurd sigtramp routine.  */
++
++static int
++amd64_gnu_sigtramp_p (const frame_info_ptr &this_frame)
++{
++  CORE_ADDR pc = get_frame_pc (this_frame);
++  const char *name;
++
++  find_pc_partial_function (pc, &name, NULL, NULL);
++
++  /* If we have a NAME, we can check for the trampoline function */
++  if (name != NULL && strcmp (name, "trampoline") == 0)
++    return 1;
++
++  return amd64_gnu_sigtramp_start (this_frame) != 0;
++}
++
++/* Offset to sc_i386_thread_state in sigcontext, from <bits/sigcontext.h>.  */
++#define AMD64_GNU_SIGCONTEXT_THREAD_STATE_OFFSET 32
++
++/* Assuming THIS_FRAME is a Hurd sigtramp routine, return the
++   address of the associated sigcontext structure.  */
++
++static CORE_ADDR
++amd64_gnu_sigcontext_addr (const frame_info_ptr &this_frame)
++{
++  struct gdbarch *gdbarch = get_frame_arch (this_frame);
++  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
++  CORE_ADDR pc;
++  CORE_ADDR sp;
++  gdb_byte buf[8];
++
++  get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
++  sp = extract_unsigned_integer (buf, 8, byte_order);
++
++  pc = amd64_gnu_sigtramp_start (this_frame);
++  if (pc)
++    {
++      CORE_ADDR sigcontext_addr;
++
++      /* The sigcontext structure address is passed as the third argument
++       * of the signal handler but %RDX is not saved across calls. Luckily,
++       * the structured is saved underneath the &__sigreturn and a dummy word
++       * to fill the slot for the address for __sigreturn to return to.
++       */
++      read_memory (sp + 16, buf, 8);
++      sigcontext_addr = extract_unsigned_integer (buf, 8, byte_order);
++      return sigcontext_addr + AMD64_GNU_SIGCONTEXT_THREAD_STATE_OFFSET;
++    }
++
++  error (_("Couldn't recognize signal trampoline."));
++  return 0;
++}
++
++/* Mapping between the general-purpose registers in `struct
++   sigcontext' format (starting at sc_i386_thread_state)
++   and GDB's register cache layout.  */
++
++/* From <bits/sigcontext.h>.  */
++static int amd64_gnu_sc_reg_offset[] =
++{
++  15 * 8,			/* %rax */
++  12 * 8,			/* %rbx */
++  14 * 8,			/* %rcx */
++  13 * 8,			/* %rdx */
++  10 * 8,			/* %rsi */
++  9 * 8,			/* %rdi */
++  10 * 8,			/* %rbp */
++  11 * 8,			/* %rsp */
++  0 * 8,			/* %r8 ...  */
++  8 * 8,
++  7 * 8,
++  6 * 8,
++  3 * 8,
++  2 * 8,
++  1 * 8,
++  0 * 8,			/* ... %r15 */
++  16 * 8,			/* %rip */
++  18 * 8,			/* %eflags */
++  17 * 8,			/* %cs */
++};
++
++/* From <sys/ucontext.h>.  */
++static int amd64_gnu_gregset_reg_offset[] =
++{
++  10 * 8,			/* %rax */
++  5 * 8,			/* %rbx */
++  11 * 8,			/* %rcx */
++  12 * 8,			/* %rdx */
++  13 * 8,			/* %rsi */
++  14 * 8,			/* %rdi */
++  4 * 8,			/* %rbp */
++  19 * 8,			/* %rsp */
++  9 * 8,			/* %r8 ...  */
++  8 * 8,
++  7 * 8,
++  6 * 8,
++  3 * 8,
++  2 * 8,
++  1 * 8,
++  0 * 8,			/* ... %r15 */
++  16 * 8,			/* %rip */
++  18 * 8,			/* %eflags */
++  17 * 8,			/* %cs */
++  -1,				  /* %ss */
++  -1,				  /* %ds */
++  -1,				  /* %es */
++  -1,				  /* %fs */
++  -1,				  /* %gs */
++};
++
++static void
++amd64_gnu_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
++{
++  i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
++
++  amd64_init_abi (info, gdbarch,
++      amd64_target_description (X86_XSTATE_SSE_MASK, true));
++
++  /* Enable TLS support.  */
++  set_gdbarch_fetch_tls_load_module_address (gdbarch,
++      svr4_fetch_objfile_link_map);
++
++  /* Hurd uses SVR4-style shared libraries.  */
++  set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
++
++  /* Hurd uses the dynamic linker included in the GNU C Library.  */
++  set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
++
++  tdep->gregset_reg_offset = amd64_gnu_gregset_reg_offset;
++  tdep->gregset_num_regs = ARRAY_SIZE (amd64_gnu_gregset_reg_offset);
++  tdep->sizeof_gregset = 21 * 8; /* sizeof (struct i386_thread_state); */
++
++  tdep->sigtramp_p = amd64_gnu_sigtramp_p;
++  tdep->sigcontext_addr = amd64_gnu_sigcontext_addr;
++  tdep->sc_reg_offset = amd64_gnu_sc_reg_offset;
++  tdep->sc_num_regs = ARRAY_SIZE (amd64_gnu_sc_reg_offset);
++
++  /* Hurd uses SVR4-style shared libraries.  */
++  set_solib_svr4_fetch_link_map_offsets
++    (gdbarch, svr4_lp64_fetch_link_map_offsets);
++}
++
++void _initialize_amd64_gnu_tdep ();
++void
++_initialize_amd64_gnu_tdep ()
++{
++  gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
++			  GDB_OSABI_HURD, amd64_gnu_init_abi);
++}
+diff --git a/gdb/config/i386/nm-i386gnu.h b/gdb/config/i386/nm-x86-gnu.h
+similarity index 83%
+rename from gdb/config/i386/nm-i386gnu.h
+rename to gdb/config/i386/nm-x86-gnu.h
+index d2d5de83948..ed4d1729227 100644
+--- a/gdb/config/i386/nm-i386gnu.h
++++ b/gdb/config/i386/nm-x86-gnu.h
+@@ -22,9 +22,16 @@
+ /* Thread flavors used in re-setting the T bit.  */
+ #define THREAD_STATE_FLAVOR		i386_REGS_SEGS_STATE
+ #define THREAD_STATE_SIZE		i386_THREAD_STATE_COUNT
++#ifdef __x86_64__
++#define THREAD_STATE_SET_TRACED(state) \
++	((struct i386_thread_state *) (state))->rfl |= 0x100
++#define THREAD_STATE_CLEAR_TRACED(state) \
++	((((struct i386_thread_state *) (state))->rfl &= ~0x100), 1)
++#else
+ #define THREAD_STATE_SET_TRACED(state) \
+   	((struct i386_thread_state *) (state))->efl |= 0x100
+ #define THREAD_STATE_CLEAR_TRACED(state) \
+   	((((struct i386_thread_state *) (state))->efl &= ~0x100), 1)
++#endif /* __x86_64__ */
+ 
+ #endif /* CONFIG_I386_NM_I386GNU_H */
+diff --git a/gdb/config/i386/i386gnu.mn b/gdb/config/i386/x86-gnu.mn
+similarity index 100%
+rename from gdb/config/i386/i386gnu.mn
+rename to gdb/config/i386/x86-gnu.mn
+diff --git a/gdb/configure.host b/gdb/configure.host
+index da71675b201..999af8e59ae 100644
+--- a/gdb/configure.host
++++ b/gdb/configure.host
+@@ -184,6 +184,7 @@ x86_64-*-mingw*)        gdb_host=mingw64
+ 			gdb_host_obs=mingw-hdep.o
+ 			;;
+ x86_64-*-cygwin*)	gdb_host=cygwin64 ;;
++x86_64-*-gnu*)		gdb_host=gnu64 ;;
+ m32r*-*-linux*)          gdb_host=linux ;;
+ 
+ xtensa*-*-linux*)	gdb_host=linux ;;
+diff --git a/gdb/configure.nat b/gdb/configure.nat
+index 8b98511cef7..00402f888a9 100644
+--- a/gdb/configure.nat
++++ b/gdb/configure.nat
+@@ -211,23 +211,44 @@ case ${gdb_host} in
+ 		;;
+ 	esac
+ 	;;
++    gnu64)
++	case ${gdb_host_cpu} in
++	    i386)
++		# Host: x86_64 running the GNU Hurd
++		NATDEPFILES='x86-gnu-nat.o gnu-nat.o \
++		     x86-nat.o nat/x86-dregs.o \
++		     amd64-nat.o fork-child.o \
++		     nat/fork-inferior.o \
++		     notify_S.o process_reply_S.o msg_reply_S.o \
++		     msg_U.o exc_request_U.o exc_request_S.o'
++		HAVE_NATIVE_GCORE_HOST=1
++
++		NAT_FILE='nm-x86-gnu.h'
++		MH_CFLAGS='-D_GNU_SOURCE'
++
++		XM_CLIBS='-lshouldbeinlibc'
++
++		nat_makefile_frag="${srcdir}/config/${gdb_host_cpu}/x86-gnu.mn"
++		;;
++	esac
++	;;
+     i386gnu)
+ 	case ${gdb_host_cpu} in
+ 	    i386)
+ 		# Host: Intel 386 running the GNU Hurd
+-		NATDEPFILES='i386-gnu-nat.o gnu-nat.o \
++		NATDEPFILES='x86-gnu-nat.o gnu-nat.o \
+ 		     x86-nat.o nat/x86-dregs.o fork-child.o \
+ 		     nat/fork-inferior.o \
+ 		     notify_S.o process_reply_S.o msg_reply_S.o \
+ 		     msg_U.o exc_request_U.o exc_request_S.o'
+ 		HAVE_NATIVE_GCORE_HOST=1
+ 
+-		NAT_FILE='nm-i386gnu.h'
++		NAT_FILE='nm-x86-gnu.h'
+ 		MH_CFLAGS='-D_GNU_SOURCE'
+ 
+ 		XM_CLIBS='-lshouldbeinlibc'
+ 
+-		nat_makefile_frag="${srcdir}/config/${gdb_host_cpu}/i386gnu.mn"
++		nat_makefile_frag="${srcdir}/config/${gdb_host_cpu}/x86-gnu.mn"
+ 		;;
+ 	esac
+ 	;;
+diff --git a/gdb/configure.tgt b/gdb/configure.tgt
+index 47a674201f9..df9e9917ad1 100644
+--- a/gdb/configure.tgt
++++ b/gdb/configure.tgt
+@@ -328,7 +328,7 @@ i[34567]86-*-linux*)
+ 	;;
+ i[34567]86-*-gnu*)
+ 	# Target: Intel 386 running the GNU Hurd
+-	gdb_target_obs="i386-gnu-tdep.o solib-svr4.o"
++	gdb_target_obs="i386-gnu-tdep.o glibc-tdep.o solib-svr4.o"
+ 	;;
+ i[34567]86-*-cygwin*)
+ 	# Target: Intel 386 running win32
+@@ -744,6 +744,10 @@ x86_64-*-openbsd*)
+ x86_64-*-rtems*)
+ 	gdb_target_obs="${amd64_tobjs} ${i386_tobjs} i386-bsd-tdep.o"
+ 	;;
++x86_64-*-gnu*)
++	# Target: x86_64 running the GNU Hurd
++	gdb_target_obs="amd64-gnu-tdep.o glibc-tdep.o solib-svr4.o"
++	;;
+ xtensa*-*-*linux*)
+ 	# Target: GNU/Linux Xtensa
+ 	gdb_target_obs="xtensa-linux-tdep.o symfile-mem.o linux-tdep.o"
+diff --git a/gdb/i386-gnu-tdep.c b/gdb/i386-gnu-tdep.c
+index 98e11518a91..5ffc1388ec0 100644
+--- a/gdb/i386-gnu-tdep.c
++++ b/gdb/i386-gnu-tdep.c
+@@ -21,6 +21,7 @@
+ #include "osabi.h"
+ #include "solib-svr4.h"
+ 
++#include "glibc-tdep.h"
+ #include "i386-tdep.h"
+ 
+ /* Recognizing signal handler frames.  */
+@@ -72,8 +73,7 @@ i386_gnu_sigtramp_start (const frame_info_ptr &this_frame)
+   return pc;
+ }
+ 
+-/* Return whether THIS_FRAME corresponds to a GNU/Linux sigtramp
+-   routine.  */
++/* Return whether THIS_FRAME corresponds to a Hurd sigtramp routine.  */
+ 
+ static int
+ i386_gnu_sigtramp_p (const frame_info_ptr &this_frame)
+@@ -178,9 +178,18 @@ i386gnu_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+   /* GNU uses ELF.  */
+   i386_elf_init_abi (info, gdbarch);
+ 
++  /* Hurd uses SVR4-style shared libraries.  */
++  set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
+   set_solib_svr4_fetch_link_map_offsets
+     (gdbarch, svr4_ilp32_fetch_link_map_offsets);
+ 
++  /* Hurd uses the dynamic linker included in the GNU C Library.  */
++  set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
++
++  /* Enable TLS support.  */
++  set_gdbarch_fetch_tls_load_module_address (gdbarch,
++					     svr4_fetch_objfile_link_map);
++
+   tdep->gregset_reg_offset = i386gnu_gregset_reg_offset;
+   tdep->gregset_num_regs = ARRAY_SIZE (i386gnu_gregset_reg_offset);
+   tdep->sizeof_gregset = 19 * 4;
+diff --git a/gdb/i386-gnu-nat.c b/gdb/x86-gnu-nat.c
+similarity index 68%
+rename from gdb/i386-gnu-nat.c
+rename to gdb/x86-gnu-nat.c
+index 52d4a4b7cec..da3b7e923dd 100644
+--- a/gdb/i386-gnu-nat.c
++++ b/gdb/x86-gnu-nat.c
+@@ -34,7 +34,13 @@ extern "C"
+ #include "floatformat.h"
+ #include "regcache.h"
+ 
++
++#ifdef __x86_64__
++#include "amd64-tdep.h"
++#include "amd64-nat.h"
++#else
+ #include "i386-tdep.h"
++#endif
+ 
+ #include "inf-child.h"
+ #include "i387-tdep.h"
+@@ -42,21 +48,82 @@ extern "C"
+ /* Offset to the thread_state_t location where REG is stored.  */
+ #define REG_OFFSET(reg) offsetof (struct i386_thread_state, reg)
+ 
++#ifdef __x86_64__
++
+ /* At REG_OFFSET[N] is the offset to the thread_state_t location where
+    the GDB register N is stored.  */
+-static int reg_offset[] =
++static int amd64_gnu_thread_state_reg_offset[] =
+ {
+-  REG_OFFSET (eax), REG_OFFSET (ecx), REG_OFFSET (edx), REG_OFFSET (ebx),
+-  REG_OFFSET (uesp), REG_OFFSET (ebp), REG_OFFSET (esi), REG_OFFSET (edi),
+-  REG_OFFSET (eip), REG_OFFSET (efl), REG_OFFSET (cs), REG_OFFSET (ss),
+-  REG_OFFSET (ds), REG_OFFSET (es), REG_OFFSET (fs), REG_OFFSET (gs)
++  REG_OFFSET (rax),		/* %rax */
++  REG_OFFSET (rbx),		/* %rbx */
++  REG_OFFSET (rcx),		/* %rcx */
++  REG_OFFSET (rdx),		/* %rdx */
++  REG_OFFSET (rsi),		/* %rsi */
++  REG_OFFSET (rdi),		/* %rdi */
++  REG_OFFSET (rbp),		/* %rbp */
++  REG_OFFSET (ursp),	/* %rsp */
++  REG_OFFSET (r8),		/* %r8 ...  */
++  REG_OFFSET (r9),
++  REG_OFFSET (r10),
++  REG_OFFSET (r11),
++  REG_OFFSET (r12),
++  REG_OFFSET (r13),
++  REG_OFFSET (r14),
++  REG_OFFSET (r15),		/* ... %r15 */
++  REG_OFFSET (rip),		/* %rip */
++  REG_OFFSET (rfl),		/* %rflags */
++  REG_OFFSET (cs)	    /* %cs */
+ };
+ 
+-#define REG_ADDR(state, regnum) ((char *)(state) + reg_offset[regnum])
++static const int amd64_gnu_thread_state_num_regs =
++  ARRAY_SIZE (amd64_gnu_thread_state_reg_offset);
++
++#define REG_ADDR(state, regnum) \
++  ((char *)(state) + amd64_gnu_thread_state_reg_offset[regnum])
++#define VALID_REGISTER(regnum) \
++  ((regnum) >= 0 && (regnum) < amd64_gnu_thread_state_num_regs)
++#define NUM_GREGS amd64_gnu_thread_state_num_regs
++#define FLAGS_REGISTER rfl
++
++#else
++
++/* At REG_OFFSET[N] is the offset to the thread_state_t location where
++   the GDB register N is stored.  */
++static int i386_gnu_thread_state_reg_offset[] =
++{
++  REG_OFFSET (eax),	/* %eax */
++  REG_OFFSET (ecx),	/* %ecx */
++  REG_OFFSET (edx),	/* %edx */
++  REG_OFFSET (ebx),	/* %ebx */
++  REG_OFFSET (uesp),	/* %esp */
++  REG_OFFSET (ebp),	/* %ebp */
++  REG_OFFSET (esi),	/* %esi */
++  REG_OFFSET (edi),	/* %edi */
++  REG_OFFSET (eip),	/* %eip */
++  REG_OFFSET (efl),	/* %efl */
++  REG_OFFSET (cs),	/* %cs */
++  REG_OFFSET (ss),	/* %ss */
++  REG_OFFSET (ds),	/* %ds */
++  REG_OFFSET (es),	/* %es */
++  REG_OFFSET (fs),	/* %fs */
++  REG_OFFSET (gs)	/* gs */
++};
++
++static const int i386_gnu_thread_state_num_regs =
++  ARRAY_SIZE (i386_gnu_thread_state_reg_offset);
++
++#define REG_ADDR(state, regnum) \
++  ((char *)(state) + i386_gnu_thread_state_reg_offset[regnum])
++#define VALID_REGISTER(regnum) \
++  ((regnum) >= 0 && (regnum) < i386_gnu_thread_state_num_regs)
++#define NUM_GREGS i386_gnu_thread_state_num_regs
++#define FLAGS_REGISTER efl
++
++#endif  /* __x86_64__ */
+ 
+ \f
+ 
+-/* The i386 GNU Hurd target.  */
++/* The x86 GNU Hurd target.  */
+ 
+ #ifdef i386_DEBUG_STATE
+ using gnu_base_target = x86_nat_target<gnu_nat_target>;
+@@ -64,13 +131,13 @@ using gnu_base_target = x86_nat_target<gnu_nat_target>;
+ using gnu_base_target = gnu_nat_target;
+ #endif
+ 
+-struct i386_gnu_nat_target final : public gnu_base_target
++struct x86_gnu_nat_target final : public gnu_base_target
+ {
+   void fetch_registers (struct regcache *, int) override;
+   void store_registers (struct regcache *, int) override;
+ };
+ 
+-static i386_gnu_nat_target the_i386_gnu_nat_target;
++static x86_gnu_nat_target the_x86_gnu_nat_target;
+ 
+ /* Get the whole floating-point state of THREAD and record the values
+    of the corresponding (pseudo) registers.  */
+@@ -105,7 +172,7 @@ fetch_fpregs (struct regcache *regcache, struct proc *thread)
+ 
+ /* Fetch register REGNO, or all regs if REGNO is -1.  */
+ void
+-i386_gnu_nat_target::fetch_registers (struct regcache *regcache, int regno)
++x86_gnu_nat_target::fetch_registers (struct regcache *regcache, int regno)
+ {
+   struct proc *thread;
+   ptid_t ptid = regcache->ptid ();
+@@ -118,7 +185,7 @@ i386_gnu_nat_target::fetch_registers (struct regcache *regcache, int regno)
+     error (_("Can't fetch registers from thread %s: No such thread"),
+ 	   target_pid_to_str (ptid).c_str ());
+ 
+-  if (regno < I386_NUM_GREGS || regno == -1)
++  if (VALID_REGISTER (regno) || regno == -1)
+     {
+       thread_state_t state;
+ 
+@@ -137,7 +204,7 @@ i386_gnu_nat_target::fetch_registers (struct regcache *regcache, int regno)
+ 
+ 	  proc_debug (thread, "fetching all register");
+ 
+-	  for (i = 0; i < I386_NUM_GREGS; i++)
++	  for (i = 0; i < NUM_GREGS; i++)
+ 	    regcache->raw_supply (i, REG_ADDR (state, i));
+ 	  thread->fetched_regs = ~0;
+ 	}
+@@ -152,7 +219,7 @@ i386_gnu_nat_target::fetch_registers (struct regcache *regcache, int regno)
+ 	}
+     }
+ 
+-  if (regno >= I386_NUM_GREGS || regno == -1)
++  if (!VALID_REGISTER(regno) || regno == -1)
+     {
+       proc_debug (thread, "fetching floating-point registers");
+ 
+@@ -195,7 +262,7 @@ store_fpregs (const struct regcache *regcache, struct proc *thread, int regno)
+ 
+ /* Store at least register REGNO, or all regs if REGNO == -1.  */
+ void
+-i386_gnu_nat_target::store_registers (struct regcache *regcache, int regno)
++x86_gnu_nat_target::store_registers (struct regcache *regcache, int regno)
+ {
+   struct proc *thread;
+   struct gdbarch *gdbarch = regcache->arch ();
+@@ -209,7 +276,7 @@ i386_gnu_nat_target::store_registers (struct regcache *regcache, int regno)
+     error (_("Couldn't store registers into thread %s: No such thread"),
+ 	   target_pid_to_str (ptid).c_str ());
+ 
+-  if (regno < I386_NUM_GREGS || regno == -1)
++  if (VALID_REGISTER (regno) || regno == -1)
+     {
+       thread_state_t state;
+       thread_state_data_t old_state;
+@@ -230,14 +297,14 @@ i386_gnu_nat_target::store_registers (struct regcache *regcache, int regno)
+ 
+       /* Save the T bit.  We might try to restore the %eflags register
+ 	 below, but changing the T bit would seriously confuse GDB.  */
+-      trace = ((struct i386_thread_state *)state)->efl & 0x100;
++      trace = ((struct i386_thread_state *)state)->FLAGS_REGISTER & 0x100;
+ 
+       if (!was_aborted && was_valid)
+ 	/* See which registers have changed after aborting the thread.  */
+ 	{
+ 	  int check_regno;
+ 
+-	  for (check_regno = 0; check_regno < I386_NUM_GREGS; check_regno++)
++	  for (check_regno = 0; check_regno < NUM_GREGS; check_regno++)
+ 	    if ((thread->fetched_regs & (1 << check_regno))
+ 		&& memcpy (REG_ADDR (&old_state, check_regno),
+ 			   REG_ADDR (state, check_regno),
+@@ -262,7 +329,7 @@ i386_gnu_nat_target::store_registers (struct regcache *regcache, int regno)
+ 
+ 	  proc_debug (thread, "storing all registers");
+ 
+-	  for (i = 0; i < I386_NUM_GREGS; i++)
++	  for (i = 0; i < NUM_GREGS; i++)
+ 	    if (REG_VALID == regcache->get_register_status (i))
+ 	      regcache->raw_collect (i, REG_ADDR (state, i));
+ 	}
+@@ -276,11 +343,11 @@ i386_gnu_nat_target::store_registers (struct regcache *regcache, int regno)
+ 	}
+ 
+       /* Restore the T bit.  */
+-      ((struct i386_thread_state *)state)->efl &= ~0x100;
+-      ((struct i386_thread_state *)state)->efl |= trace;
++      ((struct i386_thread_state *)state)->FLAGS_REGISTER &= ~0x100;
++      ((struct i386_thread_state *)state)->FLAGS_REGISTER |= trace;
+     }
+ 
+-  if (regno >= I386_NUM_GREGS || regno == -1)
++  if (!VALID_REGISTER (regno) || regno == -1)
+     {
+       proc_debug (thread, "storing floating-point registers");
+ 
+@@ -295,7 +362,7 @@ i386_gnu_nat_target::store_registers (struct regcache *regcache, int regno)
+ /* Get debug registers for thread THREAD.  */
+ 
+ static void
+-i386_gnu_dr_get (struct i386_debug_state *regs, struct proc *thread)
++x86_gnu_dr_get (struct i386_debug_state *regs, struct proc *thread)
+ {
+   mach_msg_type_number_t count = i386_DEBUG_STATE_COUNT;
+   kern_return_t err;
+@@ -310,7 +377,7 @@ i386_gnu_dr_get (struct i386_debug_state *regs, struct proc *thread)
+ /* Set debug registers for thread THREAD.  */
+ 
+ static void
+-i386_gnu_dr_set (const struct i386_debug_state *regs, struct proc *thread)
++x86_gnu_dr_set (const struct i386_debug_state *regs, struct proc *thread)
+ {
+   kern_return_t err;
+ 
+@@ -324,23 +391,23 @@ i386_gnu_dr_set (const struct i386_debug_state *regs, struct proc *thread)
+ /* Set DR_CONTROL in THREAD.  */
+ 
+ static void
+-i386_gnu_dr_set_control_one (struct proc *thread, void *arg)
++x86_gnu_dr_set_control_one (struct proc *thread, void *arg)
+ {
+   unsigned long *control = (unsigned long *) arg;
+   struct i386_debug_state regs;
+ 
+-  i386_gnu_dr_get (&regs, thread);
++  x86_gnu_dr_get (&regs, thread);
+   regs.dr[DR_CONTROL] = *control;
+-  i386_gnu_dr_set (&regs, thread);
++  x86_gnu_dr_set (&regs, thread);
+ }
+ 
+ /* Set DR_CONTROL to CONTROL in all threads.  */
+ 
+ static void
+-i386_gnu_dr_set_control (unsigned long control)
++x86_gnu_dr_set_control (unsigned long control)
+ {
+   inf_update_procs (gnu_current_inf);
+-  inf_threads (gnu_current_inf, i386_gnu_dr_set_control_one, &control);
++  inf_threads (gnu_current_inf, x86_gnu_dr_set_control_one, &control);
+ }
+ 
+ /* Parameters to set a debugging address.  */
+@@ -354,20 +421,20 @@ struct reg_addr
+ /* Set address REGNUM (zero based) to ADDR in THREAD.  */
+ 
+ static void
+-i386_gnu_dr_set_addr_one (struct proc *thread, void *arg)
++x86_gnu_dr_set_addr_one (struct proc *thread, void *arg)
+ {
+   struct reg_addr *reg_addr = (struct reg_addr *) arg;
+   struct i386_debug_state regs;
+ 
+-  i386_gnu_dr_get (&regs, thread);
++  x86_gnu_dr_get (&regs, thread);
+   regs.dr[reg_addr->regnum] = reg_addr->addr;
+-  i386_gnu_dr_set (&regs, thread);
++  x86_gnu_dr_set (&regs, thread);
+ }
+ 
+ /* Set address REGNUM (zero based) to ADDR in all threads.  */
+ 
+ static void
+-i386_gnu_dr_set_addr (int regnum, CORE_ADDR addr)
++x86_gnu_dr_set_addr (int regnum, CORE_ADDR addr)
+ {
+   struct reg_addr reg_addr;
+ 
+@@ -377,13 +444,13 @@ i386_gnu_dr_set_addr (int regnum, CORE_ADDR addr)
+   reg_addr.addr = addr;
+ 
+   inf_update_procs (gnu_current_inf);
+-  inf_threads (gnu_current_inf, i386_gnu_dr_set_addr_one, &reg_addr);
++  inf_threads (gnu_current_inf, x86_gnu_dr_set_addr_one, &reg_addr);
+ }
+ 
+ /* Get debug register REGNUM value from only the one LWP of PTID.  */
+ 
+ static unsigned long
+-i386_gnu_dr_get_reg (ptid_t ptid, int regnum)
++x86_gnu_dr_get_reg (ptid_t ptid, int regnum)
+ {
+   struct i386_debug_state regs;
+   struct proc *thread;
+@@ -392,7 +459,7 @@ i386_gnu_dr_get_reg (ptid_t ptid, int regnum)
+   inf_update_procs (gnu_current_inf);
+ 
+   thread = inf_tid_to_thread (gnu_current_inf, ptid.lwp ());
+-  i386_gnu_dr_get (&regs, thread);
++  x86_gnu_dr_get (&regs, thread);
+ 
+   return regs.dr[regnum];
+ }
+@@ -400,46 +467,50 @@ i386_gnu_dr_get_reg (ptid_t ptid, int regnum)
+ /* Return the inferior's debug register REGNUM.  */
+ 
+ static CORE_ADDR
+-i386_gnu_dr_get_addr (int regnum)
++x86_gnu_dr_get_addr (int regnum)
+ {
+   gdb_assert (DR_FIRSTADDR <= regnum && regnum <= DR_LASTADDR);
+ 
+-  return i386_gnu_dr_get_reg (inferior_ptid, regnum);
++  return x86_gnu_dr_get_reg (inferior_ptid, regnum);
+ }
+ 
+ /* Get DR_STATUS from only the one thread of INFERIOR_PTID.  */
+ 
+ static unsigned long
+-i386_gnu_dr_get_status (void)
++x86_gnu_dr_get_status (void)
+ {
+-  return i386_gnu_dr_get_reg (inferior_ptid, DR_STATUS);
++  return x86_gnu_dr_get_reg (inferior_ptid, DR_STATUS);
+ }
+ 
+ /* Return the inferior's DR7 debug control register.  */
+ 
+ static unsigned long
+-i386_gnu_dr_get_control (void)
++x86_gnu_dr_get_control (void)
+ {
+-  return i386_gnu_dr_get_reg (inferior_ptid, DR_CONTROL);
++  return x86_gnu_dr_get_reg (inferior_ptid, DR_CONTROL);
+ }
+ #endif /* i386_DEBUG_STATE */
+ 
+-void _initialize_i386gnu_nat ();
++void _initialize_x86_gnu_nat ();
+ void
+-_initialize_i386gnu_nat ()
++_initialize_x86_gnu_nat ()
+ {
+ #ifdef i386_DEBUG_STATE
+-  x86_dr_low.set_control = i386_gnu_dr_set_control;
++  x86_dr_low.set_control = x86_gnu_dr_set_control;
+   gdb_assert (DR_FIRSTADDR == 0 && DR_LASTADDR < i386_DEBUG_STATE_COUNT);
+-  x86_dr_low.set_addr = i386_gnu_dr_set_addr;
+-  x86_dr_low.get_addr = i386_gnu_dr_get_addr;
+-  x86_dr_low.get_status = i386_gnu_dr_get_status;
+-  x86_dr_low.get_control = i386_gnu_dr_get_control;
++  x86_dr_low.set_addr = x86_gnu_dr_set_addr;
++  x86_dr_low.get_addr = x86_gnu_dr_get_addr;
++  x86_dr_low.get_status = x86_gnu_dr_get_status;
++  x86_dr_low.get_control = x86_gnu_dr_get_control;
++#ifdef __x86_64__
++  x86_set_debug_register_length (8);
++#else
+   x86_set_debug_register_length (4);
++#endif
+ #endif /* i386_DEBUG_STATE */
+ 
+-  gnu_target = &the_i386_gnu_nat_target;
++  gnu_target = &the_x86_gnu_nat_target;
+ 
+   /* Register the target.  */
+-  add_inf_child_target (&the_i386_gnu_nat_target);
++  add_inf_child_target (&the_x86_gnu_nat_target);
+ }
+-- 
+2.46.0
+
+From 7cfe6f639e601d6cca567342360ecbd3cdca128c Mon Sep 17 00:00:00 2001
+From: Flavio Cruz <flaviocruz@gmail.com>
+Date: Wed, 3 Jul 2024 23:05:06 +0100
+Subject: [PATCH 2/2] Hurd: do not include defs.h when compiling MiG stubs
+ since they are compiled as C files
+
+Otherwise, GDB will fail to compile for Hurd.
+---
+ gdb/Makefile.in            | 3 ++-
+ gdb/config/i386/x86-gnu.mn | 4 +++-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/Makefile.in b/gdb/Makefile.in
+index 67a15e2cc68..d847a8bad72 100644
+--- a/gdb/Makefile.in
++++ b/gdb/Makefile.in
+@@ -603,11 +603,12 @@ CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
+ # your system doesn't have fcntl.h in /usr/include (which is where it
+ # should be according to Posix).
+ DEFS = @DEFS@
++GDB_INCLUDED_HEADER = -include $(srcdir)/defs.h
+ GDB_CFLAGS = \
+ 	-I. \
+ 	-I$(srcdir) \
+ 	-I$(srcdir)/config \
+-	-include $(srcdir)/defs.h \
++	$(GDB_INCLUDED_HEADER) \
+ 	-DLOCALEDIR="\"$(localedir)\"" \
+ 	$(DEFS)
+ 
+diff --git a/gdb/config/i386/x86-gnu.mn b/gdb/config/i386/x86-gnu.mn
+index b7414e3bcb4..24c58b02e98 100644
+--- a/gdb/config/i386/x86-gnu.mn
++++ b/gdb/config/i386/x86-gnu.mn
+@@ -21,7 +21,9 @@ MIGCOM = $(MIG) -cc cat - /dev/null
+ 	| $(MIGCOM) -sheader /dev/null -server /dev/null -user $*_U.c -header $*_U.h
+ 
+ # MIG stubs are not yet ready for C++ compilation.
+-%_S.o %_U.o : COMPILE.post += -x c -include gnu-nat-mig.h
++%_S.o %_U.o : COMPILE.post += -x c
++# Do not include defs.h since it requires C++. Rather include our own gnu-nat-mig.h
++%_S.o %_U.o : GDB_INCLUDED_HEADER = -include gnu-nat-mig.h
+ 
+ NAT_GENERATED_FILES = notify_S.h notify_S.c \
+ 	process_reply_S.h process_reply_S.c \
+-- 
+2.46.0
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 47/51] gnu: bootstrap: %bootstrap-glibc: Also fix libm.so.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (45 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 46/51] gnu: Add gdb-15.2, with support for the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 48/51] gnu: findutils: Disable tests on the 64bit Hurd Janneke Nieuwenhuizen
                     ` (3 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

On the 64bit Hurd, glibc-2.39's libm.so is also a linker script.  This fixes
having it refer to

    /gnu/store/eee...-glibc-cross-x86_64-pc-gnu-2.39/lib/libm.so.6
    /gnu/store/eee...-glibc-cross-x86_64-pc-gnu-2.39/lib/libmvec.so.1

* gnu/packages/bootstrap.scm (%bootstrap-glibc)[arguments]: When building for
the 64bit Hurd, also substitute libm.so linker script.  Update the regexp to
also cater for libh[urduser] and libm[achuser].

Change-Id: I399d8f3ad9be6b8892955c2cbe59a10093120c77
---
 gnu/packages/bootstrap.scm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 301ee3ca12..f8490ce56c 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -774,12 +774,12 @@ (define %bootstrap-glibc
                                      "/binaries.tar"))
               (chmod "lib" #o755)
 
-              ;; Patch libc.so so it refers to the right path.
-              (substitute* "lib/libc.so"
-                (("/[^ ]+/lib/(libc|ld)" _ prefix)
-                 (string-append out "/lib/" prefix)))
-
-              #t))))))
+              ;; Patch linker scripts so they refer to the right file-names.
+              (substitute* ,(if (target-hurd64?)
+                                ''("lib/libc.so" "lib/libm.so")
+                                "libc.so")
+                (("/[^ ]+/lib/(libc|libm|libh|ld)" _ prefix)
+                 (string-append out "/lib/" prefix)))))))))
     (inputs
      `(("tar" ,(bootstrap-executable "tar" (%current-system)))
        ("xz"  ,(bootstrap-executable "xz" (%current-system)))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 48/51] gnu: findutils: Disable tests on the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (46 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 47/51] gnu: bootstrap: %bootstrap-glibc: Also fix libm.so Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 49/51] system: examples: Add bare-hurd64.tmpl Janneke Nieuwenhuizen
                     ` (2 subsequent siblings)
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/base.scm (findutils)[arguments]: When building on the 64bit
Hurd, set #:tests? #f.

Change-Id: I63b84cc1a45de7e9ce1aa2c3e812ffc845e1db19
---
 gnu/packages/base.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index bab1f258c6..692721acc6 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -425,7 +425,9 @@ (define-public findutils
             (patches (search-patches "findutils-localstatedir.patch"))))
    (build-system gnu-build-system)
    (arguments
-    `(#:configure-flags (list
+    `(#:tests? ,(and (not (%current-target-system))
+                     (not (system-hurd64?)))
+      #:configure-flags (list
                          ;; Tell 'updatedb' to write to /var.
                          "--localstatedir=/var")
       #:phases (modify-phases %standard-phases
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 49/51] system: examples: Add bare-hurd64.tmpl.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (47 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 48/51] gnu: findutils: Disable tests on the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 50/51] system: examples: Add devel-hurd64.tmpl Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 51/51] gnu: Use gcc-14, gcc-toolchain-14 on the 64bit Hurd Janneke Nieuwenhuizen
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290

* gnu/system/examples/bare-hurd.tmpl: Update comments.
* gnu/system/examples/bare-hurd64.tmpl: New file.

Change-Id: I8d26afd19afaa8fb3558948b50b0efdc0f83f29c
---
 gnu/system/examples/bare-hurd.tmpl   | 21 +++++----
 gnu/system/examples/bare-hurd64.tmpl | 70 ++++++++++++++++++++++++++++
 2 files changed, 82 insertions(+), 9 deletions(-)
 create mode 100644 gnu/system/examples/bare-hurd64.tmpl

diff --git a/gnu/system/examples/bare-hurd.tmpl b/gnu/system/examples/bare-hurd.tmpl
index 68c6d3c166..9bfa776769 100644
--- a/gnu/system/examples/bare-hurd.tmpl
+++ b/gnu/system/examples/bare-hurd.tmpl
@@ -3,23 +3,26 @@
 ;; This is an operating system configuration template
 ;; for a "bare bones" QEMU setup, with no X11 display server.
 
-;; To build a disk image for a virtual machine, do
+;; To build a disk image for a virtual machine, do:
 ;;
-;;     ./pre-inst-env guix system image --image-type=hurd-raw \
+;;     ./pre-inst-env guix system image --image-type=hurd-qcow2 \
 ;;         gnu/system/examples/bare-hurd.tmpl
 ;;
-;; You may run it like so
+;; You may run it like so:
 ;;
-;;     guix shell qemu -- qemu-system-i386 -enable-kvm -m 2048 \
-;;      -device rtl8139,netdev=net0 -netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222 \
-;;      -snapshot -hda <the-image>
+;;     guix shell qemu -- qemu-system-i386 -m 2048                \
+;;       --enable-kvm                                             \
+;;       --device e1000,netdev=net0                               \
+;;       --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222  \
+;;       --snapshot
+;;       --hda /gnu/store/...-disk-image
 ;;
-;; and use it like
+;; and use it like:
 ;;
 ;;     ssh -p 10022 root@localhost
 ;;     guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
 ;;
-;; or even (if you use --image-size=3G)
+;; or even, if you build the image with at least --image-size=3G:
 ;;
 ;;     guix build hello
 
@@ -34,7 +37,7 @@
                  (bootloader grub-minimal-bootloader)
                  (targets '("/dev/sdX"))))
     (file-systems (cons (file-system
-                          (device (file-system-label "my-root"))
+                          (device (file-system-label "hurd"))
                           (mount-point "/")
                           (type "ext2"))
                         %base-file-systems))
diff --git a/gnu/system/examples/bare-hurd64.tmpl b/gnu/system/examples/bare-hurd64.tmpl
new file mode 100644
index 0000000000..89811e458a
--- /dev/null
+++ b/gnu/system/examples/bare-hurd64.tmpl
@@ -0,0 +1,70 @@
+;; -*-scheme-*-
+
+;; This is an operating system configuration template
+;; for a "bare bones" QEMU setup, with no X11 display server.
+
+;; To build a disk image for a virtual machine, do:
+;;
+;;     ./pre-inst-env guix system image --image-type=hurd64-qcow2 \
+;;         gnu/system/examples/bare-hurd64.tmpl
+;;
+;; You may run it like so:
+;;
+;;     guix shell qemu@7 -- qemu-system-x86_64 -m 2048            \
+;;       --machine q35                                            \
+;;       --enable-kvm                                             \
+;;       --device e1000,netdev=net0                               \
+;;       --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222  \
+;;       --snapshot
+;;       --hda /gnu/store/...-disk-image
+;;
+;; and use it like:
+;;
+;;     ssh -p 10022 root@localhost
+;;     guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
+;;
+;; or even, if you build the image with at least --image-size=3G:
+;;
+;;     guix build hello
+
+(use-modules (gnu) (gnu system hurd) (guix utils))
+(use-service-modules ssh)
+(use-package-modules ssh)
+
+(define %hurd64-os
+  (operating-system
+    (inherit %hurd64-default-operating-system)
+    (bootloader (bootloader-configuration
+                 (bootloader grub-minimal-bootloader)
+                 (targets '("/dev/sdX"))))
+    (kernel-arguments '("noide")) ;use rumpdisk
+    (file-systems (cons (file-system
+                          (device (file-system-label "hurd"))
+                          (mount-point "/")
+                          (type "ext2"))
+                        %base-file-systems))
+    (host-name "guixygnu64")
+    (timezone "Europe/Amsterdam")
+    (users (cons (user-account
+                  (name "guix")
+                  (comment "Anonymous Hurd Hacker")
+                  (group "users")
+                  (supplementary-groups '("wheel")))
+                 %base-user-accounts))
+    (packages (cons openssh-sans-x %base-packages/hurd))
+    (services (cons (service openssh-service-type
+                             (openssh-configuration
+                              (openssh openssh-sans-x)
+                              (port-number 2222)
+                              (permit-root-login #t)
+                              (allow-empty-passwords? #t)
+                              (password-authentication? #t)))
+                    ;; For installing on a real (non-QEMU) machine, use:
+                    ;; (static-networking-service-type
+                    ;;   (list %loopback-static-networking
+                    ;;        (static-networking
+                    ;;         ...)))
+                    ;; %base-services/hurd
+                    %base-services+qemu-networking/hurd))))
+
+%hurd64-os
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 50/51] system: examples: Add devel-hurd64.tmpl.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (48 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 49/51] system: examples: Add bare-hurd64.tmpl Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 51/51] gnu: Use gcc-14, gcc-toolchain-14 on the 64bit Hurd Janneke Nieuwenhuizen
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290

This also updates comments and removes the comment about a very old
`bootstrap-profile' hack.

* gnu/system/examples/devel-hurd.tmpl (hurd-packages): New variable
(%hurd-devel-os): Use it.
* gnu/system/examples/devel-hurd64.tmpl: New file.

Change-Id: I54b6b0843f0dd635d89cca483ae43d23b20d21e8
---
 gnu/system/examples/devel-hurd.tmpl   | 70 +++++++++++----------------
 gnu/system/examples/devel-hurd64.tmpl | 65 +++++++++++++++++++++++++
 2 files changed, 93 insertions(+), 42 deletions(-)
 create mode 100644 gnu/system/examples/devel-hurd64.tmpl

diff --git a/gnu/system/examples/devel-hurd.tmpl b/gnu/system/examples/devel-hurd.tmpl
index 3dca0706d1..066bdfe9d8 100644
--- a/gnu/system/examples/devel-hurd.tmpl
+++ b/gnu/system/examples/devel-hurd.tmpl
@@ -3,7 +3,7 @@
 ;; This is an operating system configuration template for a "bare bones
 ;; development" setup, with no X11 display server.
 
-;; To build a disk image for a virtual machine, do
+;; To build a disk image for a virtual machine, do something like:
 ;;
 ;;   ./pre-inst-env guix system image --image-type=hurd-qcow2 --image-size=6G \
 ;;      --no-offload gnu/system/examples/devel-hurd.tmpl
@@ -11,41 +11,38 @@
 ;; You may run it like so
 ;;
 ;;     cp /gnu/store/.../disk-image devel-hurd.img
-;;     guix shell qemu -- qemu-system-i386 -enable-kvm -m 4096 \
-;;      -device rtl8139,netdev=net0                            \
-;;      -netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222 \
-;;      -hda devel-hurd.img
-;;
-;; and use it like
+;;     guix shell qemu -- qemu-system-i386 -m 4096                \
+;;       --enable-kvm                                             \
+;;       --device e1000,netdev=net0                               \
+;;       --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222  \
+;;       --hda devel-hurd.img
 ;;
 ;;     ssh -p 10022 root@localhost
 ;;     guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
 ;;
-;; or even (if you use --image-size=3G)
+;; or even:
 ;;
 ;;     guix build hello
 ;;
-;; Building Guix, do something like:
+;; For Guix hacking, do something like:
 ;;
-;;     GUIX_PROFILE=/run/current-system/bootstrap-profile
-;;     source $GUIX_PROFILE/etc/profile
+;;     guix shell --boostrap -D guix
 ;;     mkdir -p ~/src/guix
 ;;     cd src/guix
 ;;     git clone https://git.savannah.gnu.org/git/guix.git master
 ;;     cd master
 ;;     ./bootstrap
-;;     ./configure --with-courage
+;;     ./configure
 ;;     make
 
+(include "bare-hurd.tmpl")
+
 (use-modules (srfi srfi-1)
              (ice-9 match)
-             (gnu)
              (gnu system hurd)
-             (gnu system locale)
              (guix packages)
-             (guix store)
-             (guix utils))
-(use-service-modules ssh virtualization)
+             (guix store))
+
 (use-package-modules base compression file gawk gdb hurd less m4
                      package-management ssh version-control)
 
@@ -64,23 +61,23 @@
                     ;; These are not essential and do not build yet.
                     '("graphviz" "guile-avahi" "po4a"))))
 
+(define hurd-packages
+  (filter-map input->package
+              (fold alist-delete (package-direct-inputs hurd)
+                    ;; These are not essential, rumpkernel is very big.
+                    '("dde-sources" "parted" "rumpkernel" "util-linux"
+                      "texinfo"))))
+
 (define %hurd-devel-os
   (operating-system
-    (inherit %hurd-vm-operating-system)
-    (host-name "guixydevel")
+    (inherit %hurd-os)
+    (bootloader (bootloader-configuration
+                 (bootloader grub-minimal-bootloader)
+                 (targets '("/dev/sdX"))
+                 (timeout 0)))
     (timezone "Europe/Berlin")
-    (file-systems (cons (file-system
-                          (device (file-system-label "hurd"))
-                          (mount-point "/")
-                          (type "ext2"))
-                        %base-file-systems))
     (swap-devices (list (swap-space
                           (target "/swapfile"))))
-    (users (cons (user-account
-                  (name "guix")
-                  (group "users")
-                  (supplementary-groups '("wheel")))
-                 %base-user-accounts))
     (packages (cons*
                gdb-minimal
                git-minimal
@@ -89,18 +86,7 @@
                openssh-sans-x
                (append
                 guix-packages
-                %base-packages/hurd)))
-    (services (cons*
-               (modify-services (operating-system-user-services
-                                 %hurd-vm-operating-system)
-                 (openssh-service-type
-                  config =>
-                  ;; Set wide open
-                  (openssh-configuration
-                   (openssh openssh-sans-x)
-                   (port-number 2222)
-                   (permit-root-login #t)
-                   (allow-empty-passwords? #t)
-                   (password-authentication? #t))))))))
+                hurd-packages
+                %base-packages/hurd)))))
 
 %hurd-devel-os
diff --git a/gnu/system/examples/devel-hurd64.tmpl b/gnu/system/examples/devel-hurd64.tmpl
new file mode 100644
index 0000000000..146a35adcf
--- /dev/null
+++ b/gnu/system/examples/devel-hurd64.tmpl
@@ -0,0 +1,65 @@
+;; -*-scheme-*-
+
+;; This is an operating system configuration template
+;; for a "bare bones" QEMU setup, with no X11 display server.
+
+;; To build a disk image for a virtual machine, do:
+;;
+;;   ./pre-inst-env guix system image --image-type=hurd-qcow2 --image-size=6G \
+;;      --no-offload gnu/system/examples/devel-hurd64.tmpl
+;;
+;; You may run it like so:
+;;
+;;     cp /gnu/store/.../disk-image devel-hurd.img
+;;     guix shell qemu@7 -- qemu-system-x86_64 -m 4096            \
+;;       --machine q35                                            \
+;;       --enable-kvm                                             \
+;;       --device e1000,netdev=net0                               \
+;;       --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222  \
+;;       --hda devel-hurd.img
+;;
+;; and use it like:
+;;
+;;     ssh -p 10022 root@localhost
+;;     guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
+;;
+;; or even:
+;;
+;;     guix build hello
+;;
+;; For Guix hacking, do something like:
+;;
+;;     guix shell --boostrap -D guix
+;;     mkdir -p ~/src/guix
+;;     cd src/guix
+;;     git clone git clone git://git.savannah.gnu.org/guix
+;;     cd master
+;;     ./bootstrap
+;;     ./configure
+;;     make
+
+(include "devel-hurd.tmpl")
+(include "bare-hurd64.tmpl")
+
+(define %hurd64-devel-os
+  (operating-system
+    (inherit %hurd64-os)
+    (bootloader (bootloader-configuration
+                 (bootloader grub-minimal-bootloader)
+                 (targets '("/dev/sdX"))
+                 (timeout 0)))
+    (timezone "Europe/Berlin")
+    (swap-devices (list (swap-space
+                          (target "/swapfile"))))
+    (packages (cons*
+               gdb-minimal-15
+               git-minimal
+               gnu-make
+               m4
+               openssh-sans-x
+               (append
+                guix-packages
+                hurd-packages
+                %base-packages/hurd)))))
+
+%hurd64-devel-os
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v3 51/51] gnu: Use gcc-14, gcc-toolchain-14 on the 64bit Hurd.
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
                     ` (49 preceding siblings ...)
  2024-11-19  6:55   ` [bug#74290] [PATCH v3 50/51] system: examples: Add devel-hurd64.tmpl Janneke Nieuwenhuizen
@ 2024-11-19  6:55   ` Janneke Nieuwenhuizen
  50 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-19  6:55 UTC (permalink / raw)
  To: 74290
  Cc: Andreas Enge, Christopher Baines, Efraim Flashner, Ekaitz Zarraga,
	Josselin Poiret, Ludovic Courtès, Mathieu Othacehe,
	Simon Tournier, Tobias Geerinckx-Rice

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                | 20 ++++++++++++++++++++
 3 files changed, 27 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 64ba37fd69..070a0965e6 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 (host-hurd64?)
+      gcc-14
+      gcc-11))
 
 \f
 ;;;
diff --git a/guix/utils.scm b/guix/utils.scm
index e100c03365..7a71919f73 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,23 @@ (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_64bit system?  This is almost never the right
+function, use target-x86-64? or system-x86-64? instead."
+  (and (host-hurd?)
+       (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





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 05/40] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
  2024-11-18  9:07           ` janneke
@ 2024-11-20 11:43             ` Ludovic Courtès
  0 siblings, 0 replies; 206+ messages in thread
From: Ludovic Courtès @ 2024-11-20 11:43 UTC (permalink / raw)
  To: janneke
  Cc: 74290, Josselin Poiret, Ekaitz Zarraga, Simon Tournier,
	Mathieu Othacehe, Tobias Geerinckx-Rice, Efraim Flashner,
	Andreas Enge, Christopher Baines

Hi,

<janneke@gnu.org> skribis:

>> 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?)
>
> Hmm, no that doesn't work; (%current-system) is #f at toplevel.

Right.  It would work, but only where %current-system defaults to
“x86_64-gnu”.

Ludo’.




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 05/40] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
  2024-11-17 17:26       ` janneke
  2024-11-18  8:45         ` janneke
@ 2024-11-20 11:48         ` Ludovic Courtès
  1 sibling, 0 replies; 206+ messages in thread
From: Ludovic Courtès @ 2024-11-20 11:48 UTC (permalink / raw)
  To: janneke
  Cc: 74290, Josselin Poiret, Ekaitz Zarraga, Simon Tournier,
	Mathieu Othacehe, Tobias Geerinckx-Rice, Efraim Flashner,
	Andreas Enge, Christopher Baines

Hi,

<janneke@gnu.org> skribis:

> Ludovic Courtès writes:

[...]

>> how about changing the GCC version used for cross-compilation, and
>> only that:
>>
>> diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
>> index 5781341a87..6120740b3c 100644
>> --- a/gnu/packages/cross-base.scm
>> +++ b/gnu/packages/cross-base.scm
>> @@ -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 gcc-14))
>
> Interesting...I would have thought this would cause a world rebuild,
> because of the cross-gcc in commencement.  Apparently, it doesn't.
>
>> That would affect also non-Hurd cross-compilation targets, but if it
>> works, it’s simpler.
>
> Ok, I very much like the simplicity of this.

Yay.

>> 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.

True.

> 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.

Well yes, it’s going to take a bit of time, let’s face it.

But hopefully quite a few of us would work on it and we’d set up ci.guix
to build the branch.

Also, with the reduced scope of ‘core-packages’, I hope it can be faster
than ‘core-updates’ was before.  And we can choose to have a cycle that
changes very little beside GCC.

> 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?

Yes.

At least, we can already merge cross-compilation support.

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v2 14/40] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-17 17:34       ` janneke
@ 2024-11-20 11:50         ` Ludovic Courtès
  0 siblings, 0 replies; 206+ messages in thread
From: Ludovic Courtès @ 2024-11-20 11:50 UTC (permalink / raw)
  To: janneke
  Cc: 74290, Josselin Poiret, Maxim Cournoyer, Simon Tournier,
	Mathieu Othacehe, Tobias Geerinckx-Rice, Andreas Enge,
	Christopher Baines

<janneke@gnu.org> skribis:

> Ludovic Courtès writes:
>
>> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>>
>>> +++ b/gnu/packages/bootstrap.scm
>>> @@ -125,6 +125,15 @@ (define %bootstrap-executables
>>>        ,(base32 "0nq2c1zb3wv5bf7kd83sziaashydazrn7xgq6kijlk0zj2syzc2m"))
>>>       ("xz"
>>>        ,(base32 "033rhpk6zrpxpd6ffjyg5y2zwq9x9cnq0zljb7k8jlncbalsayq5")))
>>> +    ("x86_64-gnu"
>>> +     ("bash"
>>> +      ,(base32 "1ib1kk1larki3dm46lhl756856zpjwhhlnzkgdyh9f1yf6wm431y"))
>>> +     ("mkdir"
>>> +      ,(base32 "15cnckq4qj1nlmgqy9vq3qa3kcbfm1pc2z38pscxix11j4aqswsm"))
>>> +     ("tar"
>>> +      ,(base32 "1m8v7ddmn42wym2kl9mf7csnwsw6c3jdglg7d7kp7yaa16h5fbck"))
>>> +     ("xz"
>>> +      ,(base32 "16cnr7vr0zawrwcnhshms3v5kyzb2vz1rp4kxmx507cs6rivd05b")))
>>
>> Are the i586-gnu binaries usable on x86_64-gnu?
>
> No, at least not currently.  The mach message format even differs, AFAIK.
>
> root@guixygnu64 ~# file bash-i586
> bash-i586: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Hurd 0.0.0, stripped
>
> root@guixygnu64 ~# ./bash-i586 --help
> -bash: ./bash-i586: cannot execute binary file: Exec format error

OK.  But yeah, all the Mach messages and RPCs are probably encoded
differently anyway.  Too bad!

Ludo’.




^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
                   ` (33 preceding siblings ...)
  2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
@ 2024-11-24  7:54 ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 01/58] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
                     ` (57 more replies)
  34 siblings, 58 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

New in v4:

  * Fix %bootstrap-glibc for riscv64/non-hurd -- thanks Efraim!
  * Fix host-x86-64? to remove Hurd references -- thanks Efraim!
  * Have %bootstrap-gcc also wrap g++ _only_ for the 64bit Hurd,
  * Add refcounts-assert patch for the Hurd (32 and 64bit alike) to
    avoid the dreaded
    ext2fs: refcounts_ref: Assertion '! (r.hard == 1 && r.weak == 0) || !"refcount detected use-after-free!"' failed.
    -- thanks Samuel!
  * libstdc++-boot0: Support the 64bit Hurd,
  * gcc-boot0: Support the 64bit Hurd,
  * gcc-final: Support the 64bit Hurd (almost?),
  * gcc-14: Force libdir /lib instead of /lib64 for the 64bit Hurd,
  * Adds another Debian glibc patch {get,set,make,swap}-context, for the 64bit
    Hurd, working around the gnulib-tests/test-sigaction problem -- thanks
    Sergey!
  * Removes findutils patch that disabled all tests on the 64bit Hurd.

The gcc-problem turned out to be a probable gcc bug, see
<https://gcc.gnu.org/pipermail/gcc-bugs/2024-November/889817.html>.

I have built commencement up to, but not just yet including, gcc-final.

--8<---------------cut here---------------start------------->8---
phase `build' failed after 20698.0 seconds
--8<---------------cut here---------------end--------------->8---

just started another round.

The biggest question here is: [When] are we ready to push the cross-gcc 14
patch that's needed for the bootstrap seeds.  Is there anything we could/
should do?

After we have the cross-build gcc 14 patch, rechecking and pushing the
bootstrap seeds patch and the subsequent commencement patches should have
little or no impact.

Greetings,
Janneke

Janneke Nieuwenhuizen (58):
  gnu: gnumach: Update to v1.8+git20240714.
  gnu: mig: Update to 1.8+git20231217.
  gnu: hurd: Update to 0.9.git20240714.
  gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
  gnu: cross-libc: Support cross-building for the 64bit Hurd.
  gnu: bash-minimal: Support [cross-]build with gcc-14.
  gnu: elfutils: Fix build for 64bit Hurd.
  gnu: grep: Fix build for the 64bit Hurd.
  gnu: patch: Fix build for the 64bit Hurd.
  gnu: libxcrypt: Support the 64bit Hurd.
  gnu: libstdc++: Support the 64bit Hurd.
  gnu: glibc/hurd: Add patches for the 64bit Hurd.
  gnu: bash: Avoid hang when cross-built for the Hurd.
  gnu: git-minimal: Support [cross-]build with gcc-14 and the 64bit
    Hurd.
  gnu: flex: Fix [cross-]build with gcc-14.
  gnu: libffi: Fix [cross-]build with gcc-14.
  gnu: perl: Support [cross-]build with gcc-14 and the 64bit Hurd.
  gnu: texinfo-4: Fix [cross-]build with gcc-14 and the 64bit Hurd.
  gnu: hurd: Fix build with gcc-14.
  gnu: netdde: Fix build with gcc-14.
  gnu: libedit: Fix [cross-]build with gcc-14 for 32bit.
  gnu: libssh: Fix [cross-]build with gcc-14 for 32bit.
  gnu: guile-lzlib: Support [cross-]build with gcc-14 and the 64bit
    Hurd.
  gnu: cross-base: Update %xgcc to gcc-14, to support the 64bit Hurd.
  gnu: gcc-14: Force libdir /lib instead of /lib64 for the 64bit Hurd.
  gnu: glibc/hurd: Add patch for the 64bit Hurd, fixing "raise".
  gnu: make-bootstrap: Update gcc-static to gcc-14, for the 64bit Hurd.
  DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd.
  system: image: Add hurd64 image types.
  gnu: libgpg-error: Support the 64bit Hurd.
  gnu: openssl-3.0: Support the 64bit Hurd.
  gnu: pciutils: Support the 64bit Hurd.
  gnu: libpciaccess: Support the 64bit Hurd.
  gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df.
  gnu: netdde: Support the 64bit Hurd.
  gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337.
  gnu: rumpkernel: Support the 64bit Hurd.
  gnu: hurd: Build fixes for the 64bit Hurd.
  gnu: inetutils: Fix build for the 64bit Hurd.
  gnu: grub: Fix build for the 64bit Hurd.
  gnu: guile-fibers: Fix build for the 64bit Hurd.
  gnu: m4: Fix build for the 64bit Hurd.
  gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714.
  gnu: commencement: mig-boot0: Update to 1.8+git20231217..
  gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714.
  gnu: commencement: libstdc++-boot0-gcc7: Replace by
    make-libstdc++-boot0.
  gnu: gettext: Fix cross-build shebangs.
  gnu: Add gdb-15.2, with support for the 64bit Hurd.
  gnu: bootstrap: %bootstrap-glibc: Also fix libm.so.
  system: examples: Add bare-hurd64.tmpl.
  system: examples: Add devel-hurd64.tmpl.
  gnu: Use gcc-14, gcc-toolchain-14 on the 64bit Hurd.
  gnu: commencement: kernel-headers-boot0: Support the 64bit Hurd.
  gnu: hurd: Add refcounts-assert patch.
  gnu: bootstrap: %bootstrap-gcc: Also wrap g++ for the 64bit Hurd.
  gnu: commencement: libstdc++-boot0: Support the 64bit Hurd.
  gnu: commencement: gcc-boot0: Support the 64bit Hurd.
  gnu: commencement: gcc-final: Support the 64bit Hurd.

 doc/guix.texi                                 |   9 +-
 gnu/local.mk                                  |  18 +
 gnu/packages/admin.scm                        |  14 +-
 gnu/packages/base.scm                         |  78 +-
 gnu/packages/bash.scm                         |  22 +
 gnu/packages/bootloaders.scm                  |   8 +
 gnu/packages/bootstrap.scm                    |  88 +-
 gnu/packages/commencement.scm                 | 107 +-
 gnu/packages/cross-base.scm                   |  18 +-
 gnu/packages/crypto.scm                       |  13 +
 gnu/packages/elf.scm                          |   6 +-
 gnu/packages/flex.scm                         |   8 +
 gnu/packages/gcc.scm                          |  18 +-
 gnu/packages/gdb.scm                          |  22 +
 gnu/packages/gettext.scm                      |  16 +-
 gnu/packages/gnupg.scm                        |  22 +-
 gnu/packages/guile-xyz.scm                    |   2 +-
 gnu/packages/guile.scm                        |  16 +-
 gnu/packages/hurd.scm                         | 198 ++--
 gnu/packages/libedit.scm                      |   8 +
 gnu/packages/libffi.scm                       |   8 +-
 gnu/packages/m4.scm                           |   9 +-
 gnu/packages/make-bootstrap.scm               |  49 +-
 gnu/packages/patches/gdb-hurd64.patch         | 923 ++++++++++++++++++
 .../glibc-hurd-pthread_setcancelstate.patch   |  92 ++
 gnu/packages/patches/glibc-hurd64-fault.patch |  32 +
 .../glibc-hurd64-gcc-14.2-tls-bug.patch       |  28 +
 .../glibc-hurd64-intr-msg-clobber.patch       |  62 ++
 .../patches/glibc-hurd64-sgms-context.patch   | 505 ++++++++++
 gnu/packages/patches/gnumach-version.patch    |  23 +
 gnu/packages/patches/grub-hurd64.patch        |  32 +
 gnu/packages/patches/guile-lzlib-hurd64.patch |  32 +
 gnu/packages/patches/hurd-64bit.patch         |  56 ++
 .../patches/hurd-refcounts-assert.patch       |  26 +
 gnu/packages/patches/inetutils-hurd64.patch   |  65 ++
 .../patches/libgpg-error-hurd64.patch         |  78 ++
 .../patches/libpciaccess-hurd64.patch         |  58 ++
 gnu/packages/patches/libxcrypt-hurd64.patch   |  38 +
 gnu/packages/patches/netdde-csum.patch        |  18 +
 gnu/packages/patches/openssl-hurd64.patch     |  99 ++
 gnu/packages/patches/pciutils-hurd64.patch    |  31 +
 gnu/packages/pciutils.scm                     |  25 +-
 gnu/packages/perl.scm                         |  18 +-
 gnu/packages/ssh.scm                          |   9 +-
 gnu/packages/texinfo.scm                      |  50 +-
 gnu/packages/tls.scm                          |   9 +
 gnu/packages/version-control.scm              |   7 +-
 gnu/packages/xorg.scm                         |  23 +-
 gnu/system.scm                                |   1 -
 gnu/system/examples/bare-hurd.tmpl            |  21 +-
 gnu/system/examples/bare-hurd64.tmpl          |  70 ++
 gnu/system/examples/devel-hurd.tmpl           |  70 +-
 gnu/system/examples/devel-hurd64.tmpl         |  65 ++
 gnu/system/hurd.scm                           |  17 +
 gnu/system/images/hurd.scm                    |  72 +-
 guix/packages.scm                             |   8 +-
 guix/platforms/x86.scm                        |  11 +-
 guix/utils.scm                                |  34 +-
 m4/guix.m4                                    |  12 +-
 59 files changed, 3190 insertions(+), 287 deletions(-)
 create mode 100644 gnu/packages/patches/gdb-hurd64.patch
 create mode 100644 gnu/packages/patches/glibc-hurd-pthread_setcancelstate.patch
 create mode 100644 gnu/packages/patches/glibc-hurd64-fault.patch
 create mode 100644 gnu/packages/patches/glibc-hurd64-gcc-14.2-tls-bug.patch
 create mode 100644 gnu/packages/patches/glibc-hurd64-intr-msg-clobber.patch
 create mode 100644 gnu/packages/patches/glibc-hurd64-sgms-context.patch
 create mode 100644 gnu/packages/patches/gnumach-version.patch
 create mode 100644 gnu/packages/patches/grub-hurd64.patch
 create mode 100644 gnu/packages/patches/guile-lzlib-hurd64.patch
 create mode 100644 gnu/packages/patches/hurd-64bit.patch
 create mode 100644 gnu/packages/patches/hurd-refcounts-assert.patch
 create mode 100644 gnu/packages/patches/inetutils-hurd64.patch
 create mode 100644 gnu/packages/patches/libgpg-error-hurd64.patch
 create mode 100644 gnu/packages/patches/libpciaccess-hurd64.patch
 create mode 100644 gnu/packages/patches/libxcrypt-hurd64.patch
 create mode 100644 gnu/packages/patches/netdde-csum.patch
 create mode 100644 gnu/packages/patches/openssl-hurd64.patch
 create mode 100644 gnu/packages/patches/pciutils-hurd64.patch
 create mode 100644 gnu/system/examples/bare-hurd64.tmpl
 create mode 100644 gnu/system/examples/devel-hurd64.tmpl


base-commit: 047967c42f237695d5af2af53321c70f157685a3
-- 
2.46.0





^ permalink raw reply	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 01/58] gnu: gnumach: Update to v1.8+git20240714.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 02/58] gnu: mig: Update to 1.8+git20231217 Janneke Nieuwenhuizen
                     ` (56 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/patches/gnumach-version.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hurd.scm (gnumach-headers): Update to v1.8+git20240714 and use
it.
* gnu/packages/commencement.scm (gnumach-headers-boot0)[origin]: Reset
patches.

Change-Id: I147c64021c2ee79dfc4cd4fd9a29529eef8890c5
---
 gnu/local.mk                               |  1 +
 gnu/packages/commencement.scm              |  1 +
 gnu/packages/hurd.scm                      |  9 ++++-----
 gnu/packages/patches/gnumach-version.patch | 23 ++++++++++++++++++++++
 4 files changed, 29 insertions(+), 5 deletions(-)
 create mode 100644 gnu/packages/patches/gnumach-version.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 04e9b1c0fd..5e05fc9d10 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1461,6 +1461,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gnome-session-support-elogind.patch	\
   %D%/packages/patches/gnome-tweaks-search-paths.patch		\
   %D%/packages/patches/gnulib-bootstrap.patch			\
+  %D%/packages/patches/gnumach-version.patch			\
   %D%/packages/patches/gnupg-default-pinentry.patch		\
   %D%/packages/patches/gnupg-1-build-with-gcc10.patch		\
   %D%/packages/patches/gnutls-skip-trust-store-test.patch	\
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index ce40f0cea6..1cfaaae1e7 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2639,6 +2639,7 @@ (define gnumach-headers-boot0
      (source
       (origin
         (inherit (package-source gnumach-headers))
+        (patches '())
         (method
          (git-fetch-from-tarball
           (origin
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 9c1681f236..a22d0cadce 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -57,21 +57,20 @@ (define (hurd-source-url version)
                  version ".tar.gz"))
 
 (define-public gnumach-headers
-  (let ((revision "0")
-        (commit "2556fdece900d67529d5eda01f1bdaae4ffe96b0"))
+  (let ((commit "v1.8+git20240714"))
     (package
       (name "gnumach-headers")
-      (version (git-version "1.8" revision commit))
+      (version (string-drop commit 1))
       (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://git.savannah.gnu.org/git/hurd/gnumach.git")
                (commit commit)))
+         (patches (search-patches "gnumach-version.patch"))
          (file-name (git-file-name "gnumach" version))
          (sha256
-          (base32
-           "1lzsbix0l4jhab38pvwnmk7ip1lsn7m5smhnrciqajsqnadsnlzs"))))
+          (base32 "0ykav1kx0bgxcxw04bpcsh5s4531fzdkahjgrlsfs2h3w3vfkga0"))))
       (build-system gnu-build-system)
       (arguments
        `(#:phases
diff --git a/gnu/packages/patches/gnumach-version.patch b/gnu/packages/patches/gnumach-version.patch
new file mode 100644
index 0000000000..aec3c86a16
--- /dev/null
+++ b/gnu/packages/patches/gnumach-version.patch
@@ -0,0 +1,23 @@
+Upstream-status: Taken from Debian upstream:
+    <https://salsa.debian.org/hurd-team/gnumach/-/raw/master/debian/patches/12_version_suffix.patch>
+
+Index: gnumach/configure.ac
+===================================================================
+--- gnumach.orig/configure.ac
++++ gnumach/configure.ac
+@@ -19,6 +19,7 @@ AC_PREREQ([2.57])
+ m4_include([version.m4])
+ AC_INIT([AC_PACKAGE_NAME], [AC_PACKAGE_VERSION], [AC_PACKAGE_BUGREPORT],
+   [AC_PACKAGE_TARNAME])
++AC_SUBST([PACKAGE_VERSION_SUFFIX])
+ AC_CONFIG_SRCDIR([kern/ipc_kobject.c])
+ 
+ if test -z "${CFLAGS+set}"; then
+Index: gnumach/version.c.in
+===================================================================
+--- gnumach.orig/version.c.in
++++ gnumach/version.c.in
+@@ -1,2 +1,2 @@
+ /* @configure_input@ */
+-const char version[] = "@PACKAGE_NAME@ @PACKAGE_VERSION@";
++const char version[] = "@PACKAGE_NAME@ @PACKAGE_VERSION@@PACKAGE_VERSION_SUFFIX@";
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 02/58] gnu: mig: Update to 1.8+git20231217.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 01/58] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 03/58] gnu: hurd: Update to 0.9.git20240714 Janneke Nieuwenhuizen
                     ` (55 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (mig): Update to 1.8+git20231217.

Change-Id: I0e531ecc7fdcfbefe2e0e24d7b2fb5e0fe8a3ae2
---
 gnu/packages/hurd.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index a22d0cadce..28f39cc448 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -92,7 +92,7 @@ (define-public gnumach-headers
 (define-public mig
   (package
     (name "mig")
-    (version "1.8+git20230520")
+    (version "1.8+git20231217")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -101,7 +101,7 @@ (define-public mig
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "10r0fdjqjzqsy6ajb21rifvhw0wpjvrw6a1zdyliqlzqny5k0qlz"))))
+                "1mx7w5vzw5ws0zplm1y6s679jb1g2hjkiwl3dlk5lxys0dxs5g4g"))))
     (build-system gnu-build-system)
     ;; Flex is needed both at build and run time.
     (inputs (list gnumach-headers flex))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 03/58] gnu: hurd: Update to 0.9.git20240714.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 01/58] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 02/58] gnu: mig: Update to 1.8+git20231217 Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 04/58] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
                     ` (54 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (hurd-headers): Update to 0.9.git20240714.
(hurd)[arguments]: Remove rumpdisk build hack from "prepare-addons" stage.
Instead, when cross-compiling, add stage "fixup-cross-configure" to enable
rumpdisk.
* gnu/system.scm (hurd-multiboot-modules): Remove
"--x-xattr-translator-records" option that has been removed and is now the
default.

Change-Id: I4609b5a959c1ece98e2fe1aedbb1d31d6edadcca
---
 gnu/packages/hurd.scm | 12 +++++++++---
 gnu/system.scm        |  1 -
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 28f39cc448..06fae1bd3b 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -132,7 +132,7 @@ (define-public mig
 
 (define-public hurd-headers
   (let ((revision "3")
-        (commit "v0.9.git20231217"))
+        (commit "v0.9.git20240714"))
     (package
       (name "hurd-headers")
       (version (string-drop commit 1))
@@ -143,7 +143,7 @@ (define-public hurd-headers
                       (commit commit)))
                 (sha256
                  (base32
-                  "1d138kzhil6s5gf9di8grpz1iziakyfv037wkc8s7qyd61imm31d"))
+                  "0wvzil3llmrjg7ymwqs86d11bm5fl771jwncv7kk679lsvqca0ll"))
                 (file-name (git-file-name name version))))
       (build-system gnu-build-system)
       (native-inputs
@@ -336,7 +336,7 @@ (define-public hurd
              ;; Makefile. libdde_linux26 is built later in its own phase.
              (substitute* "Makefile"
                (("libbpf ")
-                "libbpf libmachdevdde libddekit rumpdisk"))))
+                "libbpf libmachdevdde libddekit "))))
          (add-after 'unpack 'find-tirpc
            (lambda* (#:key inputs #:allow-other-keys)
              (for-each (lambda (var)
@@ -362,6 +362,12 @@ (define-public hurd
                (("#include <rpc/pmap_prot.h>" m)
                 (string-append "#include <rpc/types.h>\n#include <rpc/xdr.h>\n" m)))
              #t))
+         ,@(if (%current-target-system)
+               '((add-after 'configure 'fixup-cross-configure
+                   (lambda _
+                     (substitute* "config.make"
+                       (("HAVE_LIBRUMP = no") "HAVE_LIBRUMP = yes")))))
+               '())
          (add-before 'build 'pre-build
            (lambda _
              ;; Don't change the ownership of any file at this time.
diff --git a/gnu/system.scm b/gnu/system.scm
index 074cd04a0e..dfcb8fb279 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1539,7 +1539,6 @@ (define (hurd-multiboot-modules os)
                 "--multiboot-command-line='${kernel-command-line}'"
                 "--exec-server-task='${exec-task}'"
                 "--store-type=typed"
-                "--x-xattr-translator-records"
                 "'${root}'"
                 "'$(fs-task=task-create)'"))
          (target (%current-target-system))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 04/58] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (2 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 03/58] gnu: hurd: Update to 0.9.git20240714 Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 05/58] gnu: cross-libc: Support cross-building for the " Janneke Nieuwenhuizen
                     ` (53 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290
  Cc: Andreas Enge, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Simon Tournier,
	Tobias Geerinckx-Rice

* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Update comment on where
to find shared linker name.
(make-raw-bag): Also use raw-build-guile3 when building for the 64bit Hurd.
* gnu/packages/cross-base.scm (cross-kernel-headers*): Use target-hurd?
instead of custom "i586..."  matching to also use xhurd-core-headers for
target-hurd64.
* gnu/packages/make-bootstrap.scm (package-with-relocatable-glibc)
[native-inputs]: Move final-inputs before cross-packages.
(%binutils-static)[arguments]: When building for the 64bit Hurd, add
"lt_cv_prog_compiler_static_works=yes", "lt_cv_prog_compiler_static_works_CXX=yes"
to #:make-flags to convince to actually link the binaries statically.
(make-guile-static)[arguments]: When building for the 64bit Hurd, add
"lt_cv_prog_compiler_static_works=yes" to #:configure-flags to convince
libtool to actually link guile statically.
* guix/platforms/x86.scm (x86_64-gnu): New exported variable.
* guix/utils.scm (target-hurd64? system-hurd64?): New procedures.
---
 gnu/packages/bootstrap.scm      |  3 ++-
 gnu/packages/cross-base.scm     |  6 +++---
 gnu/packages/make-bootstrap.scm | 24 +++++++++++++++++-------
 guix/platforms/x86.scm          | 11 ++++++++++-
 guix/utils.scm                  | 15 ++++++++++++++-
 5 files changed, 46 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 3743abf9fe..33cbaa30ae 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -558,7 +558,8 @@ (define* (make-raw-bag name
     (name name)
     (system system)
     (build-inputs inputs)
-    (build (cond ((target-riscv64?)
+    (build (cond ((or (target-riscv64?)
+                      (target-hurd64?))
                   raw-build-guile3)
                  (else raw-build)))))
 
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 5781341a87..83672ab383 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -641,9 +641,9 @@ (define* (cross-kernel-headers* target
                 ("hurd-headers" ,xhurd-headers)
                 ("hurd-minimal" ,xhurd-minimal)))))
 
-  (match target
-    ((or "i586-pc-gnu" "i586-gnu") xhurd-core-headers)
-    (_ xlinux-headers)))
+  (if (target-hurd? target)
+      xhurd-core-headers
+      xlinux-headers))
 
 (define* (cross-libc . args)
   (if (or (= (length args) 1) (contains-keyword? args))
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index edc536bff4..689d48d342 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -145,7 +145,10 @@ (define (package-with-relocatable-glibc p)
                       target
                       #:xbinutils (cross-binutils target)
                       #:libc (cross-bootstrap-libc target))))
-          `(("cross-gcc" ,(package
+          `(,@(%final-inputs)
+            ;; As versions for gcc and cross-gcc can differ, make sure to have
+            ;; cross-gcc behind gcc in CPLUS_INCLUDE_PATH.
+            ("cross-gcc" ,(package
                             (inherit xgcc)
                             (search-paths
                              ;; Ensure the cross libc headers appears on the
@@ -154,8 +157,7 @@ (define (package-with-relocatable-glibc p)
                                     (variable "CROSS_CPLUS_INCLUDE_PATH")
                                     (files '("include")))
                                    (package-search-paths gcc)))))
-            ("cross-binutils" ,(cross-binutils target))
-            ,@(%final-inputs)))
+            ("cross-binutils" ,(cross-binutils target))))
         `(("libc" ,(glibc-for-bootstrap glibc))
           ("libc:static" ,(glibc-for-bootstrap glibc) "static")
           ("gcc" ,(gcc-for-bootstrap glibc))
@@ -395,10 +397,15 @@ (define %binutils-static
                        ((#:configure-flags flags _ ...)
                         flags)))
            #:make-flags
-           (match (memq #:make-flags (package-arguments binutils))
-             ((#:make-flags flags _ ...)
-              flags)
-             (_ #~'()))
+           #~(append
+              #$(if (target-hurd64?)
+                    #~'("lt_cv_prog_compiler_static_works=yes"
+                        "lt_cv_prog_compiler_static_works_CXX=yes")
+                    #~'())
+              #$(match (memq #:make-flags (package-arguments binutils))
+                  ((#:make-flags flags _ ...)
+                   flags)
+                  (_ #~'())))
            #:strip-flags #~'("--strip-all")
            #:phases
            #~(modify-phases %standard-phases
@@ -642,6 +649,9 @@ (define* (make-guile-static guile patches)
 
                   #$@(if (target-hurd?)
                          #~("--disable-jit")
+                         #~())
+                  #$@(if (target-hurd64?)
+                         #~("lt_cv_prog_compiler_static_works=yes")
                          #~())))
          ((#:phases phases '%standard-phases)
           #~(modify-phases #$phases
diff --git a/guix/platforms/x86.scm b/guix/platforms/x86.scm
index 0c8fc7296c..5617e6dd68 100644
--- a/guix/platforms/x86.scm
+++ b/guix/platforms/x86.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
 ;;; Copyright © 2023, 2024 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,7 +26,8 @@ (define-module (guix platforms x86)
             x86_64-linux-x32
             i686-mingw
             x86_64-mingw
-            i586-gnu))
+            i586-gnu
+            x86_64-gnu))
 
 (define i686-linux
   (platform
@@ -71,3 +73,10 @@ (define i586-gnu
    (system "i586-gnu")
    (rust-target "i686-unknown-hurd-gnu")
    (glibc-dynamic-linker "/lib/ld.so.1")))
+
+(define x86_64-gnu
+  (platform
+   (target "x86_64-pc-gnu")
+   (system "x86_64-gnu")
+   (rust-target "x86_64-unknown-hurd-gnu")
+   (glibc-dynamic-linker "/lib/ld-x86-64.so.1")))
diff --git a/guix/utils.scm b/guix/utils.scm
index f161cb4ef3..e100c03365 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -17,7 +17,7 @@
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
 ;;; Copyright © 2023 Philip McGrath <philip@philipmcgrath.com>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com>
 ;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
@@ -94,6 +94,8 @@ (define-module (guix utils)
             target-linux?
             target-hurd?
             system-hurd?
+            target-hurd64?
+            system-hurd64?
             target-mingw?
             target-x86-32?
             target-x86-64?
@@ -716,6 +718,17 @@ (define* (system-hurd?)
   "Is the current system the GNU(/Hurd) system?"
   (and=> (%current-system) target-hurd?))
 
+(define* (target-hurd64? #:optional (target (or (%current-target-system)
+                                                (%current-system))))
+  "Does TARGET represent the 64bit GNU(/Hurd) system?"
+  (and (target-hurd?)
+       (target-64bit? target)))
+
+(define* (system-hurd64?)
+  "Is the current system the 64bit GNU(/Hurd) system?"
+  (and (system-hurd?)
+       (target-64bit? (%current-system))))
+
 (define* (target-mingw? #:optional (target (%current-target-system)))
   "Is the operating system of TARGET Windows?"
   (and target
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 05/58] gnu: cross-libc: Support cross-building for the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (3 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 04/58] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 06/58] gnu: bash-minimal: Support [cross-]build with gcc-14 Janneke Nieuwenhuizen
                     ` (52 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/base.scm (glibc)[arguments]: When building for the Hurd, in
phase "create-machine-symlink", do not assume CPU is i386, also cater for
x86_64.
* gnu/packages/cross-base.scm (cross-libc*)[arguments]: Likewise.

Change-Id: Ib009b7bd301b543b8629382330cca9d963b7a812
---
 gnu/packages/base.scm       | 9 +++++++--
 gnu/packages/bootstrap.scm  | 2 +-
 gnu/packages/cross-base.scm | 8 ++++++--
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 90c25b54e1..02ef71f20d 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1079,7 +1079,7 @@ (define-public glibc
                                (string-append locale "/C.UTF-8")))))
 
                  ,@(if (target-hurd?)
-                       '((add-after 'install 'augment-libc.so
+                       `((add-after 'install 'augment-libc.so
                            (lambda* (#:key outputs #:allow-other-keys)
                              (let ((out (assoc-ref outputs "out")))
                                (substitute* (string-append out "/lib/libc.so")
@@ -1089,7 +1089,12 @@ (define-public glibc
                          (add-after 'install 'create-machine-symlink
                            (lambda* (#:key outputs #:allow-other-keys)
                              (let* ((out (assoc-ref outputs "out"))
-                                    (cpu "i386")
+                                    (cpu ,(match (or (%current-target-system)
+                                                     (%current-system))
+                                            ((? target-x86-32?)
+                                             "i386")
+                                            ((? target-x86-64?)
+                                             "x86_64")))
                                     (machine (string-append
                                               out "/include/mach/machine")))
                                (unless (file-exists? machine)
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 33cbaa30ae..27798fe278 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -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/cross-base.scm b/gnu/packages/cross-base.scm
index 83672ab383..4961b3b4c0 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -738,7 +738,7 @@ (define* (cross-libc* target
                (delete 'install-utf8-c-locale)
 
                ,@(if (target-hurd? target)
-                     '((add-after 'install 'augment-libc.so
+                     `((add-after 'install 'augment-libc.so
                          (lambda* (#:key outputs #:allow-other-keys)
                            (let ((out (assoc-ref outputs "out")))
                              (substitute* (string-append out "/lib/libc.so")
@@ -748,7 +748,11 @@ (define* (cross-libc* target
                        (add-after 'install 'create-machine-symlink
                          (lambda* (#:key outputs #:allow-other-keys)
                            (let* ((out (assoc-ref outputs "out"))
-                                  (cpu "i386")
+                                  (cpu ,(match target
+                                          ((? target-x86-32?)
+                                           "i386")
+                                          ((? target-x86-64?)
+                                           "x86_64")))
                                   (machine (string-append
                                             out "/include/mach/machine")))
                              (unless (file-exists? machine)
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 06/58] gnu: bash-minimal: Support [cross-]build with gcc-14.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (4 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 05/58] gnu: cross-libc: Support cross-building for the " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 07/58] gnu: elfutils: Fix build for 64bit Hurd Janneke Nieuwenhuizen
                     ` (51 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/bash-minimal.scm (bash)[arguments]: When building for the 64bit
hurd, or cross-building, use "CFLAGS=-g -O2 -Wno-implicit-function-declaration".

Change-Id: I1356c0aeac303bdf0254c28815716c83884008a0
---
 gnu/packages/bash.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index 93641a78d5..56918d79bd 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
 ;;; Copyright © 2021 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2024 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -251,6 +252,13 @@ (define-public bash-minimal
                ;; modules and related code.
                "ac_cv_func_dlopen=no"
 
+               ,@(if (or (target-hurd64?) (%current-target-system))
+                     ;; gcc-14 implictly uses -Wimplicit-function-declaration
+                     ;; which together with -Werror causes:
+                     ;; ./enable.def:492:11: error: implicit declaration of function ‘dlclose’;
+                     '("CFLAGS=-g -O2 -Wno-implicit-function-declaration")
+                     '())
+
                ,@(if (%current-target-system)
                      '("bash_cv_job_control_missing=no"
                        "bash_cv_getcwd_malloc=yes")
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 07/58] gnu: elfutils: Fix build for 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (5 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 06/58] gnu: bash-minimal: Support [cross-]build with gcc-14 Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 08/58] gnu: grep: Fix build for the " Janneke Nieuwenhuizen
                     ` (50 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/elf.scm (elfutils)[arguments]: When building for a 64bit Hurd,
set #:make-flags.

Change-Id: I00abf360a7de5b1f78c1e912f0dcf27c62c1af68
---
 gnu/packages/elf.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm
index 119f8d13dd..81a753a483 100644
--- a/gnu/packages/elf.scm
+++ b/gnu/packages/elf.scm
@@ -10,7 +10,7 @@
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2021 Leo Le Bouter <lle-bout@zaclys.net>
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -86,6 +86,10 @@ (define-public elfutils
                                "--disable-libdebuginfod"
                                "--disable-debuginfod")
 
+       ,@(if (target-hurd64?)
+             '(#:make-flags '("core-file_no_Werror=yes"))
+             '())
+
        ;; Disable tests on MIPS and PowerPC (without changing
        ;; the arguments list on other systems).
        ,@(if (any (cute string-prefix? <> (or (%current-target-system)
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 08/58] gnu: grep: Fix build for the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (6 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 07/58] gnu: elfutils: Fix build for 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 09/58] gnu: patch: " Janneke Nieuwenhuizen
                     ` (49 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/base.scm (grep)[arguments]: When building for the 64bit Hurd,
add patch-sigsegv.h stage.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/packages/base.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 02ef71f20d..010be631d7 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -154,6 +154,13 @@ (define-public grep
                                        (string-append bin "/fgrep"))
                       (("^exec grep")
                        (string-append "exec " bin "/grep"))))))
+              #$@(if (target-hurd64?)
+                     #~((add-after 'unpack 'patch-sigsegv
+                          (lambda _
+                            ;; Stack overflow recovery does not compile
+                            (substitute* "lib/sigsegv.in.h"
+                              (("__GNU__") "__XGNU__")))))
+                     #~())
               #$@(if (system-hurd?)
                      #~((add-before 'check 'skip-test
                           (lambda _
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 09/58] gnu: patch: Fix build for the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (7 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 08/58] gnu: grep: Fix build for the " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 10/58] gnu: libxcrypt: Support " Janneke Nieuwenhuizen
                     ` (48 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/base.scm (patch)[arguments]: When building for the 64bit Hurd,
set #:configure-flags.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/packages/base.scm | 49 ++++++++++++++++++++++++-------------------
 1 file changed, 28 insertions(+), 21 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 010be631d7..83f8c0d9e9 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -339,27 +339,34 @@ (define-public patch
                   "1bk38169c0xh01b0q0zmnrjqz8k9byz3arp4q7q66sn6xwf94nvz"))
                 (patches (search-patches "patch-hurd-path-max.patch"))))
       (arguments
-       (substitute-keyword-arguments (package-arguments base)
-         ((#:phases phases '%standard-phases)
-          #~(modify-phases #$phases
-              (add-after 'unpack 'copy-gnulib-sources
-                (lambda _
-                  ;; XXX: We copy the source instead of using 'gnulib' as a
-                  ;; native input to avoid introducing a dependency cycle.
-                  (copy-recursively #+gnulib "gnulib")
-                  (setenv "GNULIB_SRCDIR"
-                          (string-append (getcwd) "/gnulib/src/gnulib"))))
-              (add-after 'copy-gnulib-sources 'update-bootstrap-script
-                (lambda _
-                  (copy-file "gnulib/src/gnulib/build-aux/bootstrap"
-                             "bootstrap")))
-              (add-after 'unpack 'patch-configure.ac
-                (lambda _
-                  (substitute* "configure.ac"
-                    ;; The gnulib-provided git-version-gen script has a plain
-                    ;; shebang of #!/bin/sh; avoid using it.
-                    (("build-aux/git-version-gen" all)
-                     (string-append "sh " all)))))))))
+       (let ((arguments
+         (substitute-keyword-arguments (package-arguments base)
+           ((#:phases phases '%standard-phases)
+            #~(modify-phases #$phases
+                (add-after 'unpack 'copy-gnulib-sources
+                  (lambda _
+                    ;; XXX: We copy the source instead of using 'gnulib' as a
+                    ;; native input to avoid introducing a dependency cycle.
+                    (copy-recursively #+gnulib "gnulib")
+                    (setenv "GNULIB_SRCDIR"
+                            (string-append (getcwd) "/gnulib/src/gnulib"))))
+                (add-after 'copy-gnulib-sources 'update-bootstrap-script
+                  (lambda _
+                    (copy-file "gnulib/src/gnulib/build-aux/bootstrap"
+                               "bootstrap")))
+                (add-after 'unpack 'patch-configure.ac
+                  (lambda _
+                    (substitute* "configure.ac"
+                      ;; The gnulib-provided git-version-gen script has a plain
+                      ;; shebang of #!/bin/sh; avoid using it.
+                      (("build-aux/git-version-gen" all)
+                       (string-append "sh " all))))))))))
+         (if (target-hurd64?)
+             (substitute-keyword-arguments arguments
+               ((#:configure-flags flags '())
+                #~(list "--disable-threads"
+                        "gl_cv_func_working_mktime=yes")))
+             arguments)))
       (native-inputs (list autoconf automake bison ed))
       (properties '()))))
 
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 10/58] gnu: libxcrypt: Support the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (8 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 09/58] gnu: patch: " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 11/58] gnu: libstdc++: " Janneke Nieuwenhuizen
                     ` (47 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/libxcrypt-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/crypto.scm (libxcrypt)[arguments]: When building for the 64bit
Hurd, use it in new phase `apply-hurd64-patch'.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/local.mk                                |  1 +
 gnu/packages/crypto.scm                     | 13 +++++++
 gnu/packages/patches/libxcrypt-hurd64.patch | 38 +++++++++++++++++++++
 3 files changed, 52 insertions(+)
 create mode 100644 gnu/packages/patches/libxcrypt-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5e05fc9d10..0753002f75 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1726,6 +1726,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libutils-remove-damaging-includes.patch	\
   %D%/packages/patches/libvdpau-va-gl-unbundle.patch		\
   %D%/packages/patches/libvpx-CVE-2016-2818.patch		\
+  %D%/packages/patches/libxcrypt-hurd64.patch			\
   %D%/packages/patches/libxml2-xpath0-Add-option-xpath0.patch	\
   %D%/packages/patches/libwpd-gcc-compat.patch			\
   %D%/packages/patches/libxslt-generated-ids.patch		\
diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index 2a298c4caf..9ef1a53fa6 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -27,6 +27,7 @@
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;; Copyright © 2023 Ivan Vilata-i-Balaguer <ivan@selidor.net>
 ;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1661,6 +1662,18 @@ (define-public libxcrypt
     (build-system gnu-build-system)
     (native-inputs
      (list perl))
+    (arguments
+     (if (target-hurd64?)
+         (list
+          #:phases
+          #~(modify-phases %standard-phases
+              (add-after 'unpack 'apply-hurd64-patch
+                (lambda _
+                  (let ((patch
+                         #$(local-file
+                            (search-patch "libxcrypt-hurd64.patch"))))
+                    (invoke "patch" "--force" "-p1" "-i" patch))))))
+              '()))
     (synopsis
      "Extended crypt library for descrypt, md5crypt, bcrypt, and others")
     (description
diff --git a/gnu/packages/patches/libxcrypt-hurd64.patch b/gnu/packages/patches/libxcrypt-hurd64.patch
new file mode 100644
index 0000000000..9fc3018539
--- /dev/null
+++ b/gnu/packages/patches/libxcrypt-hurd64.patch
@@ -0,0 +1,38 @@
+Upstream-status: Taken from upstream:
+    <https://github.com/besser82/libxcrypt/commit/b2c1da2e1ce2d3e72f511f5bc94a6ffa68b70917>
+
+From b2c1da2e1ce2d3e72f511f5bc94a6ffa68b70917 Mon Sep 17 00:00:00 2001
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date: Sun, 14 Jul 2024 13:13:07 +0200
+Subject: [PATCH] Add binary compatibility for x86_64 GNU/Hurd
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+
+diff --git a/lib/libcrypt.map.in b/lib/libcrypt.map.in
+index 88ea911..a56b7bf 100644
+--- a/lib/libcrypt.map.in
++++ b/lib/libcrypt.map.in
+@@ -43,5 +43,5 @@ fcrypt			-		GLIBC_2.0
+ %chain GLIBC_2.0 GLIBC_2.2 GLIBC_2.2.1 GLIBC_2.2.2 GLIBC_2.2.5 GLIBC_2.2.6
+ %chain GLIBC_2.3 GLIBC_2.4 GLIBC_2.12 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18
+ %chain GLIBC_2.21 GLIBC_2.27 GLIBC_2.29 GLIBC_2.32 GLIBC_2.33 GLIBC_2.35
+-%chain GLIBC_2.36
++%chain GLIBC_2.36 GLIBC_2.38
+ %chain OW_CRYPT_1.0 XCRYPT_2.0 XCRYPT_4.3 XCRYPT_4.4
+diff --git a/lib/libcrypt.minver b/lib/libcrypt.minver
+index 8478077..c5a5bf2 100644
+--- a/lib/libcrypt.minver
++++ b/lib/libcrypt.minver
+@@ -51,6 +51,7 @@
+ #VERSION     SYSTEM          CPU_FAMILY    PREPROCESSOR_CHECK
+ 
+ # GNU Hurd
++GLIBC_2.38   gnu             x86_64
+ GLIBC_2.2.6  gnu             i[3-9]86
+ ERROR        gnu             .
+ 
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 11/58] gnu: libstdc++: Support the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (9 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 10/58] gnu: libxcrypt: Support " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 12/58] gnu: glibc/hurd: Add patches for " Janneke Nieuwenhuizen
                     ` (46 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/gcc.scm (make-libstdc++)[arguments]: When building for the
64bit Hurd, add stage patch-hurd64.

Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
---
 gnu/packages/gcc.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index c9e475b676..64ba37fd69 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -1024,7 +1024,15 @@ (define-public (make-libstdc++ gcc)
                   (("/lib64") "/lib")))))
           (add-before 'configure 'chdir
             (lambda _
-              (chdir "libstdc++-v3"))))
+              (chdir "libstdc++-v3")))
+          #$@(let ((version (package-version gcc)))
+               (if (target-hurd64?)
+                   #~((add-after 'unpack 'patch-hurd64
+                        (lambda _
+                          (substitute* "libstdc++-v3/src/c++20/tzdb.cc"
+                            (("#if ! defined _GLIBCXX_ZONEINFO_DIR")
+                             "#if __GNU__ || ! defined _GLIBCXX_ZONEINFO_DIR")))))
+                   '())))
 
       #:configure-flags '`("--disable-libstdcxx-pch"
                            ,(string-append "--with-gxx-include-dir="
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 12/58] gnu: glibc/hurd: Add patches for the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (10 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 11/58] gnu: libstdc++: " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 13/58] gnu: bash: Avoid hang when cross-built for the Hurd Janneke Nieuwenhuizen
                     ` (45 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

These patches fix:

  * Statically linked tar to hang/segfault upon issuing the "--mtime=@1"
  warning; this is also applicable for the 32bit Hurd using glibc-2.39!

See <https://lists.gnu.org/archive/html/bug-hurd/2024-11/msg00115.html>.

  * Shell replacement problems for the 64bit Hurd.

See <https://lists.debian.org/debian-hurd/2024/07/msg00063.html>.

  * Findutil's gnulib-tests/test-sigaction failure.

* gnu/packages/patches/glibc-hurd-pthread_setcancelstate.patch,
gnu/packages/patches/glibc-hurd64-fault.patch,
gnu/packages/patches/glibc-hurd64-intr-msg-clobber.patch,
gnu/packages/patches/glibc-hurd64-sgms-context.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register them.
* gnu/packages/base.scm (glibc/hurd): Use them.

Change-Id: I9ee65983876cd22ad1dc01aabb41a34074631599
---
 gnu/local.mk                                  |   4 +
 gnu/packages/base.scm                         |  12 +-
 .../glibc-hurd-pthread_setcancelstate.patch   |  92 ++++
 gnu/packages/patches/glibc-hurd64-fault.patch |  32 ++
 .../glibc-hurd64-intr-msg-clobber.patch       |  62 +++
 .../patches/glibc-hurd64-sgms-context.patch   | 505 ++++++++++++++++++
 6 files changed, 706 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/glibc-hurd-pthread_setcancelstate.patch
 create mode 100644 gnu/packages/patches/glibc-hurd64-fault.patch
 create mode 100644 gnu/packages/patches/glibc-hurd64-intr-msg-clobber.patch
 create mode 100644 gnu/packages/patches/glibc-hurd64-sgms-context.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 0753002f75..f15272f25c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1437,7 +1437,11 @@ dist_patch_DATA =						\
   %D%/packages/patches/glibc-hurd-getauxval.patch		\
   %D%/packages/patches/glibc-hurd-gettyent.patch		\
   %D%/packages/patches/glibc-hurd-mach-print.patch		\
+  %D%/packages/patches/glibc-hurd-pthread_setcancelstate.patch	\
   %D%/packages/patches/glibc-hurd-signal-sa-siginfo.patch	\
+  %D%/packages/patches/glibc-hurd64-fault.patch			\
+  %D%/packages/patches/glibc-hurd64-intr-msg-clobber.patch	\
+  %D%/packages/patches/glibc-hurd64-sgms-context.patch		\
   %D%/packages/patches/glibc-ldd-powerpc.patch			\
   %D%/packages/patches/glibc-ldd-x86_64.patch			\
   %D%/packages/patches/glibc-locales.patch			\
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 83f8c0d9e9..80e53c2e52 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1588,7 +1588,17 @@ (define-public which
 command.")
     (license gpl3+))) ; some files are under GPLv2+
 
-(define-public glibc/hurd glibc)
+(define-public glibc/hurd
+  (package/inherit glibc
+    (source
+     (origin
+       (inherit (package-source glibc))
+       (patches
+        (append (origin-patches (package-source glibc))
+                (search-patches "glibc-hurd-pthread_setcancelstate.patch"
+                                "glibc-hurd64-fault.patch"
+                                "glibc-hurd64-intr-msg-clobber.patch"
+                                "glibc-hurd64-sgms-context.patch")))))))
 
 (define-public glibc/hurd-headers
   (package/inherit glibc/hurd
diff --git a/gnu/packages/patches/glibc-hurd-pthread_setcancelstate.patch b/gnu/packages/patches/glibc-hurd-pthread_setcancelstate.patch
new file mode 100644
index 0000000000..1d7c81b98e
--- /dev/null
+++ b/gnu/packages/patches/glibc-hurd-pthread_setcancelstate.patch
@@ -0,0 +1,92 @@
+Upstream-status: Taken from <https://salsa.debian.org/glibc-team/glibc/-/blob/25a0a47767fe7dc5151eb36afaade17218728efe/debian/patches/hurd-i386/local-static_pthread_setcancelstate.diff>.
+
+This is needed for the 64bit Hurd statically linked tar non to hang when
+issuing a warning.
+
+since the move of libpthread functions to libc, glibc dropped the use
+of __libc_ptf_call. But htl hasn't made the move yet, so we have to use
+__libc_ptf_call there for now.
+
+Index: glibc-2.36/misc/error.c
+===================================================================
+--- glibc-2.36.orig/misc/error.c
++++ glibc-2.36/misc/error.c
+@@ -240,7 +240,8 @@ __error_internal (int status, int errnum
+   /* We do not want this call to be cut short by a thread
+      cancellation.  Therefore disable cancellation for now.  */
+   int state = PTHREAD_CANCEL_ENABLE;
+-  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
++  __libc_ptf_call (__pthread_setcancelstate,
++		   (PTHREAD_CANCEL_DISABLE, &state), 0);
+ #endif
+ 
+   flush_stdout ();
+@@ -262,7 +263,7 @@ __error_internal (int status, int errnum
+ 
+ #ifdef _LIBC
+   _IO_funlockfile (stderr);
+-  __pthread_setcancelstate (state, NULL);
++  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
+ #endif
+ }
+ 
+@@ -306,7 +307,9 @@ __error_at_line_internal (int status, in
+   /* We do not want this call to be cut short by a thread
+      cancellation.  Therefore disable cancellation for now.  */
+   int state = PTHREAD_CANCEL_ENABLE;
+-  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
++  __libc_ptf_call (__pthread_setcancelstate,
++		   (PTHREAD_CANCEL_DISABLE, &state),
++		   0);
+ #endif
+ 
+   flush_stdout ();
+@@ -336,7 +339,7 @@ __error_at_line_internal (int status, in
+ 
+ #ifdef _LIBC
+   _IO_funlockfile (stderr);
+-  __pthread_setcancelstate (state, NULL);
++  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
+ #endif
+ }
+ 
+Index: glibc-2.36/libio/iopopen.c
+===================================================================
+--- glibc-2.36.orig/libio/iopopen.c
++++ glibc-2.36/libio/iopopen.c
+@@ -281,9 +281,10 @@ _IO_new_proc_close (FILE *fp)
+   do
+     {
+       int state;
+-      __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
++      __libc_ptf_call (__pthread_setcancelstate,
++		       (PTHREAD_CANCEL_DISABLE, &state), 0);
+       wait_pid = __waitpid (((_IO_proc_file *) fp)->pid, &wstatus, 0);
+-      __pthread_setcancelstate (state, NULL);
++      __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
+     }
+   while (wait_pid == -1 && errno == EINTR);
+   if (wait_pid == -1)
+Index: glibc-2.36/stdlib/fmtmsg.c
+===================================================================
+--- glibc-2.36.orig/stdlib/fmtmsg.c
++++ glibc-2.36/stdlib/fmtmsg.c
+@@ -124,7 +124,8 @@ fmtmsg (long int classification, const c
+   /* We do not want this call to be cut short by a thread
+      cancellation.  Therefore disable cancellation for now.  */
+   int state = PTHREAD_CANCEL_ENABLE;
+-  __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
++  __libc_ptf_call (__pthread_setcancelstate,
++		   (PTHREAD_CANCEL_DISABLE, &state), 0);
+ 
+   __libc_lock_lock (lock);
+ 
+@@ -193,7 +194,7 @@ fmtmsg (long int classification, const c
+ 
+   __libc_lock_unlock (lock);
+ 
+-  __pthread_setcancelstate (state, NULL);
++  __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
+ 
+   return result;
+ }
diff --git a/gnu/packages/patches/glibc-hurd64-fault.patch b/gnu/packages/patches/glibc-hurd64-fault.patch
new file mode 100644
index 0000000000..24980e8c2a
--- /dev/null
+++ b/gnu/packages/patches/glibc-hurd64-fault.patch
@@ -0,0 +1,32 @@
+Upstream-status: Taken from: <https://salsa.debian.org/glibc-team/glibc/-/blob/c36c87acb1a35d6e06db6cef1e28cf2f405e1a9e/debian/patches/hurd-i386/git-fault-64bit.diff>.
+
+See <https://lists.gnu.org/archive/html/bug-hurd/2024-11/msg00115.html>.
+
+commit 11ad033e1c09c8b8e7bbaa72420f41ab8bcf0f63
+Author: Flavio Cruz <flaviocruz@gmail.com>
+Date:   Tue Jul 30 00:51:20 2024 -0400
+
+    x86_64 hurd: ensure we have a large enough buffer to receive exception_raise requests.
+    
+    Message-ID: <gtxd6s4s7fi7hdrlb7zayq3akij7x6jqawwq3zfl3v4nqspulo@euucuzeonrl6>
+
+diff --git a/hurd/hurdfault.c b/hurd/hurdfault.c
+index 5110c6030f..1fe973f54d 100644
+--- a/hurd/hurdfault.c
++++ b/hurd/hurdfault.c
+@@ -121,7 +121,14 @@ faulted (void)
+   struct
+     {
+       mach_msg_header_t head;
+-      char buf[64];
++        /* This is the size of the exception_raise request
++         * including mach_msg_header_t.
++         * See generated code in faultexc_server.c.  */
++#ifdef __LP64__
++        char buf[112];
++#else
++        char buf[64];
++#endif
+     } request;
+   mig_reply_header_t reply;
+   extern int _hurdsig_fault_exc_server (mach_msg_header_t *,
diff --git a/gnu/packages/patches/glibc-hurd64-intr-msg-clobber.patch b/gnu/packages/patches/glibc-hurd64-intr-msg-clobber.patch
new file mode 100644
index 0000000000..600f89a711
--- /dev/null
+++ b/gnu/packages/patches/glibc-hurd64-intr-msg-clobber.patch
@@ -0,0 +1,62 @@
+Upstream-status: Taken from <https://salsa.debian.org/glibc-team/glibc/-/blob/c36c87acb1a35d6e06db6cef1e28cf2f405e1a9e/debian/patches/hurd-i386/git-intr-msg-clobber.diff>.
+
+See <https://lists.gnu.org/archive/html/bug-hurd/2024-11/msg00115.html>,
+and <https://lists.debian.org/debian-hurd/2024/07/msg00063.html>.
+
+Commited for 2.40
+
+commit c8b4ce0b368115714bd4cce131e1683759471099
+Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date:   Sat Jul 13 17:00:55 2024 +0200
+
+    hurd: Fix restoring message to be retried
+    
+    save_data stores the start of the original message to be retried,
+    overwritten by the EINTR reply. In 64b builds the overwrite is however
+    rounded up to the 64b pointer size, so we have to save more than just
+    the 32b err.
+    
+    Thanks a lot to Luca Dariz for the investigation!
+
+diff --git a/hurd/intr-msg.c b/hurd/intr-msg.c
+index 2c2e7dc463..424c1fc700 100644
+--- a/hurd/intr-msg.c
++++ b/hurd/intr-msg.c
+@@ -42,7 +42,10 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
+   struct clobber
+   {
+     mach_msg_type_t type;
+-    error_t err;
++    union {
++      error_t err;
++      uintptr_t align;
++    };
+   };
+   union msg
+   {
+
+Taken from: <https://salsa.debian.org/glibc-team/glibc/-/blob/027f94215a633cbf53794d4b48675fde36706e35/debian/patches/hurd-i386/local-intr-msg-clobber.diff>
+
+Force putting save_data on the stack rather than in SSE register
+
+The signal management does not yet properly save SSE state, so that save_data
+would get overwritten by signal handlers, notably leading to `` shell
+replacement getting empty content because then the io_read RPC retry gets an
+MIG_BAD_ARGUMENTS error.
+
+XXX: This is only temporary to fix the common shll replacement issue, and is
+waiting for proper SSE state restoration.
+
+Index: glibc-2.38/hurd/intr-msg.c
+===================================================================
+--- glibc-2.38.orig/hurd/intr-msg.c
++++ glibc-2.38/hurd/intr-msg.c
+@@ -79,7 +79,7 @@ _hurd_intr_rpc_mach_msg (mach_msg_header
+   mach_msg_bits_t msgh_bits;
+   mach_port_t remote_port;
+   mach_msg_id_t msgid;
+-  struct clobber save_data;
++  volatile struct clobber save_data;
+ 
+   if ((option & (MACH_SEND_MSG|MACH_RCV_MSG)) != (MACH_SEND_MSG|MACH_RCV_MSG)
+       || _hurd_msgport_thread == MACH_PORT_NULL)
diff --git a/gnu/packages/patches/glibc-hurd64-sgms-context.patch b/gnu/packages/patches/glibc-hurd64-sgms-context.patch
new file mode 100644
index 0000000000..7ae45542c1
--- /dev/null
+++ b/gnu/packages/patches/glibc-hurd64-sgms-context.patch
@@ -0,0 +1,505 @@
+Upstream-status: Taken from <https://salsa.debian.org/glibc-team/glibc/-/blob/62c59900cfdf6b9af187f4ae03addcd7cd226bfc/debian/patches/hurd-i386/git-context.diff>.
+
+commit 88b771ab5e1169e746dbf4a990d90cffc5fa54ea
+Author: Flavio Cruz <flaviocruz@gmail.com>
+Date:   Sat Feb 17 15:25:35 2024 -0500
+
+    Implement setcontext/getcontext/makecontext/swapcontext for Hurd x86_64
+    
+    Tested with the tests provided by glibc plus some other toy examples.
+    Message-ID: <20240217202535.1860803-1-flaviocruz@gmail.com>
+
+diff --git a/sysdeps/mach/hurd/x86_64/Makefile b/sysdeps/mach/hurd/x86_64/Makefile
+index 80cf2eb6dc..2b43f5d625 100644
+--- a/sysdeps/mach/hurd/x86_64/Makefile
++++ b/sysdeps/mach/hurd/x86_64/Makefile
+@@ -3,3 +3,7 @@ ifeq ($(subdir),conform)
+ # (missing SA_NOCLDWAIT)
+ conformtest-xfail-conds += x86_64-gnu
+ endif
++
++ifeq ($(subdir),stdlib)
++sysdep_routines += __start_context
++endif
+diff --git a/sysdeps/mach/hurd/x86_64/__start_context.S b/sysdeps/mach/hurd/x86_64/__start_context.S
+new file mode 100644
+index 0000000000..3cb4c6b5a9
+--- /dev/null
++++ b/sysdeps/mach/hurd/x86_64/__start_context.S
+@@ -0,0 +1,49 @@
++/* Copyright (C) 2024 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sysdep.h>
++
++/* This is the helper code which gets called if a function which is
++   registered with 'makecontext' returns.  In this case we have to
++   install the context listed in the uc_link element of the context
++   'makecontext' manipulated at the time of the 'makecontext' call.
++   If the pointer is NULL the process must terminate.  */
++
++
++ENTRY(__start_context)
++	/* This removes the parameters passed to the function given to
++	   'makecontext' from the stack.  RBX contains the address
++	   on the stack pointer for the next context.  */
++	movq	%rbx, %rsp
++
++	/* Don't use pop here so that stack is aligned to 16 bytes.  */
++	movq	(%rsp), %rdi		/* This is the next context.  */
++	testq	%rdi, %rdi
++	je	2f			/* If it is zero exit.  */
++
++	call	__setcontext
++	/* If this returns (which can happen if __sigprocmask fails) we'll
++	   exit the program with the return error value (-1).  */
++	movq	%rax,%rdi
++
++2:
++	call	HIDDEN_JUMPTARGET(exit)
++	/* The 'exit' call should never return.  In case it does cause
++	   the process to terminate.  */
++L(hlt):
++	hlt
++END(__start_context)
+diff --git a/sysdeps/mach/hurd/x86_64/getcontext.S b/sysdeps/mach/hurd/x86_64/getcontext.S
+new file mode 100644
+index 0000000000..ef431be1a3
+--- /dev/null
++++ b/sysdeps/mach/hurd/x86_64/getcontext.S
+@@ -0,0 +1,68 @@
++/* Save current context.
++   Copyright (C) 2024 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sysdep.h>
++
++#include "ucontext_i.h"
++
++
++ENTRY(__getcontext)
++	/* Save the preserved registers, the registers used for passing
++	   args, and the return address.  */
++	movq	%rbx, oRBX(%rdi)
++	movq	%rbp, oRBP(%rdi)
++	movq	%r12, oR12(%rdi)
++	movq	%r13, oR13(%rdi)
++	movq	%r14, oR14(%rdi)
++	movq	%r15, oR15(%rdi)
++
++	movq	%rdi, oRDI(%rdi)
++	movq	%rsi, oRSI(%rdi)
++	movq	%rdx, oRDX(%rdi)
++	movq	%rcx, oRCX(%rdi)
++	movq	%r8, oR8(%rdi)
++	movq	%r9, oR9(%rdi)
++
++	movq	(%rsp), %rcx
++	movq	%rcx, oRIP(%rdi)
++	leaq	8(%rsp), %rcx		/* Exclude the return address.  */
++	movq	%rcx, oRSP(%rdi)
++
++	/* We have separate floating-point register content memory on the
++	   stack.  We use the __fpregs_mem block in the context.  Set the
++	   links up correctly.  */
++
++	leaq	oFPREGSMEM(%rdi), %rcx
++	movq	%rcx, oFPREGS(%rdi)
++	/* Save the floating-point environment.  */
++	fnstenv	(%rcx)
++	fldenv	(%rcx)
++	stmxcsr oMXCSR(%rdi)
++
++	/* Save the current signal mask with
++	 * __sigprocmask(SIG_BLOCK, NULL, oSIGMASK(%rdi)); */
++	leaq	oSIGMASK(%rdi), %rdx
++	movq $0, %rsi
++	movl $SIG_BLOCK, %edi
++	call	HIDDEN_JUMPTARGET (__sigprocmask)
++
++	/* Propagate %rax (and errno, in case).  */
++	ret
++PSEUDO_END(__getcontext)
++
++weak_alias (__getcontext, getcontext)
+diff --git a/sysdeps/mach/hurd/x86_64/makecontext.c b/sysdeps/mach/hurd/x86_64/makecontext.c
+new file mode 100644
+index 0000000000..6990a7775c
+--- /dev/null
++++ b/sysdeps/mach/hurd/x86_64/makecontext.c
+@@ -0,0 +1,119 @@
++/* Create new context.
++   Copyright (C) 2024 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sysdep.h>
++#include <stdarg.h>
++#include <stdint.h>
++#include <ucontext.h>
++
++#include "ucontext_i.h"
++
++/* This implementation can handle any ARGC value but only
++   normal integer parameters.
++   makecontext sets up a stack and the registers for the
++   user context. The stack looks like this:
++               +-----------------------+
++               | next context          |
++               +-----------------------+
++               | parameter 7-n         |
++	       +-----------------------+
++	       | trampoline address    |
++    %rsp ->    +-----------------------+
++
++   The registers are set up like this:
++     %rdi,%rsi,%rdx,%rcx,%r8,%r9: parameter 1 to 6
++     %rbx   : address of next context
++     %rsp   : stack pointer.
++*/
++
++/* XXX: This implementation currently only handles integer arguments.
++   To handle long int and pointer arguments the va_arg arguments needs
++   to be changed to long and also the stdlib/tst-setcontext.c file needs
++   to be changed to pass long arguments to makecontext.  */
++
++
++void
++__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
++{
++  extern void __start_context (void) attribute_hidden;
++  greg_t *sp;
++  unsigned int idx_uc_link;
++  va_list ap;
++  int i;
++
++  /* Generate room on stack for parameter if needed and uc_link.  */
++  sp = (greg_t *) ((uintptr_t) ucp->uc_stack.ss_sp
++		   + ucp->uc_stack.ss_size);
++  sp -= (argc > 6 ? argc - 6 : 0) + 1;
++  /* Align stack and make space for trampoline address.  */
++  sp = (greg_t *) ((((uintptr_t) sp) & -16L) - 8);
++
++  idx_uc_link = (argc > 6 ? argc - 6 : 0) + 1;
++
++  /* Setup context ucp.  */
++  /* Address to jump to.  */
++  ucp->uc_mcontext.gregs[REG_RIP] = (uintptr_t) func;
++  /* Setup rbx.*/
++  ucp->uc_mcontext.gregs[REG_RBX] = (uintptr_t) &sp[idx_uc_link];
++  ucp->uc_mcontext.gregs[REG_RSP] = (uintptr_t) sp;
++
++  /* Setup stack.  */
++  sp[0] = (uintptr_t) &__start_context;
++  sp[idx_uc_link] = (uintptr_t) ucp->uc_link;
++
++  va_start (ap, argc);
++  /* Handle arguments.
++
++     The standard says the parameters must all be int values.  This is
++     an historic accident and would be done differently today.  For
++     x86-64 all integer values are passed as 64-bit values and
++     therefore extending the API to copy 64-bit values instead of
++     32-bit ints makes sense.  It does not break existing
++     functionality and it does not violate the standard which says
++     that passing non-int values means undefined behavior.  */
++  for (i = 0; i < argc; ++i)
++    switch (i)
++      {
++      case 0:
++	ucp->uc_mcontext.gregs[REG_RDI] = va_arg (ap, greg_t);
++	break;
++      case 1:
++	ucp->uc_mcontext.gregs[REG_RSI] = va_arg (ap, greg_t);
++	break;
++      case 2:
++	ucp->uc_mcontext.gregs[REG_RDX] = va_arg (ap, greg_t);
++	break;
++      case 3:
++	ucp->uc_mcontext.gregs[REG_RCX] = va_arg (ap, greg_t);
++	break;
++      case 4:
++	ucp->uc_mcontext.gregs[REG_R8] = va_arg (ap, greg_t);
++	break;
++      case 5:
++	ucp->uc_mcontext.gregs[REG_R9] = va_arg (ap, greg_t);
++	break;
++      default:
++	/* Put value on stack.  */
++	sp[i - 5] = va_arg (ap, greg_t);
++	break;
++      }
++  va_end (ap);
++}
++
++
++weak_alias (__makecontext, makecontext)
+diff --git a/sysdeps/mach/hurd/x86_64/setcontext.S b/sysdeps/mach/hurd/x86_64/setcontext.S
+new file mode 100644
+index 0000000000..99919ee2a8
+--- /dev/null
++++ b/sysdeps/mach/hurd/x86_64/setcontext.S
+@@ -0,0 +1,96 @@
++/* Install given context.
++   Copyright (C) 2024 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sysdep.h>
++
++#include "ucontext_i.h"
++
++
++ENTRY(__setcontext)
++	/* Save argument since call will destroy it.  */
++	pushq	%rdi
++	cfi_adjust_cfa_offset(8)
++
++	/* Set the signal mask with
++	   __sigprocmask (SIG_SETMASK, mask, NULL).  */
++	xorl	%edx, %edx
++	leaq	oSIGMASK(%rdi), %rsi
++	movl	$SIG_SETMASK, %edi
++	call	HIDDEN_JUMPTARGET (__sigprocmask)
++	/* Pop the pointer into RDX. The choice is arbitrary, but
++	   leaving RDI and RSI available for use later can avoid
++	   shuffling values.  */
++	popq	%rdx
++
++	test	%rax, %rax
++	jne	L(pseudo_end)
++
++	/* Restore the floating-point context.  Not the registers, only the
++	   rest.  */
++	movq	oFPREGS(%rdx), %rcx
++	fldenv	(%rcx)
++	ldmxcsr oMXCSR(%rdx)
++
++	/* Load the new stack pointer, the preserved registers and
++	   registers used for passing args.  */
++	cfi_def_cfa(%rdx, 0)
++	cfi_offset(%rbx,oRBX)
++	cfi_offset(%rbp,oRBP)
++	cfi_offset(%r12,oR12)
++	cfi_offset(%r13,oR13)
++	cfi_offset(%r14,oR14)
++	cfi_offset(%r15,oR15)
++	cfi_offset(%rsp,oRSP)
++	cfi_offset(%rip,oRIP)
++
++	movq	oRSP(%rdx), %rsp
++	movq	oRBX(%rdx), %rbx
++	movq	oRBP(%rdx), %rbp
++	movq	oR12(%rdx), %r12
++	movq	oR13(%rdx), %r13
++	movq	oR14(%rdx), %r14
++	movq	oR15(%rdx), %r15
++
++	/* The following ret should return to the address set with
++	getcontext.  Therefore push the address on the stack.  */
++	movq	oRIP(%rdx), %rcx
++	pushq	%rcx
++
++	movq	oRSI(%rdx), %rsi
++	movq	oRDI(%rdx), %rdi
++	movq	oRCX(%rdx), %rcx
++	movq	oR8(%rdx), %r8
++	movq	oR9(%rdx), %r9
++
++	/* Setup finally %rdx.  */
++	movq	oRDX(%rdx), %rdx
++
++	/* End FDE here, we fall into another context.  */
++	cfi_endproc
++	cfi_startproc
++
++	/* Clear rax to indicate success.  */
++	xorl	%eax, %eax
++L(pseudo_end):
++	/* The following 'ret' will pop the address of the code and jump
++	   to it.  */
++	ret
++PSEUDO_END(__setcontext)
++libc_hidden_def (__setcontext)
++
++weak_alias (__setcontext, setcontext)
+diff --git a/sysdeps/mach/hurd/x86_64/swapcontext.S b/sysdeps/mach/hurd/x86_64/swapcontext.S
+new file mode 100644
+index 0000000000..79718a1fdd
+--- /dev/null
++++ b/sysdeps/mach/hurd/x86_64/swapcontext.S
+@@ -0,0 +1,120 @@
++/* Save current context and install the given one.
++   Copyright (C) 2024 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <sysdep.h>
++
++#include "ucontext_i.h"
++
++
++/* int __swapcontext (ucontext_t *oucp, const ucontext_t *ucp);
++
++  Saves the machine context in oucp such that when it is activated,
++  it appears as if __swapcontextt() returned again, restores the
++  machine context in ucp and thereby resumes execution in that
++  context.
++
++  This implementation is intended to be used for *synchronous* context
++  switches only.  Therefore, it does not have to save anything
++  other than the PRESERVED state.  */
++
++ENTRY(__swapcontext)
++	/* Save the preserved registers, the registers used for passing args,
++	   and the return address.  */
++	movq	%rbx, oRBX(%rdi)
++	movq	%rbp, oRBP(%rdi)
++	movq	%r12, oR12(%rdi)
++	movq	%r13, oR13(%rdi)
++	movq	%r14, oR14(%rdi)
++	movq	%r15, oR15(%rdi)
++
++	movq	%rdi, oRDI(%rdi)
++	movq	%rsi, oRSI(%rdi)
++	movq	%rdx, oRDX(%rdi)
++	movq	%rcx, oRCX(%rdi)
++	movq	%r8, oR8(%rdi)
++	movq	%r9, oR9(%rdi)
++
++	movq	(%rsp), %rcx
++	movq	%rcx, oRIP(%rdi)
++	leaq	8(%rsp), %rcx		/* Exclude the return address.  */
++	movq	%rcx, oRSP(%rdi)
++
++	/* We have separate floating-point register content memory on the
++	   stack.  We use the __fpregs_mem block in the context.  Set the
++	   links up correctly.  */
++	leaq	oFPREGSMEM(%rdi), %rcx
++	movq	%rcx, oFPREGS(%rdi)
++	/* Save the floating-point environment.  */
++	fnstenv	(%rcx)
++	stmxcsr oMXCSR(%rdi)
++
++
++	/* The function call destroys some registers, save ucp.  */
++	movq	%rsi, %r12
++
++	/* Save the current signal mask and install the new one with
++	   __sigprocmask (SIG_BLOCK, newset, oldset).  */
++	leaq	oSIGMASK(%rdi), %rdx
++	leaq	oSIGMASK(%rsi), %rsi
++	movl	$SIG_SETMASK, %edi
++	call	HIDDEN_JUMPTARGET (__sigprocmask)
++	test	%rax, %rax
++	jne	L(pseudo_end)
++
++	/* Restore destroyed register into RDX. The choice is arbitrary,
++	   but leaving RDI and RSI available for use later can avoid
++	   shuffling values.  */
++	movq	%r12, %rdx
++
++	/* Restore the floating-point context.  Not the registers, only the
++	   rest.  */
++	movq	oFPREGS(%rdx), %rcx
++	fldenv	(%rcx)
++	ldmxcsr oMXCSR(%rdx)
++
++	/* Load the new stack pointer and the preserved registers.  */
++	movq	oRSP(%rdx), %rsp
++	movq	oRBX(%rdx), %rbx
++	movq	oRBP(%rdx), %rbp
++	movq	oR12(%rdx), %r12
++	movq	oR13(%rdx), %r13
++	movq	oR14(%rdx), %r14
++	movq	oR15(%rdx), %r15
++
++	/* The following ret should return to the address set with
++	getcontext.  Therefore push the address on the stack.  */
++	movq	oRIP(%rdx), %rcx
++	pushq	%rcx
++
++	/* Setup registers used for passing args.  */
++	movq	oRDI(%rdx), %rdi
++	movq	oRSI(%rdx), %rsi
++	movq	oRCX(%rdx), %rcx
++	movq	oR8(%rdx), %r8
++	movq	oR9(%rdx), %r9
++
++	/* Setup finally %rdx.  */
++	movq	oRDX(%rdx), %rdx
++
++	/* Clear rax to indicate success.  */
++	xorl	%eax, %eax
++L(pseudo_end):
++	ret
++PSEUDO_END(__swapcontext)
++
++weak_alias (__swapcontext, swapcontext)
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 13/58] gnu: bash: Avoid hang when cross-built for the Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (11 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 12/58] gnu: glibc/hurd: Add patches for " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 14/58] gnu: git-minimal: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
                     ` (44 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

For example, without this patch bash hangs while configuring diffutils.
Reproducer:

cat >x.awk <<EOF
x... repeat 16384 (the actual pipe size) times
EOF

* gnu/packages/bash.scm (bash): When cross-building for the Hurd, add new
"create-pipesize.h" stage.

Change-Id: I02c1dcf2d63849626ba3448cd52766db822dc77c
---
 gnu/packages/bash.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index 56918d79bd..642a405985 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -175,6 +175,20 @@ (define-public bash
 
         #:phases
         (modify-phases %standard-phases
+          ,@(if (and (target-hurd?) (not (system-hurd?)))
+                `((add-after 'configure 'create-pipesize.h
+                    ;; The Bash Makefile mentions how PIPESIZE calculation is
+                    ;; "technically wrong" when cross-compiling, and offers no
+                    ;; way to override it.  On the 64bit Hurd, it can make
+                    ;; bash hang.
+                    (lambda _
+                      (with-directory-excursion "builtins"
+                        (with-output-to-file "psize.aux"
+                          (lambda _ (display "dummy to pacify make\n")))
+                        (with-output-to-file "pipesize.h"
+                          (lambda _ (display "#define PIPESIZE 16384\n")))))))
+                '())
+
           (add-after 'install 'install-sh-symlink
             (lambda* (#:key outputs #:allow-other-keys)
               ;; Add a `sh' -> `bash' link.
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 14/58] gnu: git-minimal: Support [cross-]build with gcc-14 and the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (12 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 13/58] gnu: bash: Avoid hang when cross-built for the Hurd Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 15/58] gnu: flex: Fix [cross-]build with gcc-14 Janneke Nieuwenhuizen
                     ` (43 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/version-control.scm (git-minimal)[arguments]: When building for
the 64bit Hurd, or cross-compiling, use "-Wno-implicit-function-declaration"
in #:make-flags.  Use target-hurd? instead of comparing with "i586-pc-gnu" in
"use-host-uname_S" phase.

Change-Id: Ib9836be8a1e389a82c8a89adf22aaeac0d85bd14
---
 gnu/packages/version-control.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index c892a83a98..ca77b485ad 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -296,7 +296,10 @@ (define-public git-minimal
               ;; By default 'make install' creates hard links for
               ;; things in 'libexec/git-core', which leads to huge
               ;; nars; see <https://bugs.gnu.org/21949>.
-              "NO_INSTALL_HARDLINKS=indeed")
+              "NO_INSTALL_HARDLINKS=indeed"
+              #$@(if (or (target-hurd64?) (%current-target-system))
+                     #~("-Wno-implicit-function-declaration")
+                     #~()))
       #:phases
       #~(modify-phases %standard-phases
           #$@(if (%current-target-system)
@@ -305,7 +308,7 @@ (define-public git-minimal
                       (lambda _
                         (substitute* "config.mak.uname"
                           (("uname_S := .*" all)
-                           (if (equal? #$(%current-target-system) "i586-pc-gnu")
+                           (if #$(target-hurd?)
                                "uname_S := GNU\n"
                                all))))))
                  ;; We do not have a full bash when cross-compiling.
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 15/58] gnu: flex: Fix [cross-]build with gcc-14.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (13 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 14/58] gnu: git-minimal: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 16/58] gnu: libffi: " Janneke Nieuwenhuizen
                     ` (42 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/flex.scm (flex): When building for the 64bit Hurd, or
cross-compiling, add "-Wno-int-conversion "-Wno-implicit-function-declaration"
to #:configure-flags.

Change-Id: Ia0503e3f5c7aa5354a949b69035a1be6f93ec85f
---
 gnu/packages/flex.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/flex.scm b/gnu/packages/flex.scm
index 7972675971..4ad1e1382a 100644
--- a/gnu/packages/flex.scm
+++ b/gnu/packages/flex.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,6 +23,7 @@ (define-module (gnu packages flex)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix gexp)
   #:use-module (guix utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages m4)
@@ -53,6 +55,12 @@ (define-public flex
                  ((#:tests? _ #f) #f)))
               (inputs (alist-delete "flex" (package-inputs bison))))))
        `(("bison" ,bison-for-tests))))
+    (arguments
+     (if (or (target-hurd64?) (%current-target-system))
+         (list #:configure-flags
+               #~'(#$(string-append "CFLAGS=-Wno-int-conversion"
+                                    " -Wno-implicit-function-declaration")))
+         '()))
     ;; m4 is not present in PATH when cross-building
     (native-inputs
      (list help2man m4))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 16/58] gnu: libffi: Fix [cross-]build with gcc-14.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (14 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 15/58] gnu: flex: Fix [cross-]build with gcc-14 Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 17/58] gnu: perl: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
                     ` (41 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/libffi.scm (libffi)[arguments]: When building for the 64bit
Hurd, or cross-building, add "CFLAGS" to #:configure-flags to disable breaking
warning.

Change-Id: I05bf3f460f3e292626de1894b7a3cf381cb07702
---
 gnu/packages/libffi.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm
index ba3fc6bc79..62be8f0c4a 100644
--- a/gnu/packages/libffi.scm
+++ b/gnu/packages/libffi.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2020 John Doe <dftxbs3e@free.fr>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -60,7 +61,12 @@ (define-public libffi
      `(;; Prevent the build system from passing -march and -mtune to the
        ;; compiler.  See "ax_cc_maxopt.m4" and "ax_gcc_archflag.m4".
        #:configure-flags '("--enable-portable-binary"
-                           "--without-gcc-arch")))
+                           "--without-gcc-arch"
+                           ,@(if (or (target-hurd64?) (%current-target-system))
+                                 (list (string-append
+                                        "CFLAGS=-g -O2"
+                                        " -Wno-implicit-function-declaration"))
+                                 '()))))
     (outputs '("out" "debug"))
     (synopsis "Foreign function call interface library")
     (description
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 17/58] gnu: perl: Support [cross-]build with gcc-14 and the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (15 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 16/58] gnu: libffi: " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 18/58] gnu: texinfo-4: Fix " Janneke Nieuwenhuizen
                     ` (40 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/cross-base.scm (perl)[native-inputs]: Update perl-cross to 1.6.

Change-Id: I4a77f51a6757ad4aed9bcca8f9bbbf2cbd162e15
---
 gnu/packages/perl.scm | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index faaac13bf1..3941ad4831 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -248,14 +248,16 @@ (define-public perl
     (native-inputs
      (if (%current-target-system)
          `(("perl-cross"
-            ,(origin
-               (method git-fetch)
-               (uri (git-reference
-                     (url "https://github.com/arsv/perl-cross")
-                     (commit "1.4")))
-               (file-name (git-file-name "perl-cross" "1.4"))
-               (sha256
-                (base32 "1ydjvlhrk06ccyj4bm8by7xk90krsll2k380mc3x1mhfrc7r9gzy")))))
+            ,(let ((version "1.6"))
+               (origin
+                 (method git-fetch)
+                 (uri (git-reference
+                       (url "https://github.com/arsv/perl-cross")
+                       (commit version)))
+                 (file-name (git-file-name "perl-cross" version))
+                 (sha256
+                  (base32
+                   "0s06lkx5b79r9cn6pm5p6d4jbdjq7wg7rjr75nw5xdhw1z3wnl2d"))))))
          '()))
     (native-search-paths (list (search-path-specification
                                 (variable "PERL5LIB")
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 18/58] gnu: texinfo-4: Fix [cross-]build with gcc-14 and the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (16 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 17/58] gnu: perl: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 19/58] gnu: hurd: Fix build with gcc-14 Janneke Nieuwenhuizen
                     ` (39 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/texinfo.scm (texinfo-4): When building for the 64bit Hurd, or
cross-compiling, add "-Wno-incompatible-pointer-types" to #:configure-flags.

Change-Id: Ia0503e3f5c7aa5354a949b69035a1be6f93ec85f
---
 gnu/packages/texinfo.scm | 50 ++++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/texinfo.scm b/gnu/packages/texinfo.scm
index 98429cb059..13c780897e 100644
--- a/gnu/packages/texinfo.scm
+++ b/gnu/packages/texinfo.scm
@@ -7,7 +7,7 @@
 ;;; Copyright © 2019 Pierre-Moana Levesque <pierre.moana.levesque@gmail.com>
 ;;; Copyright © 2019, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2022 ( <paren@disroot.org>
 ;;;
@@ -169,31 +169,35 @@ (define-public texinfo-4
       (modify-inputs (package-native-inputs texinfo)
         (prepend automake)))
     (arguments
-     (substitute-keyword-arguments (package-arguments texinfo)
-       ((#:phases phases)
-        `(modify-phases ,phases
-           (add-after 'unpack 'fix-configure
-             (lambda* (#:key inputs native-inputs #:allow-other-keys)
-               ;; Replace outdated config.sub and config.guess.
-               (with-directory-excursion "build-aux"
-                 (for-each
-                  (lambda (file)
-                    (install-file (string-append
-                                   (assoc-ref
-                                    (or native-inputs inputs) "automake")
-                                   "/share/automake-"
-                                   ,(version-major+minor
-                                     (package-version automake))
-                                   "/" file) "."))
-                  '("config.sub" "config.guess")))
-               #t))
-           ;; Build native version of tools before running 'build phase.
-           ,@(if (%current-target-system)
-                 `((add-before 'build 'make-native-gnu-lib
+     (append
+      (substitute-keyword-arguments (package-arguments texinfo)
+        ((#:phases phases)
+         `(modify-phases ,phases
+            (add-after 'unpack 'fix-configure
+              (lambda* (#:key inputs native-inputs #:allow-other-keys)
+                ;; Replace outdated config.sub and config.guess.
+                (with-directory-excursion "build-aux"
+                  (for-each
+                   (lambda (file)
+                     (install-file (string-append
+                                    (assoc-ref
+                                     (or native-inputs inputs) "automake")
+                                    "/share/automake-"
+                                    ,(version-major+minor
+                                      (package-version automake))
+                                    "/" file) "."))
+                   '("config.sub" "config.guess")))
+                #t))
+            ;; Build native version of tools before running 'build phase.
+            ,@(if (%current-target-system)
+                  `((add-before 'build 'make-native-gnu-lib
                       (lambda* (#:key inputs #:allow-other-keys)
                         (invoke "make" "-C" "tools/gnulib/lib")
                         #t)))
-                 '())))))))
+                  '()))))
+      (if (or (target-hurd64?) (%current-target-system))
+          (list #:configure-flags ''("CFLAGS=-Wno-incompatible-pointer-types"))
+          '())))))
 
 (define-public info-reader
   ;; The idea of this package is to have the standalone Info reader without
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 19/58] gnu: hurd: Fix build with gcc-14.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (17 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 18/58] gnu: texinfo-4: Fix " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 20/58] gnu: netdde: " Janneke Nieuwenhuizen
                     ` (38 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (hurd)[arguments]: In phase "build-libdde-linux",
disable some warnings breaking the build, using "WARNINGS=...".

Change-Id: Ib70926a90e1d37080c5b9dd333f19636cdae3013
---
 gnu/packages/hurd.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 06fae1bd3b..5a60d8ac13 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -478,6 +478,12 @@ (define-public hurd
                                     "/bin/bash")
                      (string-append "CC="
                                     ,(cc-for-target))
+                     (string-append "WARNINGS="
+                                    " -Wno-declaration-missing-parameter-type"
+                                    " -Wno-implicit-function-declaration"
+                                    " -Wno-implicit-int"
+                                    " -Wno-int-conversion"
+                                    " -Wno-strict-prototypes")
                      "ARCH=x86")))
          (add-after 'install 'install-goodies
            (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 20/58] gnu: netdde: Fix build with gcc-14.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (18 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 19/58] gnu: hurd: Fix build with gcc-14 Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 21/58] gnu: libedit: Fix [cross-]build with gcc-14 for 32bit Janneke Nieuwenhuizen
                     ` (37 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (netdde)[arguments]: Disable some warnings breaking
the build, using "WARNINGS=..." in #:make-flags.

Change-Id: I39f577c51eaa3d86abf80a54f7c172324cf56749
---
 gnu/packages/hurd.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 5a60d8ac13..5fdb6359d1 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -592,6 +592,12 @@ (define-public netdde
                               (search-input-file %build-inputs "/bin/bash"))
                "PKGDIR=libdde_linux26"
                (string-append "CC=" ,(cc-for-target))
+               (string-append "WARNINGS="
+                              " -Wno-declaration-missing-parameter-type"
+                              " -Wno-implicit-function-declaration"
+                              " -Wno-implicit-int"
+                              " -Wno-int-conversion"
+                              " -Wno-strict-prototypes")
                "ARCH=x86")
          #:configure-flags
          ,#~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 21/58] gnu: libedit: Fix [cross-]build with gcc-14 for 32bit.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (19 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 20/58] gnu: netdde: " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 22/58] gnu: libssh: " Janneke Nieuwenhuizen
                     ` (36 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/libedit.scm (libedit)[arguments]: When cross-compiling to a
32bit host, add CFLAGS to #:configure-flags to disable a breaking warning.

Change-Id: Ibab7332af162aed38158a50e9b4fc288b4286922
---
 gnu/packages/libedit.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/libedit.scm b/gnu/packages/libedit.scm
index f04d3aafe4..252f8a4966 100644
--- a/gnu/packages/libedit.scm
+++ b/gnu/packages/libedit.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,8 +22,10 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages libedit)
+  #:use-module (guix gexp)
   #:use-module (guix licenses)
   #:use-module (guix packages)
+  #:use-module (guix utils)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages ncurses))
@@ -39,6 +42,11 @@ (define-public libedit
       (sha256
        (base32 "0wch48nml28jj6ild889745dsg2agm7mpvrmbl1gi98nw6vjrf6v"))))
     (build-system gnu-build-system)
+    (arguments
+     (if (and (%current-target-system) (target-x86-32?))
+         (list #:configure-flags
+               #~(list "CFLAGS=-g -O2 -Wno-incompatible-pointer-types"))
+         '()))
     (inputs
      (list ncurses))
     (home-page "https://thrysoee.dk/editline/")
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 22/58] gnu: libssh: Fix [cross-]build with gcc-14 for 32bit.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (20 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 21/58] gnu: libedit: Fix [cross-]build with gcc-14 for 32bit Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 23/58] gnu: guile-lzlib: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
                     ` (35 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/ssh.scm (libssh)[arguments]: When cross-compiling to a
32bit host, add CFLAGS to #:configure-flags to disable a breaking warning.

Change-Id: Ibab7332af162aed38158a50e9b4fc288b4286922
---
 gnu/packages/ssh.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm
index a29a10e954..1f33259246 100644
--- a/gnu/packages/ssh.scm
+++ b/gnu/packages/ssh.scm
@@ -13,7 +13,7 @@
 ;;; Copyright © 2018 Manuel Graf <graf@init.at>
 ;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
 ;;; Copyright © 2019, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
 ;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
@@ -156,7 +156,12 @@ (define-public libssh
     (build-system cmake-build-system)
     (outputs '("out" "debug"))
     (arguments
-     '(#:configure-flags '("-DWITH_GCRYPT=ON")
+     `(#:configure-flags '("-DWITH_GCRYPT=ON"
+                           ,@(if (and (%current-target-system) (target-x86-32?))
+                                 (list (string-append
+                                        "-DCMAKE_C_FLAGS=-g -O2"
+                                        " -Wno-incompatible-pointer-types"))
+                                 '()))
 
        ;; TODO: Add 'CMockery' and '-DWITH_TESTING=ON' for the test suite.
        #:tests? #f))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 23/58] gnu: guile-lzlib: Support [cross-]build with gcc-14 and the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (21 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 22/58] gnu: libssh: " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 24/58] gnu: cross-base: Update %xgcc to gcc-14, to support " Janneke Nieuwenhuizen
                     ` (34 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/patches/guile-lzlib-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/guile.scm (guile-lzlib)[arguments]: Use G-expressions.  When
building for the 64bit Hurd, or cross-compiling, use it in new
"apply-hurd64-patch" stage.

Change-Id: Id03f71baa80e2f4f967f54037ce7d9f1c5dc4bb6
---
 gnu/local.mk                                  |  1 +
 gnu/packages/guile.scm                        | 16 ++++++++--
 gnu/packages/patches/guile-lzlib-hurd64.patch | 32 +++++++++++++++++++
 3 files changed, 46 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/guile-lzlib-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f15272f25c..3df0d4effa 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1515,6 +1515,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/guile-fix-invalid-unicode-handling.patch \
   %D%/packages/patches/guile-gdbm-ffi-support-gdbm-1.14.patch	\
   %D%/packages/patches/guile-hurd-posix-spawn.patch		\
+  %D%/packages/patches/guile-lzlib-hurd64.patch			\
   %D%/packages/patches/guile-present-coding.patch		\
   %D%/packages/patches/guile-rsvg-pkgconfig.patch		\
   %D%/packages/patches/guile-ssh-rename-bool.patch		\
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 8dabbb2c5e..69dff9211f 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -4,7 +4,7 @@
 ;;; Copyright © 2014, 2016, 2018 David Thompson <davet@gnu.org>
 ;;; Copyright © 2014, 2017, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015, 2017 Christine Lemmer-Webber <cwebber@dustycloud.org>
-;;; Copyright © 2016, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2016, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
@@ -962,8 +962,18 @@ (define-public guile-lzlib
          "1whgmwkr1v8m63p4aaqn8blwl9vcrswwhbfv4bm0aghl5a6rryd7"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:make-flags
-       '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings
+     (list
+      #:make-flags #~'("GUILE_AUTO_COMPILE=0") ;prevent guild warnings
+      #:phases (if (or (%current-target-system) (target-hurd64?))
+                   #~(modify-phases %standard-phases
+                       (add-after 'unpack 'apply-hurd64-patch
+                         (lambda _
+                           (let ((patch
+                                  #$(local-file
+                                     (search-patch
+                                      "guile-lzlib-hurd64.patch"))))
+                             (invoke "patch" "--force" "-p1" "-i" patch)))))
+                   #~%standard-phases)))
     (native-inputs (list autoconf automake pkg-config guile-3.0))
     (inputs (list guile-3.0 lzlib))
     (synopsis "Guile bindings to lzlib")
diff --git a/gnu/packages/patches/guile-lzlib-hurd64.patch b/gnu/packages/patches/guile-lzlib-hurd64.patch
new file mode 100644
index 0000000000..12e8c3617d
--- /dev/null
+++ b/gnu/packages/patches/guile-lzlib-hurd64.patch
@@ -0,0 +1,32 @@
+Upstream-status: Presented upstream.
+
+From 80dcd31562827f4b6d085affe9d9f22164f7ed34 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Fri, 15 Nov 2024 16:18:29 +0100
+Subject: [PATCH] build: Support the 64bit Hurd.
+
+* configure.ac: When cross-compiling declare LZ_decompress_open before
+using it in conftest.c.
+---
+ configure.ac | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 50dc5ac..4c56768 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -32,7 +32,10 @@ AC_DEFUN([GUILE_LIBLZ_FILE_NAME], [
+     [if test "$cross_compiling" = yes; then
+        # When cross-compiling, we cannot rely on 'ldd'.  Instead, look
+        # the output of 'ld --verbose', assuming we're using GNU ld.
+-       echo 'int main () { return LZ_decompress_open(); }' > conftest.c
++       cat > conftest.c <<EOF
++int LZ_decompress_open ();
++int main () { return LZ_decompress_open(); }
++EOF
+        guile_cv_liblz_libdir="\
+           `$CC conftest.c -o conftest$EXEEXT -llz -Wl,--verbose 2>/dev/null \
+           | grep -E '^/.*/liblz\.(a|so)'`"
+-- 
+2.46.0
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 24/58] gnu: cross-base: Update %xgcc to gcc-14, to support the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (22 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 23/58] gnu: guile-lzlib: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 25/58] gnu: gcc-14: Force libdir /lib instead of /lib64 for " Janneke Nieuwenhuizen
                     ` (33 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

Gcc-14 adds support for the 64bit Hurd.

* gnu/packages/cross-base.scm (%xgcc): Bump to gcc-14.

Change-Id: Idf7696c50532aa4def2b2d37cdb5c70715125123
---
 gnu/packages/cross-base.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 4961b3b4c0..ad3616eaba 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 gcc-14))
 
 (define %gcc-include-paths
   ;; Environment variables for header search paths.
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 25/58] gnu: gcc-14: Force libdir /lib instead of /lib64 for the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (23 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 24/58] gnu: cross-base: Update %xgcc to gcc-14, to support " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 26/58] gnu: glibc/hurd: Add patch for the 64bit Hurd, fixing "raise" Janneke Nieuwenhuizen
                     ` (32 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/gcc.scm (gcc-14)[arguments]: In stage "pre-x86-configure", also
patch "gcc/config/i386/t-gnu64".

Change-Id: Ib2607c5f315c49696596fdcbcbbcc2895b6a9775
---
 gnu/packages/gcc.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 64ba37fd69..e437bf5826 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -843,7 +843,8 @@ (define-public gcc-14
                   #~(modify-phases #$phases
                       (add-before 'configure 'pre-x86-configure
                         (lambda _
-                          (substitute* "gcc/config/i386/t-linux64"
+                          (substitute* '("gcc/config/i386/t-linux64"
+                                         "gcc/config/i386/t-gnu64")
                             (("\\.\\./lib64") "../lib"))))))))
     (properties
      `((compiler-cpu-architectures
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 26/58] gnu: glibc/hurd: Add patch for the 64bit Hurd, fixing "raise".
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (24 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 25/58] gnu: gcc-14: Force libdir /lib instead of /lib64 for " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 27/58] gnu: make-bootstrap: Update gcc-static to gcc-14, for the 64bit Hurd Janneke Nieuwenhuizen
                     ` (31 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

This fixes findutil's gnulib-tests's test-sigaction's raise call, by working
around an alleged gcc-14.2 optimization bug.  See
<https://lists.gnu.org/archive/html/bug-hurd/2024-11/msg00143.html>.

* gnu/packages/patches/glibc-hurd64-gcc-14.2-tls-bug.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/base.scm (glibc/hurd): Use it.

Change-Id: I11e683f521f34dedeb7f739a2545f5d1d866922a
---
 gnu/local.mk                                  |  1 +
 gnu/packages/base.scm                         |  3 +-
 .../glibc-hurd64-gcc-14.2-tls-bug.patch       | 28 +++++++++++++++++++
 3 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/glibc-hurd64-gcc-14.2-tls-bug.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 3df0d4effa..6164ee45c7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1439,6 +1439,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/glibc-hurd-mach-print.patch		\
   %D%/packages/patches/glibc-hurd-pthread_setcancelstate.patch	\
   %D%/packages/patches/glibc-hurd-signal-sa-siginfo.patch	\
+  %D%/packages/patches/glibc-hurd64-gcc-14.2-tls-bug.patch	\
   %D%/packages/patches/glibc-hurd64-fault.patch			\
   %D%/packages/patches/glibc-hurd64-intr-msg-clobber.patch	\
   %D%/packages/patches/glibc-hurd64-sgms-context.patch		\
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 80e53c2e52..cbce8bd634 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1598,7 +1598,8 @@ (define-public glibc/hurd
                 (search-patches "glibc-hurd-pthread_setcancelstate.patch"
                                 "glibc-hurd64-fault.patch"
                                 "glibc-hurd64-intr-msg-clobber.patch"
-                                "glibc-hurd64-sgms-context.patch")))))))
+                                "glibc-hurd64-sgms-context.patch"
+                                "glibc-hurd64-gcc-14.2-tls-bug.patch")))))))
 
 (define-public glibc/hurd-headers
   (package/inherit glibc/hurd
diff --git a/gnu/packages/patches/glibc-hurd64-gcc-14.2-tls-bug.patch b/gnu/packages/patches/glibc-hurd64-gcc-14.2-tls-bug.patch
new file mode 100644
index 0000000000..5823a230fd
--- /dev/null
+++ b/gnu/packages/patches/glibc-hurd64-gcc-14.2-tls-bug.patch
@@ -0,0 +1,28 @@
+From 0b23ab98d25d880ee602af91e62aa39564510cac Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Fri, 22 Nov 2024 16:26:08 +0100
+Subject: [PATCH] x86_64-hurd: sigreturn: Hack around gcc-14.2 optimization
+ bug.
+
+See: <https://lists.gnu.org/archive/html/bug-hurd/2024-11/msg00143.html>.
+
+* sysdeps/mach/hurd/x86_64/sigreturn.c (__sigreturn2): Add nop.
+---
+ sysdeps/mach/hurd/x86_64/sigreturn.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/sysdeps/mach/hurd/x86_64/sigreturn.c b/sysdeps/mach/hurd/x86_64/sigreturn.c
+index 7a0193497d..256cc1268a 100644
+--- a/sysdeps/mach/hurd/x86_64/sigreturn.c
++++ b/sysdeps/mach/hurd/x86_64/sigreturn.c
+@@ -45,6 +45,7 @@ __sigreturn2 (struct hurd_sigstate *ss, uintptr_t *usp,
+     (void) __mach_port_mod_refs (__mach_task_self (), reply_port,
+                                  MACH_PORT_RIGHT_RECEIVE, -1);
+   THREAD_SETMEM (THREAD_SELF, reply_port, sc_reply_port);
++  asm ("nop"); // See <https://lists.gnu.org/archive/html/bug-hurd/2024-11/msg00143.html>.
+ 
+   asm volatile (
+                 /* Point the stack to the register dump.  */
+-- 
+2.46.0
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 27/58] gnu: make-bootstrap: Update gcc-static to gcc-14, for the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (25 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 26/58] gnu: glibc/hurd: Add patch for the 64bit Hurd, fixing "raise" Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 28/58] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (30 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

* gnu/packages/make-bootstrap.scm (%gcc-static): Use gcc-14.  Update to use
G-Expressions.
[inputs]: Remove libstdc++ and libstdc++-headers.
(%gcc-stripped): Use gcc-14.
[inputs, native-inputs]: Clear fields.

Change-Id: I4e6d779cb457b256d80d1882f182b72a6f7d2be2
---
 gnu/packages/make-bootstrap.scm | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index 689d48d342..e0dcca7b33 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -488,11 +488,11 @@ (define (%glibc-stripped)
 (define %gcc-static
   ;; A statically-linked GCC, with stripped-down functionality.
   (package-with-relocatable-glibc
-   (package (inherit gcc)
+   (package (inherit gcc-14)
      (name "gcc-static")
      (outputs '("out"))                           ; all in one
      (arguments
-      (substitute-keyword-arguments (package-arguments gcc)
+      (substitute-keyword-arguments (package-arguments gcc-14)
         ((#:modules modules %default-gnu-modules)
          `((srfi srfi-1)
            (srfi srfi-26)
@@ -501,7 +501,7 @@ (define %gcc-static
         ((#:guile _) #f)
         ((#:implicit-inputs? _) #t)
         ((#:configure-flags flags)
-         `(append (list
+         #~(append (list
                    ;; We don't need a full bootstrap here.
                    "--disable-bootstrap"
 
@@ -526,9 +526,9 @@ (define %gcc-static
                    "--disable-libssp"
                    "--disable-libquadmath")
                   (remove (cut string-match "--(.*plugin|enable-languages)" <>)
-                          ,flags)))
+                          #$flags)))
         ((#:phases phases)
-         `(modify-phases ,phases
+         #~(modify-phases #$phases
             (add-after 'pre-configure 'remove-lgcc_s
               (lambda _
                 ;; Remove the '-lgcc_s' added to GNU_USER_TARGET_LIB_SPEC in
@@ -538,12 +538,12 @@ (define %gcc-static
                 (substitute* (cons "gcc/config/rs6000/sysv4.h"
                                    (find-files "gcc/config"
                                                "^gnu-user.*\\.h$"))
-                  ((" -lgcc_s}}") "}}"))
-                #t))))))
+                  ((" -lgcc_s}}") "}}"))))))))
      (inputs
       `(("zlib:static" ,zlib "static")
         ("isl:static" ,isl "static")
-        ,@(package-inputs gcc)))
+        ,@(fold alist-delete (package-inputs gcc-14)
+                '("libstdc++" "libstdc++-headers"))))
      (native-inputs
       (if (%current-target-system)
           `(;; When doing a Canadian cross, we need GMP/MPFR/MPC both
@@ -556,17 +556,19 @@ (define %gcc-static
             ("gmp-native" ,gmp)
             ("mpfr-native" ,mpfr)
             ("mpc-native" ,mpc)
-            ,@(package-native-inputs gcc))
-          (package-native-inputs gcc))))))
+            ,@(package-native-inputs gcc-14))
+          (package-native-inputs gcc-14))))))
 
 (define %gcc-stripped
   ;; The subset of GCC files needed for bootstrap.
   (package
-    (inherit gcc)
+    (inherit gcc-14)
     (name "gcc-stripped")
     (build-system trivial-build-system)
     (source #f)
     (outputs '("out"))                            ;only one output
+    (inputs '())
+    (native-inputs '())
     (arguments
      (list #:modules '((guix build utils))
            #:builder
@@ -632,6 +634,7 @@ (define* (make-guile-static guile patches)
       (propagated-inputs
        (modify-inputs (package-propagated-inputs guile)
          (replace "libgc" libgc/static-libs)))
+
       (arguments
        (substitute-keyword-arguments (package-arguments guile)
          ((#:configure-flags flags #~'())
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 28/58] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (26 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 27/58] gnu: make-bootstrap: Update gcc-static to gcc-14, for the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 29/58] system: image: Add hurd64 image types Janneke Nieuwenhuizen
                     ` (29 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290
  Cc: Andreas Enge, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Maxim Cournoyer,
	Simon Tournier, Tobias Geerinckx-Rice

XXX TODO:

   v Boot a 64bit hurd, and
   v Guix shell --bootstrap -D -e '(@@ (gnu packages commencement) gnu-make-boot0)'
   v Guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
   o Guix build hello,
   o Guix shell --bootstrap -D guix,
   o Push the commit below,
   o Re-check the bootstrap-tarballs build/hash,
   o Update this commit message with new commit hash,
   o Push it with remainder of hurd-team branch,
   o Write hurd64 blog post!

On commit:
    cdf94aaceabe243a128e404585f4795391b12eb5
    gnu: make-bootstrap: Update gcc-static to gcc-14, for the 64bit Hurd.

Run:
    ./pre-inst-env guix build --target=x86_64-gnu bootstrap-tarballs

Producing:
    /gnu/store/w1n7bdpn88plcc49h7n0jriaj41sgwx8-bootstrap-tarballs-0/

With guix hash -r:
    15cb1xh7s2hhp8s0d81bjnw1759w9sh7ckc9n5jq2f3rqw6z76by

* gnu/packages/bootstrap.scm (%bootstrap-executables): Add entries for
x86_64-gnu.
(%bootstrap-guile-hash, %bootstrap-coreutils&co, %bootstrap-binutils,
%bootstrap-glibc, %bootstrap-gcc): Add entry for x86_64-gnu.
* guix/packages.scm (%supported-systems, %hurd-systems): Add x86_64-gnu.
(%cuirass-supported-systems): Remove x86_64-gnu.
* guix/utils.scm (target-64bit?): Add x86_64-gnu.
* m4/guix.m4: Add x86_64-gnu as a supported system.
* doc/guix.texi (GNU Distribution): Add x86_64-gnu.

Change-Id: I828159aedb3f66caba98e935083cc3682429f219
---
 doc/guix.texi              |  9 ++++++++-
 gnu/packages/bootstrap.scm | 36 +++++++++++++++++++++++++++++++++++-
 guix/packages.scm          |  8 +++++---
 m4/guix.m4                 | 12 +++++++++---
 4 files changed, 57 insertions(+), 8 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 5953fcfa26..08665ff4e0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -36,7 +36,7 @@
 Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Efraim Flashner@*
 Copyright @copyright{} 2016 John Darrington@*
 Copyright @copyright{} 2016, 2017 Nikita Gillmann@*
-Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Jan Nieuwenhuizen@*
+Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Janneke Nieuwenhuizen@*
 Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021 Julien Lepiller@*
 Copyright @copyright{} 2016 Alex ter Weele@*
 Copyright @copyright{} 2016, 2017, 2018, 2019, 2020, 2021 Christopher Baines@*
@@ -639,6 +639,13 @@ GNU Distribution
 (@pxref{transparent-emulation-qemu, @code{hurd-vm-service-type}}).
 @xref{Contributing}, on how to help!
 
+@item x86_64-gnu
+@uref{https://hurd.gnu.org, GNU/Hurd} on the @code{x86_64} Intel/AMD
+64-bit architecture.
+
+This configuration is even more experimental and under heavy upstream
+development.
+
 @item mips64el-linux (unsupported)
 little-endian 64-bit MIPS processors, specifically the Loongson series,
 n32 ABI, and Linux-Libre kernel.  This configuration is no longer fully
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 27798fe278..8027918323 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -125,6 +125,15 @@ (define %bootstrap-executables
       ,(base32 "0nq2c1zb3wv5bf7kd83sziaashydazrn7xgq6kijlk0zj2syzc2m"))
      ("xz"
       ,(base32 "033rhpk6zrpxpd6ffjyg5y2zwq9x9cnq0zljb7k8jlncbalsayq5")))
+    ("x86_64-gnu"
+     ("bash"
+      ,(base32 "1xvhwyvamlcva01zv6pz7br7d2lgq5qd14misi8wffxc78c4lndk"))
+     ("mkdir"
+      ,(base32 "1c5irkgxaxpwlxzf68xg47j7m6ibd9xqvxznlml42nhfnrka447s"))
+     ("tar"
+      ,(base32 "0ak7sri6294y1g3ia1yrf7facxc7dij02mlxi4xg6k5yszv1jd3w"))
+     ("xz"
+      ,(base32 "0zz9pgw0pyadqsq9nvvpiryk1gpmm89754m6xlqh4ssbbvzpk3y6")))
     ("mips64el-linux"
      ("bash"
       ,(base32 "1aw046dhda240k9pb9iaj5aqkm23gkvxa9j82n4k7fk87nbrixw6"))
@@ -165,6 +174,7 @@ (define (bootstrap-executable-file-name system program)
   (match system
     ("powerpc64le-linux" (string-append system "/20210106/" program))
     ("i586-gnu" (string-append system "/20200326/" program))
+    ("x86_64-gnu" (string-append system "/20241122/" program))
     ("powerpc-linux" (string-append system "/20200923/bin/" program))
     ("riscv64-linux" (string-append system "/20210725/bin/" program))
     (_ (string-append system "/" program
@@ -366,6 +376,8 @@ (define (bootstrap-guile-url-path system)
                     "/20150101/guile-2.0.11.tar.xz")
                    ("i586-gnu"
                     "/20200326/guile-static-stripped-2.0.14-i586-pc-gnu.tar.xz")
+                   ("x86_64-gnu"
+                    "/20241122/guile-static-stripped-3.0.9-x86_64-pc-gnu.tar.xz")
                    ("powerpc64le-linux"
                     "/20210106/guile-static-stripped-2.0.14-powerpc64le-linux-gnu.tar.xz")
                    ("riscv64-linux"
@@ -387,9 +399,11 @@ (define (bootstrap-guile-hash system)
     ("powerpc64le-linux"
      (base32 "1rnyfz5q38jyvxddj617443bnnzql4vw0mxzqpj8wz48wx4bhbq0"))
     ("aarch64-linux"
-     (base32 "1giy2aprjmn5fp9c4s9r125fljw4wv6ixy5739i5bffw4jgr0f9r"))
+     (base32 "1ymp3lck1l5fybsa542ny2fdkfydfcfvqbgr3qh03yvq4fwfn6mc"))
     ("i586-gnu"
      (base32 "0wgqpsmvg25rnqn49ap7kwd2qxccd8dr4lllzp7i3rjvgav27vac"))
+    ("x86_64-gnu"
+     (base32 "109p34v8fgxznxdyb90y74qj6ppwgb5qj0c2pa3gxba7x1r0p4k1"))
     ("powerpc-linux"
      (base32 "1by2p7s27fbyjzfkcw8h65h4kkqh7d23kv4sgg5jppjn2qx7swq4"))
     ("riscv64-linux"
@@ -599,6 +613,8 @@ (define %bootstrap-coreutils&co
                                              "/20210106/static-binaries-0-powerpc64le-linux-gnu.tar.xz")
                                             ("i586-gnu"
                                              "/20200326/static-binaries-0-i586-pc-gnu.tar.xz")
+                                            ("x86_64-gnu"
+                                             "/20241122/static-binaries-0-x86_64-pc-gnu.tar.xz")
                                             ("powerpc-linux"
                                              "/20200923/static-binaries.tar.xz")
                                             ("riscv64-linux"
@@ -626,6 +642,9 @@ (define %bootstrap-coreutils&co
                               ("i586-gnu"
                                (base32
                                 "17kllqnf3fg79gzy9ansgi801c46yh9c23h4d923plvb0nfm1cfn"))
+                              ("x86_64-gnu"
+                               (base32
+                                "04zksa2457h1vcl5ry2hyzhhsg8fckvfdgadp0viba3anwms2463"))
                               ("powerpc-linux"
                                (base32
                                 "0kspxy0yczan2vlih6aa9hailr2inz000fqa0gn5x9d1fxxa5y8m"))
@@ -682,6 +701,8 @@ (define %bootstrap-binutils
                                              "/20210106/binutils-static-stripped-2.34-powerpc64le-linux-gnu.tar.xz")
                                             ("i586-gnu"
                                              "/20200326/binutils-static-stripped-2.34-i586-pc-gnu.tar.xz")
+                                            ("x86_64-gnu"
+                                             "/20241122/binutils-static-stripped-2.41-x86_64-pc-gnu.tar.xz")
                                             ("powerpc-linux"
                                              "/20200923/binutils-2.35.1.tar.xz")
                                             ("riscv64-linux"
@@ -712,6 +733,9 @@ (define %bootstrap-binutils
                               ("i586-gnu"
                                (base32
                                 "11kykv1kmqc5wln57rs4klaqa13hm952smkc57qcsyss21kfjprs"))
+                              ("x86_64-gnu"
+                               (base32
+                                "1fasv76rppnqlshjqc7dbzngic9cqswi5ydzg6w9rc075daqk8kb"))
                               ("powerpc-linux"
                                (base32
                                 "0asbg1c4avkrvh057mx0942xwddd136jni382zqsxzn79ls42yq8"))
@@ -772,6 +796,8 @@ (define %bootstrap-glibc
                                        "/20210106/glibc-stripped-2.31-powerpc64le-linux-gnu.tar.xz")
                                       ("i586-gnu"
                                        "/20240816/glibc-stripped-2.39-i586-pc-gnu.tar.xz")
+                                      ("x86_64-gnu"
+                                       "/20241122/glibc-stripped-2.39-x86_64-pc-gnu.tar.xz")
                                       ("powerpc-linux"
                                        "/20200923/glibc-2.32.tar.xz")
                                       ("riscv64-linux"
@@ -802,6 +828,9 @@ (define %bootstrap-glibc
                         ("i586-gnu"
                          (base32
                           "0x2x6w611k6v9qdabacawamw2475p04hm3s0q95xcg063wjq4ig2"))
+                        ("x86_64-gnu"
+                         (base32
+                          "1w4h91kxl64a62l646966i73zp2cj6w4dmyc64fh0c1hhdykxass"))
                         ("powerpc-linux"
                          (base32
                           "0smmssyjrlk5cvx49586smmk81gkwff0i6r91n4rir4jm6ba25sb"))
@@ -878,6 +907,8 @@ (define %bootstrap-gcc
                                         "/20210106/gcc-stripped-5.5.0-powerpc64le-linux-gnu.tar.xz")
                                        ("i586-gnu"
                                         "/20200326/gcc-stripped-5.5.0-i586-pc-gnu.tar.xz")
+                                       ("x86_64-gnu"
+                                        "/20241122/gcc-stripped-14.2.0-x86_64-pc-gnu.tar.xz")
                                        ("powerpc-linux"
                                         "/20200923/gcc-5.5.0.tar.xz")
                                        ("riscv64-linux"
@@ -908,6 +939,9 @@ (define %bootstrap-gcc
                          ("i586-gnu"
                           (base32
                            "1j2zc58wzil71a34h7c70sd68dmqvcscrw3rmn2whq79vd70zvv5"))
+                         ("x86_64-gnu"
+                          (base32
+                           "1cgbhc76hlccx6v2z7kk7z173lryyq3la5mmbwivl6hbl1zcqg3m"))
                          ("powerpc-linux"
                           (base32
                            "1p7df3yixhm87dw5sccc6yn1i9db1r9hnmsg87wq5xi4rfmirq7w"))
diff --git a/guix/packages.scm b/guix/packages.scm
index f373136d22..403217d711 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -419,7 +420,7 @@ (define %32bit-supported-systems
 (define %64bit-supported-systems
   ;; This is the list of 64-bit system types that are supported.
   '("x86_64-linux" "mips64el-linux" "aarch64-linux" "powerpc64le-linux"
-    "riscv64-linux"))
+    "riscv64-linux" "x86_64-gnu"))
 
 (define %supported-systems
   ;; This is the list of system types that are supported.  By default, we
@@ -428,14 +429,15 @@ (define %supported-systems
 
 (define %hurd-systems
   ;; The GNU/Hurd systems for which support is being developed.
-  '("i586-gnu"))
+  '("i586-gnu" "x86_64-gnu"))
 
 (define %cuirass-supported-systems
   ;; This is the list of system types for which build machines are available.
   ;;
   ;; XXX: MIPS is unavailable in CI:
   ;; <https://lists.gnu.org/archive/html/guix-devel/2017-03/msg00790.html>.
-  (fold delete %supported-systems '("mips64el-linux" "powerpc-linux" "riscv64-linux")))
+  (fold delete %supported-systems '("mips64el-linux" "powerpc-linux"
+                                    "riscv64-linux" "x86_64-gnu")))
 
 (define (maybe-add-input-labels inputs)
   "Add labels to INPUTS unless it already has them."
diff --git a/m4/guix.m4 b/m4/guix.m4
index b93daba5c3..8c2757a8b7 100644
--- a/m4/guix.m4
+++ b/m4/guix.m4
@@ -3,6 +3,7 @@ dnl Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020, 2021 Ludovic Co
 dnl Copyright © 2014 Mark H Weaver <mhw@netris.org>
 dnl Copyright © 2017, 2020, 2021, 2023 Efraim Flashner <efraim@flashner.co.il>
 dnl Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
+dnl Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 dnl
 dnl This file is part of GNU Guix.
 dnl
@@ -61,8 +62,13 @@ AC_DEFUN([GUIX_SYSTEM_TYPE], [
        linux-musl*)
 	  guix_system="$machine_name-linux";;
        gnu*)
-          # Always use i586 for GNU/Hurd.
-          guix_system="i586-gnu";;
+          case "$machine_name" in
+            i386|i486|i586|i686)
+              # Always use i586 for 32bit GNU/Hurd.
+              guix_system="i586-gnu";;
+            *)
+	      guix_system="$machine_name-gnu";;
+          esac;;
        *)
 	  # Strip the version number from names such as `gnu0.3',
 	  # `darwin10.2.0', etc.
@@ -91,7 +97,7 @@ courageous and port the GNU System distribution to it (see
   # Currently only Linux-based systems are supported, and only on some
   # platforms.
   case "$guix_system" in
-    x86_64-linux|i686-linux|armhf-linux|aarch64-linux|powerpc64le-linux|riscv64-linux|i586-gnu)
+    x86_64-linux|i686-linux|armhf-linux|aarch64-linux|powerpc64le-linux|riscv64-linux|i586-gnu|x86_64-gnu)
       ;;
     mips64el-linux|powerpc-linux)
       AC_MSG_WARN([building Guix on `$guix_system', which is not supported])
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 29/58] system: image: Add hurd64 image types.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (27 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 28/58] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 30/58] gnu: libgpg-error: Support the 64bit Hurd Janneke Nieuwenhuizen
                     ` (28 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/system/hurd.scm (%hurd64-default-operating-system-kernel,
%hurd64-default-operating-system): New variables.
* gnu/system/images/hurd.scm (hurd64-disk-image, hurd64-image-type,
hurd64-qcow2-image-type, hurd64-barebones-disk-image,
hurd64-barebones-qcow2-image): New variables.

* gnu/system/images/hurd.scm (hurd64-barebones-os): New variable.
---
 gnu/system/hurd.scm        | 17 +++++++++
 gnu/system/images/hurd.scm | 72 ++++++++++++++++++++++++++++++++++++--
 2 files changed, 87 insertions(+), 2 deletions(-)

diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 9a351529e8..6263d3de71 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)
@@ -51,6 +52,8 @@ (define-module (gnu system hurd)
             %desktop-services/hurd
             %hurd-default-operating-system
             %hurd-default-operating-system-kernel
+            %hurd64-default-operating-system
+            %hurd64-default-operating-system-kernel
             %setuid-programs/hurd))
 
 ;;; Commentary:
@@ -68,6 +71,14 @@ (define %hurd-default-operating-system-kernel
                         (%current-target-system #f))
         gnumach)))
 
+(define %hurd64-default-operating-system-kernel
+  (if (system-hurd?)
+      gnumach
+      ;; A cross-built GNUmach does not work
+      (with-parameters ((%current-system "x86_64-linux")
+                        (%current-target-system #f))
+        gnumach)))
+
 (define %base-packages/hurd
   ;; Note: the Shepherd comes before the Hurd, not just because its duty is to
   ;; shepherd the herd, but also because we want its 'halt' and 'reboot'
@@ -142,3 +153,9 @@ (define %hurd-default-operating-system
     (essential-services (hurd-default-essential-services this-operating-system))
     (privileged-programs '())
     (setuid-programs %setuid-programs/hurd)))
+
+(define %hurd64-default-operating-system
+  (operating-system
+    (inherit %hurd-default-operating-system)
+    (kernel %hurd64-default-operating-system-kernel)))
+
diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm
index 01c422a54f..67815aeb9b 100644
--- a/gnu/system/images/hurd.scm
+++ b/gnu/system/images/hurd.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,7 +36,14 @@ (define-module (gnu system images hurd)
             hurd-image-type
             hurd-qcow2-image-type
             hurd-barebones-disk-image
-            hurd-barebones-qcow2-image))
+            hurd-barebones-qcow2-image
+
+            hurd64-barebones-os
+            hurd64-disk-image
+            hurd6-image-type
+            hurd64-qcow2-image-type
+            hurd64-barebones-disk-image
+            hurd64-barebones-qcow2-image))
 
 (define hurd-barebones-os
   (operating-system
@@ -62,6 +69,30 @@ (define hurd-barebones-os
                               (password-authentication? #t)))
                     %base-services+qemu-networking/hurd))))
 
+(define hurd64-barebones-os
+  (operating-system
+    (inherit %hurd64-default-operating-system)
+    (bootloader (bootloader-configuration
+                 (bootloader grub-minimal-bootloader)
+                 (targets '("/dev/sdX"))))
+    (file-systems (cons (file-system
+                          (device (file-system-label "my-root"))
+                          (mount-point "/")
+                          (type "ext2"))
+                        %base-file-systems))
+    (host-name "guixygnu")
+    (timezone "Europe/Amsterdam")
+    (packages (cons openssh-sans-x %base-packages/hurd))
+    (services (cons (service openssh-service-type
+                             (openssh-configuration
+                              (openssh openssh-sans-x)
+                              (use-pam? #f)
+                              (port-number 2222)
+                              (permit-root-login #t)
+                              (allow-empty-passwords? #t)
+                              (password-authentication? #t)))
+                    %base-services+qemu-networking/hurd))))
+
 (define hurd-initialize-root-partition
   #~(lambda* (#:rest args)
       (apply initialize-root-partition
@@ -115,5 +146,42 @@ (define hurd-barebones-qcow2-image
                         #:type hurd-qcow2-image-type))
    (name 'hurd-barebones.qcow2)))
 
+\f
+;;;
+;;; 64bit Hurd
+;;;
+(define hurd64-disk-image
+  (image
+   (inherit hurd-disk-image)
+   (platform x86_64-gnu)))
+
+(define hurd64-image-type
+  (image-type
+   (name 'hurd64-raw)
+   (constructor (cut image-with-os hurd64-disk-image <>))))
+
+(define hurd64-qcow2-image-type
+  (image-type
+   (name 'hurd64-qcow2)
+   (constructor (lambda (os)
+                  (image
+                   (inherit hurd64-disk-image)
+                   (format 'compressed-qcow2)
+                   (operating-system os))))))
+
+(define hurd64-barebones-disk-image
+  (image
+   (inherit
+    (os+platform->image hurd64-barebones-os x86_64-gnu
+                        #:type hurd64-image-type))
+   (name 'hurd64-barebones-disk-image)))
+
+(define hurd64-barebones-qcow2-image
+  (image
+   (inherit
+    (os+platform->image hurd64-barebones-os x86_64-gnu
+                        #:type hurd64-qcow2-image-type))
+   (name 'hurd64-barebones.qcow2)))
+
 ;; Return the default image.
 hurd-barebones-qcow2-image
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 30/58] gnu: libgpg-error: Support the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (28 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 29/58] system: image: Add hurd64 image types Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 31/58] gnu: openssl-3.0: " Janneke Nieuwenhuizen
                     ` (27 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/libgpg-error-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/gnupg.scm (libgpg-error)[arguments]: Use it when building for
the 64bit Hurd.

Change-Id: Icabb7cd7bb5bcc771ccee5b8a7f57f52b9b58183
---
 gnu/local.mk                                  |  1 +
 gnu/packages/gnupg.scm                        | 22 +++++-
 .../patches/libgpg-error-hurd64.patch         | 78 +++++++++++++++++++
 3 files changed, 98 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/libgpg-error-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 6164ee45c7..52239fb0e0 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1625,6 +1625,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libgeotiff-fix-tests-with-proj-9.3.0.patch	\
   %D%/packages/patches/libgeotiff-fix-tests-with-proj-9.3.1.patch	\
   %D%/packages/patches/libgeotiff-fix-tests-on-i386.patch	\
+  %D%/packages/patches/libgpg-error-hurd64.patch		\
   %D%/packages/patches/libguestfs-syms.patch            	\
   %D%/packages/patches/libobjc2-unbundle-robin-map.patch	\
   %D%/packages/patches/libvirt-add-install-prefix.patch	\
diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index 2e97c2244a..6535f94cb8 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -22,7 +22,7 @@
 ;;; Copyright © 2021 Nikita Domnitskii <nikita@domnitskii.me>
 ;;; Copyright © 2021 Aleksandr Vityazev <avityazev@posteo.org>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -144,9 +144,25 @@ (define-public libgpg-error
                                     ;; configuration, as this is not correct for
                                     ;; all architectures.
                                     (_ #t)))
-                            (#t #t)))))))
+                            (#t #t)))))
+              #$@(if (target-hurd64?)
+                     #~((add-after 'unpack 'apply-hurd64-patch
+                         (lambda _
+                           (let ((patch
+                                  #$(local-file
+                                     (search-patch
+                                      "libgpg-error-hurd64.patch"))))
+                             (invoke "patch" "--force" "-p1" "-i" patch)))))
+                     #~())))
           ((system-hurd?)
-           #~((add-after 'unpack 'skip-tests
+           #~((add-after 'unpack 'apply-hurd64-patch
+                         (lambda _
+                           (let ((patch
+                                  #$(local-file
+                                     (search-patch
+                                      "libgpg-error-hurd64.patch"))))
+                             (invoke "patch" "--force" "-p1" "-i" patch))))
+              (add-after 'unpack 'skip-tests
                 (lambda _
                   (substitute* "tests/t-syserror.c"
                     (("(^| )main *\\(.*" all)
diff --git a/gnu/packages/patches/libgpg-error-hurd64.patch b/gnu/packages/patches/libgpg-error-hurd64.patch
new file mode 100644
index 0000000000..aac8ce61f1
--- /dev/null
+++ b/gnu/packages/patches/libgpg-error-hurd64.patch
@@ -0,0 +1,78 @@
+Upstream-status: Taken from upstream (1.48 series).
+
+From c62157c615a6379677c8f106bf9413d2611fd95e Mon Sep 17 00:00:00 2001
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date: Sat, 6 May 2023 16:10:55 +0200
+Subject: [PATCH] core: Add hurd-amd64 support
+
+--
+This supports the x86_64-pc-gnu triplet
+
+Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
+---
+ src/Makefile.am                              |  1 +
+ src/mkheader.c                               |  2 ++
+ src/syscfg/lock-obj-pub.x86_64-unknown-gnu.h | 24 ++++++++++++++++++++
+ 3 files changed, 27 insertions(+)
+ create mode 100644 src/syscfg/lock-obj-pub.x86_64-unknown-gnu.h
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index c61adde..9389e99 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -67,6 +67,7 @@ lock_obj_pub = \
+         syscfg/lock-obj-pub.sparc-unknown-linux-gnu.h       \
+         syscfg/lock-obj-pub.sparc64-unknown-linux-gnu.h     \
+ 	syscfg/lock-obj-pub.x86_64-apple-darwin.h           \
++        syscfg/lock-obj-pub.x86_64-unknown-gnu.h              \
+         syscfg/lock-obj-pub.x86_64-unknown-kfreebsd-gnu.h   \
+         syscfg/lock-obj-pub.x86_64-unknown-linux-gnu.h      \
+         syscfg/lock-obj-pub.x86_64-unknown-linux-gnux32.h   \
+diff --git a/src/mkheader.c b/src/mkheader.c
+index 8fbfbd6..cc0eaa3 100644
+--- a/src/mkheader.c
++++ b/src/mkheader.c
+@@ -108,6 +108,8 @@ canon_host_triplet (const char *triplet, int no_vendor_hack, char **r_os)
+     {"x86_64-pc-linux-gnuhardened1", "x86_64-unknown-linux-gnu" },
+     {"x86_64-pc-linux-gnu" },
+ 
++    {"x86_64-pc-gnu"},
++
+     {"powerpc-unknown-linux-gnuspe", "powerpc-unknown-linux-gnu" },
+ 
+     {"arm-unknown-linux-gnueabihf",  "arm-unknown-linux-gnueabi" },
+diff --git a/src/syscfg/lock-obj-pub.x86_64-unknown-gnu.h b/src/syscfg/lock-obj-pub.x86_64-unknown-gnu.h
+new file mode 100644
+index 0000000..7c7e6f1
+--- /dev/null
++++ b/src/syscfg/lock-obj-pub.x86_64-unknown-gnu.h
+@@ -0,0 +1,24 @@
++## lock-obj-pub.x86_64-pc-gnu.h
++## File created by gen-posix-lock-obj - DO NOT EDIT
++## To be included by mkheader into gpg-error.h
++
++typedef struct
++{
++  long _vers;
++  union {
++    volatile char _priv[32];
++    long _x_align;
++    long *_xp_align;
++  } u;
++} gpgrt_lock_t;
++
++#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
++                                    0,0,0,0,0,0,0,0, \
++                                    0,0,0,0,0,0,0,0, \
++                                    0,0,0,0,0,0,0,0}}}
++##
++## Local Variables:
++## mode: c
++## buffer-read-only: t
++## End:
++##
+
+base-commit: 7a42ff0ec971f4f2add28b0edad6cf381b5b8acc
+-- 
+2.46.0
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 31/58] gnu: openssl-3.0: Support the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (29 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 30/58] gnu: libgpg-error: Support the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 32/58] gnu: pciutils: " Janneke Nieuwenhuizen
                     ` (26 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/openssl-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/tls.scm (openssl-3.0)[arguments]: When building for
the 64bit Hurd, use it in new "apply-hurd-patch" phase.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/local.mk                              |  1 +
 gnu/packages/patches/openssl-hurd64.patch | 99 +++++++++++++++++++++++
 gnu/packages/tls.scm                      |  9 +++
 3 files changed, 109 insertions(+)
 create mode 100644 gnu/packages/patches/openssl-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 52239fb0e0..c1eca1f940 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1899,6 +1899,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/opensles-add-license-file.patch			\
   %D%/packages/patches/openssl-1.1-c-rehash-in.patch		\
   %D%/packages/patches/openssl-3.0-c-rehash-in.patch		\
+  %D%/packages/patches/openssl-hurd64.patch			\
   %D%/packages/patches/opentaxsolver-file-browser-fix.patch     \
   %D%/packages/patches/open-zwave-hidapi.patch			\
   %D%/packages/patches/orangeduck-mpc-fix-pkg-config.patch	\
diff --git a/gnu/packages/patches/openssl-hurd64.patch b/gnu/packages/patches/openssl-hurd64.patch
new file mode 100644
index 0000000000..372fda834a
--- /dev/null
+++ b/gnu/packages/patches/openssl-hurd64.patch
@@ -0,0 +1,99 @@
+Upstream-status: Taken from upstream:
+
+<https://github.com/openssl/openssl/commit/7c729851d169f30d9e0c0ad6e7c1cf6cefb37935>.
+
+From 795699363be8f717e36802c3ac503011b74ad752 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Thu, 7 Nov 2024 14:08:05 +0100
+Subject: [PATCH] Add support for the 64bit Hurd.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+Taken from <https://salsa.debian.org/debian/openssl>.
+---
+ Configurations/10-main.conf | 45 ++++++++++++++++++++++++++++++++-----
+ util/perl/OpenSSL/config.pm |  3 ++-
+ 2 files changed, 41 insertions(+), 7 deletions(-)
+
+diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
+index b578a3c2a8..740460ebd3 100644
+--- a/Configurations/10-main.conf
++++ b/Configurations/10-main.conf
+@@ -1685,20 +1685,53 @@ my %targets = (
+     },
+ 
+ ##### GNU Hurd
+-    "hurd-x86" => {
++    "hurd-generic32" => {
+         inherit_from     => [ "BASE_unix" ],
+         CC               => "gcc",
+-        CFLAGS           => "-O3 -fomit-frame-pointer -Wall",
++        CXX              => "g++",
++        CFLAGS           => picker(default => "-Wall",
++                                   debug   => "-O0 -g",
++                                   release => "-O3"),
++        CXXFLAGS         => picker(default => "-Wall",
++                                   debug   => "-O0 -g",
++                                   release => "-O3"),
+         cflags           => threads("-pthread"),
+-        lib_cppflags     => "-DL_ENDIAN",
++        cxxflags         => combine("-std=c++11", threads("-pthread")),
+         ex_libs          => add("-ldl", threads("-pthread")),
+-        bn_ops           => "BN_LLONG",
+-        asm_arch         => 'x86',
+-        perlasm_scheme   => 'elf',
++        bn_ops           => "BN_LLONG RC4_CHAR",
+         thread_scheme    => "pthreads",
+         dso_scheme       => "dlfcn",
+         shared_target    => "linux-shared",
+         shared_cflag     => "-fPIC",
++        shared_ldflag    => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
++    },
++
++    "hurd-generic64" => {
++        inherit_from     => [ "hurd-generic32" ],
++        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
++    },
++
++    #### X86 / X86_64 targets
++    "hurd-x86" => {
++        inherit_from     => [ "hurd-generic32" ],
++        CFLAGS           => add(picker(release => "-fomit-frame-pointer")),
++        cflags           => add("-m32"),
++        cxxflags         => add("-m32"),
++        lib_cppflags     => add("-DL_ENDIAN"),
++        bn_ops           => "BN_LLONG",
++        asm_arch         => 'x86',
++        perlasm_scheme   => 'elf',
++    },
++
++    "hurd-x86_64" => {
++        inherit_from     => [ "hurd-generic64" ],
++        cflags           => add("-m64"),
++        cxxflags         => add("-m64"),
++        lib_cppflags     => add("-DL_ENDIAN"),
++        bn_ops           => "SIXTY_FOUR_BIT_LONG",
++        asm_arch         => 'x86_64',
++        perlasm_scheme   => 'elf',
++        multilib         => "64",
+     },
+ 
+ ##### VxWorks for various targets
+diff --git a/util/perl/OpenSSL/config.pm b/util/perl/OpenSSL/config.pm
+index 2f1edcafb6..707db71537 100755
+--- a/util/perl/OpenSSL/config.pm
++++ b/util/perl/OpenSSL/config.pm
+@@ -92,7 +92,8 @@ my $guess_patterns = [
+     [ 'IRIX64:.*',                  'mips4-sgi-irix64' ],
+     [ 'Linux:[2-9]\..*',            '${MACHINE}-whatever-linux2' ],
+     [ 'Linux:1\..*',                '${MACHINE}-whatever-linux1' ],
+-    [ 'GNU.*',                      'hurd-x86' ],
++    [ 'GNU:.*86-AT386',             'hurd-x86' ],
++    [ 'GNU:.*86_64-AT386',          'hurd-x86_64' ],
+     [ 'LynxOS:.*',                  '${MACHINE}-lynx-lynxos' ],
+     # BSD/OS always says 386
+     [ 'BSD\/OS:4\..*',              'i486-whatever-bsdi4' ],
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 43806e24da..fab88518ce 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -589,6 +589,15 @@ (define-public openssl-3.0
                                            "/bin/perl"))))
             #$@(if (target-hurd?)
                    #~((delete 'patch-configure))
+                   #~())
+            #$@(if (target-hurd64?)
+                   #~((add-after 'unpack 'apply-hurd-patch
+                        (lambda _
+                          (let ((patch-file
+                                 #$(local-file
+                                    (search-patch "openssl-hurd64.patch"))))
+                            (invoke "patch" "--force" "-p1" "-i"
+                                    patch-file)))))
                    #~())))
        ((#:configure-flags flags #~'())
         (if (system-hurd?)
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 32/58] gnu: pciutils: Support the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (30 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 31/58] gnu: openssl-3.0: " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 33/58] gnu: libpciaccess: " Janneke Nieuwenhuizen
                     ` (25 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/pciutils-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/pciutils.scm (pciutils)[arguments]: Use g-expressions.  When
building for the 64bit Hurd, use it in new "apply-hurd64-patch" phase.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/local.mk                               |  1 +
 gnu/packages/patches/pciutils-hurd64.patch | 31 ++++++++++++++++++++++
 gnu/packages/pciutils.scm                  | 25 +++++++++++------
 3 files changed, 49 insertions(+), 8 deletions(-)
 create mode 100644 gnu/packages/patches/pciutils-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index c1eca1f940..ceddce8f78 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1914,6 +1914,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/pam-krb5-CVE-2020-10595.patch		\
   %D%/packages/patches/pango-skip-libthai-test.patch		\
   %D%/packages/patches/password-store-tree-compat.patch		\
+  %D%/packages/patches/pciutils-hurd64.patch			\
   %D%/packages/patches/pdfpc-build-with-vala-0.56.patch         \
   %D%/packages/patches/petri-foo-0.1.87-fix-recent-file-not-exist.patch			\
   %D%/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch \
diff --git a/gnu/packages/patches/pciutils-hurd64.patch b/gnu/packages/patches/pciutils-hurd64.patch
new file mode 100644
index 0000000000..316f12e131
--- /dev/null
+++ b/gnu/packages/patches/pciutils-hurd64.patch
@@ -0,0 +1,31 @@
+Upstream-status: Not presented upstream.
+
+--- pciutils-3.8.0/lib/hurd.c.orig	2024-11-07 15:09:20.728973822 +0100
++++ pciutils-3.8.0/lib/hurd.c	2024-11-07 15:05:08.524682813 +0100
+@@ -213,7 +213,7 @@
+ hurd_read(struct pci_dev *d, int pos, byte * buf, int len)
+ {
+   int err;
+-  size_t nread;
++  mach_msg_type_number_t nread;
+   char *data;
+   mach_port_t device_port = device_port_lookup(d);
+ 
+@@ -266,7 +266,7 @@
+   mach_port_t device_port = device_port_lookup(d);
+   struct pci_bar regions[6];
+   char *buf = (char *) &regions;
+-  size_t size = sizeof(regions);
++  mach_msg_type_number_t size = sizeof(regions);
+ 
+   int err = pci_get_dev_regions(device_port, &buf, &size);
+   if (err)
+@@ -305,7 +305,7 @@
+   struct pci_xrom_bar rom;
+   mach_port_t device_port = device_port_lookup(d);
+   char *buf = (char *) &rom;
+-  size_t size = sizeof(rom);
++  mach_msg_type_number_t size = sizeof(rom);
+ 
+   int err = pci_get_dev_rom(device_port, &buf, &size);
+   if (err)
diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index d2a352eb6b..08f1634113 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2022 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
 ;;;
@@ -81,25 +81,34 @@ (define-public pciutils
                 "01aglgw9ds9qiswcbi2lx90lswncikrlyv8mmp4haix8542bvvci"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
          (add-after 'unpack 'unbundle-pci.ids
            (lambda* (#:key native-inputs inputs #:allow-other-keys)
              (copy-file (search-input-file (or native-inputs inputs)
                                            "share/hwdata/pci.ids")
                         "pci.ids")))
+         #$@(if (target-hurd64?)
+               #~((add-after 'unpack 'apply-hurd64-patch
+                    (lambda _
+                      (let ((patch-file
+                             #$(local-file
+                                (search-patch "pciutils-hurd64.patch"))))
+                        (invoke "patch" "--force" "-p1" "-i" patch-file)))))
+               #~())
          (replace 'configure
            (lambda* (#:key outputs #:allow-other-keys)
              ;; There's no 'configure' script, just a raw makefile.
              (substitute* "Makefile"
-               ,@(if (%current-target-system)
-                     `((("^CROSS_COMPILE=.*$")
+               #$@(if (%current-target-system)
+                     #~((("^CROSS_COMPILE=.*$")
                         (string-append "CROSS_COMPILE="
-                                       ,(%current-target-system) "-"
+                                       #$(%current-target-system) "-"
                                        "\n"))
                        (("^HOST=.*$")
                         (string-append "HOST="
-                                       ,(gnu-triplet->nix-system
+                                       #$(gnu-triplet->nix-system
                                          (%current-target-system)) "\n"))
                        ;; Disable 'install' strip option, that would fail when
                        ;; we are cross-compiling.
@@ -139,7 +148,7 @@ (define-public pciutils
              (invoke "make" "install" "install-lib"))))
 
        ;; Make sure programs have an RPATH so they can find libpciutils.so.
-       #:make-flags (list ,(string-append "CC="
+       #:make-flags #~(list #$(string-append "CC="
                                           (if (%current-target-system)
                                               (cc-for-target)
                                               "gcc"))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 33/58] gnu: libpciaccess: Support the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (31 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 32/58] gnu: pciutils: " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 34/58] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df Janneke Nieuwenhuizen
                     ` (24 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/libpciaccess-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/xorg.scm (libpciaccess) [arguments]: Use g-expressions.  When
building for the 64bit Hurd, use it in new "apply-hurd64-patch" phase.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/local.mk                                  |  1 +
 .../patches/libpciaccess-hurd64.patch         | 58 +++++++++++++++++++
 gnu/packages/xorg.scm                         | 23 +++++---
 3 files changed, 75 insertions(+), 7 deletions(-)
 create mode 100644 gnu/packages/patches/libpciaccess-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ceddce8f78..adcbb55847 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1711,6 +1711,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libmpeg2-global-symbol-test.patch	\
   %D%/packages/patches/libmygpo-qt-fix-qt-5.11.patch		\
   %D%/packages/patches/libmygpo-qt-missing-qt5-modules.patch	\
+  %D%/packages/patches/libpciaccess-hurd64.patch		\
   %D%/packages/patches/libphonenumber-reproducible-build.patch	\
   %D%/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch	\
   %D%/packages/patches/libquicktime-ffmpeg.patch 		\
diff --git a/gnu/packages/patches/libpciaccess-hurd64.patch b/gnu/packages/patches/libpciaccess-hurd64.patch
new file mode 100644
index 0000000000..f7e11059b1
--- /dev/null
+++ b/gnu/packages/patches/libpciaccess-hurd64.patch
@@ -0,0 +1,58 @@
+Upstream-status: Taken from upstream:
+
+<https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/commit/6cd5a4afbb70868c7746de8d50dea59e02e9acf2>.
+
+From 6cd5a4afbb70868c7746de8d50dea59e02e9acf2 Mon Sep 17 00:00:00 2001
+From: Flavio Cruz <flaviocruz@gmail.com>
+Date: Wed, 28 Jun 2023 01:02:34 -0400
+Subject: [PATCH] Fix compilation warnings when building against hurd-amd64.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+Passes mach_msg_type_number_t instead of size_t which have different
+sizes. Example warning:
+
+/hurd_pci.c:101:53: warning: passing argument 3 of 'pci_get_dev_regions' from incompatible pointer type [-Wincompatible-pointer-types]
+  101 |     err = pci_get_dev_regions(d->device_port, &buf, &size);
+      |                                                     ^~~~~
+      |                                                     |
+      |                                                     size_t * {aka long unsigned int *}
+---
+ src/hurd_pci.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/hurd_pci.c b/src/hurd_pci.c
+index 8653e1b..9ac3813 100644
+--- a/src/hurd_pci.c
++++ b/src/hurd_pci.c
+@@ -82,7 +82,7 @@ pci_device_hurd_probe(struct pci_device *dev)
+     struct pci_bar regions[6];
+     struct pci_xrom_bar rom;
+     struct pci_device_private *d;
+-    size_t size;
++    mach_msg_type_number_t size;
+     char *buf;
+ 
+     /* Many of the fields were filled in during initial device enumeration.
+@@ -323,7 +323,7 @@ pciclient_cfg_read(mach_port_t device_port, int reg, char *buf,
+                    size_t * nbytes)
+ {
+     int err;
+-    size_t nread;
++    mach_msg_type_number_t nread;
+     char *data;
+ 
+     data = buf;
+@@ -473,7 +473,7 @@ simple_readdir(mach_port_t port, uint32_t *first_entry)
+ {
+     char *data;
+     int nentries = 0;
+-    vm_size_t size;
++    mach_msg_type_number_t size;
+ 
+     dir_readdir (port, &data, &size, *first_entry, 1, 0, &nentries);
+ 
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 554dc21ba7..e78264ec6f 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -36,7 +36,7 @@
 ;;; Copyright © 2021 Lu Hui <luhux76@gmail.com>
 ;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
 ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2023, 2024 John Kehayias <john.kehayias@protonmail.com>
 ;;; Copyright © 2023, 2024 Kaelyn Takata <kaelyn.alexi@protonmail.com>
 ;;;
@@ -1169,16 +1169,17 @@ (define-public libpciaccess
             "12glp4w1kgvmqn89lk19cgr6jccd3awxra4dxisp7pagi06rsk11"))))
     (build-system gnu-build-system)
     (arguments
-     '(;; Make sure libpciaccess can read compressed 'pci.ids' files as
-       ;; provided by pciutils.
-       #:configure-flags
-       (list "--with-zlib"
+     (list
+      ;; Make sure libpciaccess can read compressed 'pci.ids' files as
+      ;; provided by pciutils.
+      #:configure-flags
+      #~(list "--with-zlib"
              (string-append "--with-pciids-path="
                             (assoc-ref %build-inputs "pciutils")
                             "/share/hwdata"))
 
        #:phases
-       (modify-phases %standard-phases
+       #~(modify-phases %standard-phases
          (add-after 'install 'add-L-zlib
            (lambda* (#:key inputs outputs #:allow-other-keys)
              ;; Provide '-LZLIB/lib' next to '-lz' in the .la file.
@@ -1187,7 +1188,15 @@ (define-public libpciaccess
                (substitute* (string-append out "/lib/libpciaccess.la")
                  (("-lz")
                   (string-append "-L" zlib "/lib -lz")))
-               #t))))))
+               #t)))
+         #$@(if (target-hurd64?)
+                #~((add-after 'unpack 'apply-hurd64-patch
+                     (lambda _
+                       (let ((patch-file
+                              #$(local-file
+                                 (search-patch "libpciaccess-hurd64.patch"))))
+                         (invoke "patch" "--force" "-p1" "-i" patch-file)))))
+                #~()))))
     (inputs
      (list zlib pciutils))                   ;for 'pci.ids.gz'
     (native-inputs
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 34/58] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (32 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 33/58] gnu: libpciaccess: " Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 35/58] gnu: netdde: Support the 64bit Hurd Janneke Nieuwenhuizen
                     ` (23 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (netdde): Update to
c0ef248dc7c5ccc1273e2a796f3ece30c5b645df.
(dde-sources): Update to b6c8526c703f3ba76294d9002f195c63897ec661.

Change-Id: Id03f5c5124f16e9ffd6a77cbb2507d274e0f325a
---
 gnu/packages/hurd.scm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 5fdb6359d1..2c231425aa 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -294,7 +294,7 @@ (define unifont
 
 (define dde-sources
   ;; This is the current tip of the dde branch
-  (let ((commit "066797b576ebf8364ad157f50bef2a655597deeb"))
+  (let ((commit "b6c8526c703f3ba76294d9002f195c63897ec661"))
     (origin
       (method git-fetch)
       (uri (git-reference
@@ -302,7 +302,7 @@ (define dde-sources
             (commit commit)))
       (sha256
        (base32
-        "19f2awlfnar5gyhi0w5zawla5brzck2s88iv0f20022pd1l5v9hl"))
+        "0k1ilj8ghli8x43xaksbc4y419pqh0w16k374914c07svq419bbr"))
       (file-name (git-file-name "dde" (string-take commit 7))))))
 
 (define %import-from-dde
@@ -567,8 +567,8 @@ (define-public hurd
     (license gpl2+)))
 
 (define-public netdde
-  (let ((commit "e67c284ac113d939b10b4578334f27dab29d5b08")
-        (revision "2"))
+  (let ((commit "c0ef248dc7c5ccc1273e2a796f3ece30c5b645df")
+        (revision "3"))
     (package
       (name "netdde")
       ;; The version prefix corresponds to the version of Linux from which the
@@ -582,7 +582,7 @@ (define-public netdde
                 (patches (list (search-patch "netdde-build-fix.patch")))
                 (sha256
                  (base32
-                  "0vnkls7sr7srzib5mnw6gybzl5qa8c5a4zf3h08w6gdr7zqbndh0"))
+                  "070fpmd4nvn3mp8dj9w4if63iwz7j2m0h6ywq888znw70wlrc6sh"))
                 (file-name (git-file-name name commit))))
       (build-system gnu-build-system)
       (arguments
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 35/58] gnu: netdde: Support the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (33 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 34/58] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 36/58] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337 Janneke Nieuwenhuizen
                     ` (22 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/netdde-csum.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hurd.scm (netdde)[source]: Use it.
[arguments]: Do not assume x86, rather use actual ARCH in #:make-flags, and
follow upstream's "amd64" symlinking voodoo.

Change-Id: Ie825e56779dae2f489066569dc3c4405bac778c1
---
 gnu/local.mk                           |  1 +
 gnu/packages/hurd.scm                  | 19 ++++++++++++++++++-
 gnu/packages/patches/netdde-csum.patch | 18 ++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/netdde-csum.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index adcbb55847..2e18ed7870 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1824,6 +1824,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ncftp-reproducible.patch			\
   %D%/packages/patches/netcdf-date-time.patch			\
   %D%/packages/patches/netdde-build-fix.patch			\
+  %D%/packages/patches/netdde-csum.patch			\
   %D%/packages/patches/netpbm-CVE-2017-2586.patch		\
   %D%/packages/patches/netpbm-CVE-2017-2587.patch		\
   %D%/packages/patches/netsurf-message-timestamp.patch		\
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 2c231425aa..defa3f2689 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -579,7 +579,8 @@ (define-public netdde
                 (uri (git-reference
                       (url "https://git.savannah.gnu.org/git/hurd/incubator.git")
                       (commit commit)))
-                (patches (list (search-patch "netdde-build-fix.patch")))
+                (patches (search-patches "netdde-build-fix.patch"
+                                         "netdde-csum.patch"))
                 (sha256
                  (base32
                   "070fpmd4nvn3mp8dj9w4if63iwz7j2m0h6ywq888znw70wlrc6sh"))
@@ -599,6 +600,13 @@ (define-public netdde
                               " -Wno-int-conversion"
                               " -Wno-strict-prototypes")
                "ARCH=x86")
+               (let ((arch ,(match (or (%current-target-system)
+                                       (%current-system))
+                              ((? target-x86-32?)
+                               "x86")
+                              ((? target-x86-64?)
+                               "amd64"))))
+                 (string-append "ARCH=" arch)))
          #:configure-flags
          ,#~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
          #:phases
@@ -616,6 +624,15 @@ (define-public netdde
                  (("/bin/bash") (which "bash")))))
            (add-after 'patch-generated-file-shebangs 'build-libdde-linux26
              (lambda* (#:key make-flags #:allow-other-keys)
+               (when ,(target-hurd64?)
+                 (let ((dir "libdde_linux26/build/include"))
+                   (mkdir-p (string-append dir "/x86"))
+                   (format #t "symlink ~a -> ~a\n"
+                           (string-append dir "/x86/amd64") "x86")
+                   (symlink "x86" (string-append dir "/amd64"))
+                   (format #t "symlink ~a -> ~a\n"
+                           (string-append dir "/amd64/asm-x86_64") "asm-x86")
+                   (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64"))))
                (with-directory-excursion "libdde_linux26"
                  (apply invoke "make"
                         (delete "PKGDIR=libdde_linux26" make-flags)))))
diff --git a/gnu/packages/patches/netdde-csum.patch b/gnu/packages/patches/netdde-csum.patch
new file mode 100644
index 0000000000..4fdd004898
--- /dev/null
+++ b/gnu/packages/patches/netdde-csum.patch
@@ -0,0 +1,18 @@
+Upstream-status: Taken from debian.
+
+<https://salsa.debian.org/hurd-team/netdde/raw/master/debian/patches/csum>.
+
+---
+ linux/drivers/net/vmxnet3/vmxnet3_drv.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/linux/drivers/net/vmxnet3/vmxnet3_drv.c
++++ b/linux/drivers/net/vmxnet3/vmxnet3_drv.c
+@@ -25,6 +25,7 @@
+  */
+ 
+ #include "vmxnet3_int.h"
++#include <net/ip6_checksum.h>
+ 
+ char vmxnet3_driver_name[] = "vmxnet3";
+ #define VMXNET3_DRIVER_DESC "VMware vmxnet3 virtual NIC driver"
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 36/58] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (34 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 35/58] gnu: netdde: Support the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-24  7:54   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 37/58] gnu: rumpkernel: Support the 64bit Hurd Janneke Nieuwenhuizen
                     ` (21 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:54 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (rumpkernel): Update to
f1ffd6405f225336e595a0f99f01095ed7438337.
[arguments]: In stage "build", add "-Wno-error=sign-compare" to CWARNFLAGS.

Change-Id: I8936377da726681b748cc010e1fbae3fb19dee05
---
 gnu/packages/hurd.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index defa3f2689..0df514cc78 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -676,8 +676,8 @@ (define-public netdde
       (license gpl2))))
 
 (define-public rumpkernel
-  (let ((commit "81043d42fabda9baed7ac9ca36e3f3f5ed11ba81")
-        (revision "3"))
+  (let ((commit "f1ffd6405f225336e595a0f99f01095ed7438337")
+        (revision "0"))
     (package
       (name "rumpkernel")
       (version (git-version "0-20211031" revision commit))
@@ -691,7 +691,7 @@ (define-public rumpkernel
                       (commit commit)))
                 (sha256
                  (base32
-                  "0fv0k52qqcg3nq9012hibgsamvsd7mnvn2ikdasmzjhsp8qh5q3r"))
+                  "1ygn3ysji06ik3k44sf906fjpdmabznkspw70llldbk2zkrcdw7i"))
                 (file-name (git-file-name name version))))
       (build-system gnu-build-system)
       (arguments
@@ -811,7 +811,8 @@ (define-public rumpkernel
                            " -Wno-error=stack-protector"
                            " -Wno-error=array-parameter"
                            " -Wno-error=array-bounds"
-                           " -Wno-error=stringop-overflow")
+                           " -Wno-error=stringop-overflow"
+                           " -Wno-error=sign-compare")
                      "-V" "LIBCRTBEGIN="
                      "-V" "LIBCRTEND="
                      "-V" "LIBCRT0="
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 37/58] gnu: rumpkernel: Support the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (35 preceding siblings ...)
  2024-11-24  7:54   ` [bug#74290] [PATCH v4 36/58] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337 Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 38/58] gnu: hurd: Build fixes for " Janneke Nieuwenhuizen
                     ` (20 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/hurd.scm (rumpkernel)[argument]: In stage "build", follow
Debian upstream to use -DPAE disable the DTRACE and ZFS builds.

Change-Id: I534da31eefb378c72b4896d64a51a73109e38aa6
---
 gnu/packages/hurd.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 0df514cc78..6701d00251 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -792,6 +792,9 @@ (define-public rumpkernel
                      "-V" "MKBINUTILS=no"
                      "-V" "MKGDB=no"
                      "-V" "MKGROFF=no"
+                     "-V" "MKDTRACE=no"
+                     "-V" "MKZFS=no"
+
                      "-V" (string-append "TOPRUMP=" toprump)
                      "-V" "BUILDRUMP_CPPFLAGS=-Wno-error=stringop-overread"
                      "-V" "RUMPUSER_EXTERNAL_DPLIBS=pthread"
@@ -802,7 +805,8 @@ (define-public rumpkernel
                            " -DRUMP_REGISTER_T=int"
                            " -DRUMPUSER_CONFIG=yes"
                            " -DNO_PCI_MSI_MSIX=yes"
-                           " -DNUSB_DMA=1")
+                           " -DNUSB_DMA=1"
+                           " -DPAE")
                      "-V" (string-append
                            "CWARNFLAGS="
                            " -Wno-error=maybe-uninitialized"
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 38/58] gnu: hurd: Build fixes for the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (36 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 37/58] gnu: rumpkernel: Support the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 39/58] gnu: inetutils: Fix build " Janneke Nieuwenhuizen
                     ` (19 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/hurd-64bit.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hurd.scm (hurd)[source]: Use it.
[arguments]: When building for the 64bit Hurd, add "create-machine-symlink"
phase.  In phases "build-libdde-linux" and "install-goodies", do not assume
x86, rather use actual ARCH, and follow upstream's "amd64" symlinking voodoo.

Change-Id: If264a91b2433add13f9121c482f0abe67ae5f1e9
---
 gnu/local.mk                          |   1 +
 gnu/packages/hurd.scm                 | 126 ++++++++++++++++----------
 gnu/packages/patches/hurd-64bit.patch |  56 ++++++++++++
 3 files changed, 135 insertions(+), 48 deletions(-)
 create mode 100644 gnu/packages/patches/hurd-64bit.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 2e18ed7870..eb1bc43276 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1553,6 +1553,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/htslib-for-stringtie.patch		\
   %D%/packages/patches/hubbub-sort-entities.patch		\
   %D%/packages/patches/hueplusplus-mbedtls.patch		\
+  %D%/packages/patches/hurd-64bit.patch				\
   %D%/packages/patches/hurd-rumpdisk-no-hd.patch		\
   %D%/packages/patches/hurd-startup.patch			\
   %D%/packages/patches/hwloc-1-test-btrfs.patch			\
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 6701d00251..63249b4ef7 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -317,7 +317,8 @@ (define-public hurd
     (source (origin
               (inherit (package-source hurd-headers))
               (patches (search-patches "hurd-rumpdisk-no-hd.patch"
-                                       "hurd-startup.patch"))))
+                                       "hurd-startup.patch"
+                                       "hurd-64bit.patch"))))
     (version (package-version hurd-headers))
     (arguments
      `(#:tests? #f                      ;no "check" target
@@ -467,54 +468,84 @@ (define-public hurd
                          (find-files (string-append out "/libexec")))
                #t)))
          (add-after 'build 'build-libdde-linux
-           (lambda* (#:key inputs native-inputs #:allow-other-keys)
-             (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
-                                    "/bin/make")
-                     ;; XXX There can be a race condition because subdirs
-                     ;; aren't interdependent targets in the Makefile.
-                     "-j1" "-C" "libdde_linux26"
-                     (string-append "SHELL="
-                                    (assoc-ref (or native-inputs inputs) "bash")
-                                    "/bin/bash")
-                     (string-append "CC="
-                                    ,(cc-for-target))
-                     (string-append "WARNINGS="
-                                    " -Wno-declaration-missing-parameter-type"
-                                    " -Wno-implicit-function-declaration"
-                                    " -Wno-implicit-int"
-                                    " -Wno-int-conversion"
-                                    " -Wno-strict-prototypes")
-                     "ARCH=x86")))
+          (lambda* (#:key inputs native-inputs #:allow-other-keys)
+            (let ((arch ,(match (or (%current-target-system)
+                                    (%current-system))
+                           ((? target-x86-32?)
+                            "x86")
+                           ((? target-x86-64?)
+                            "amd64"))))
+              (when ,(target-hurd64?)
+                (let ((dir "libdde_linux26/build/include"))
+                  (mkdir-p (string-append dir "/x86"))
+                  (format #t "symlink ~a -> ~a\n"
+                          (string-append dir "/x86/amd64") "x86")
+                  (symlink "x86" (string-append dir "/amd64"))
+                  (format #t "symlink ~a -> ~a\n"
+                          (string-append dir "/amd64/asm-x86_64") "asm-x86")
+                  (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64"))))
+              (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
+                                     "/bin/make")
+                      ;; XXX There can be a race condition because subdirs
+                      ;; aren't interdependent targets in the Makefile.
+                      "-j1" "-C" "libdde_linux26"
+                      (string-append "SHELL="
+                                     (assoc-ref (or native-inputs inputs) "bash")
+                                     "/bin/bash")
+                      (string-append "CC="
+                                     ,(cc-for-target))
+                      (string-append "WARNINGS="
+                                     " -Wno-declaration-missing-parameter-type"
+                                     " -Wno-implicit-function-declaration"
+                                     " -Wno-implicit-int"
+                                     " -Wno-int-conversion"
+                                     " -Wno-strict-prototypes")
+                      (string-append "ARCH=" arch)))))
          (add-after 'install 'install-goodies
-           (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
-             ;; Install additional goodies.
-             ;; TODO: Build & install *.msgids for rpctrace.
-             (let* ((out (assoc-ref outputs "out"))
-                    (datadir (string-append out "/share/hurd")))
-               ;; Install libdde_linux26.
-               (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
-                                      "/bin/make")
-                       "-C" "libdde_linux26" "install"
-                       (string-append "SHELL="
-                                      (assoc-ref (or native-inputs inputs) "bash")
-                                      "/bin/bash")
-                       (string-append "INSTALLDIR="
-                                      out
-                                      "/share/libdde_linux26/build/include")
-                       "ARCH=x86")
-               ;; Install the fancy UTF-8 motd.
-               (mkdir-p (string-append out "/etc"))
-               (copy-file "console/motd.UTF8"
-                          (string-append out "/etc/motd"))
+          (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
+            ;; Install additional goodies.
+            ;; TODO: Build & install *.msgids for rpctrace.
+            (let* ((out (assoc-ref outputs "out"))
+                   (datadir (string-append out "/share/hurd"))
+                   (arch ,(match (or (%current-target-system)
+                                     (%current-system))
+                            ((? target-x86-32?)
+                             "x86")
+                            ((? target-x86-64?)
+                             "amd64")))
+                   (dir (string-append out "/share/libdde_linux26/build/include")))
+              (mkdir-p dir)
+              (when ,(target-hurd64?)
+                (mkdir-p (string-append dir "/amd64"))
+                (format #t "symlink ~a -> ~a\n"
+                        (string-append dir "/amd64/asm-x86_64")
+                        "x86")
+                (symlink "x86" (string-append dir "/amd46")))
+              (invoke (string-append (assoc-ref (or native-inputs inputs) "make")
+                                     "/bin/make")
+                      "-C" "libdde_linux26" "install"
+                      (string-append "SHELL="
+                                     (assoc-ref (or native-inputs inputs) "bash")
+                                     "/bin/bash")
+                      (string-append "INSTALLDIR=" dir)
+                      (string-append "ARCH=" arch))
+              (when ,(target-hurd64?)
+                (format #t "symlink ~a -> ~a\n"
+                        (string-append dir "/amd64/asm-x86_64")
+                        "asm-x86")
+                (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64")))
+              ;; Install the fancy UTF-8 motd.
+              (mkdir-p (string-append out "/etc"))
+              (copy-file "console/motd.UTF8"
+                         (string-append out "/etc/motd"))
 
-               ;; Install the BDF font for use by the console client.
-               (copy-file (assoc-ref inputs "unifont")
-                          "unifont.gz")
-               (invoke "gunzip" "unifont.gz")
-               (mkdir-p datadir)
-               (copy-file "unifont"
-                          (string-append datadir "/vga-system.bdf"))
-               #t))))
+              ;; Install the BDF font for use by the console client.
+              (copy-file (assoc-ref inputs "unifont")
+                         "unifont.gz")
+              (invoke "gunzip" "unifont.gz")
+              (mkdir-p datadir)
+              (copy-file "unifont"
+                         (string-append datadir "/vga-system.bdf"))))))
        #:configure-flags
        ,#~(list (string-append "LDFLAGS=-Wl,-rpath="
                                #$output "/lib")
@@ -599,7 +630,6 @@ (define-public netdde
                               " -Wno-implicit-int"
                               " -Wno-int-conversion"
                               " -Wno-strict-prototypes")
-               "ARCH=x86")
                (let ((arch ,(match (or (%current-target-system)
                                        (%current-system))
                               ((? target-x86-32?)
diff --git a/gnu/packages/patches/hurd-64bit.patch b/gnu/packages/patches/hurd-64bit.patch
new file mode 100644
index 0000000000..643550ad68
--- /dev/null
+++ b/gnu/packages/patches/hurd-64bit.patch
@@ -0,0 +1,56 @@
+Upstream-status: Taken from upstream:
+    <https://git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=d494333e7607ea03819adcfb69d89f8248ec2044>.
+
+From d494333e7607ea03819adcfb69d89f8248ec2044 Mon Sep 17 00:00:00 2001
+From: Flavio Cruz <flaviocruz@gmail.com>
+Date: Sun, 21 Jul 2024 17:20:55 -0400
+Subject: [PATCH] nfsd: fix -Werror=incompatible-pointer-types issues for
+ x86_64
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+Message-ID: <3pmgbk2myx4phdb6wcso54solmybulrvbytols5md3nri2p2qp@xjmfmpvwjp6t>
+---
+ nfsd/cache.c | 2 +-
+ nfsd/ops.c   | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/nfsd/cache.c b/nfsd/cache.c
+index cd5524af..864739c0 100644
+--- a/nfsd/cache.c
++++ b/nfsd/cache.c
+@@ -387,7 +387,7 @@ create_cached_handle (int fs, struct cache_handle *credc, file_t userport)
+   struct cache_handle *c;
+   int hash;
+   char *bp = fhandle.array + sizeof (int);
+-  size_t handlelen = NFS2_FHSIZE - sizeof (int);
++  mach_msg_type_number_t handlelen = NFS2_FHSIZE - sizeof (int);
+   mach_port_t newport, ref;
+ 
+   /* Authenticate USERPORT so that we can call file_getfh on it.  */
+diff --git a/nfsd/ops.c b/nfsd/ops.c
+index 463a9c87..64e94b93 100644
+--- a/nfsd/ops.c
++++ b/nfsd/ops.c
+@@ -292,7 +292,7 @@ op_write (struct cache_handle *c,
+   off_t offset;
+   size_t count;
+   error_t err;
+-  mach_msg_type_number_t amt;
++  vm_size_t amt;
+   char *bp;
+   struct stat st;
+ 
+@@ -583,7 +583,7 @@ op_readdir (struct cache_handle *c,
+   error_t err;
+   char *buf;
+   struct dirent *dp;
+-  size_t bufsize;
++  mach_msg_type_number_t bufsize;
+   int nentries;
+   int i;
+   int *replystart;
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 39/58] gnu: inetutils: Fix build for the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (37 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 38/58] gnu: hurd: Build fixes for " Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 40/58] gnu: grub: " Janneke Nieuwenhuizen
                     ` (18 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290; +Cc: Sharlatan Hellseher

* gnu/packages/patches/inetutils-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/admin.scm (inetutils)[arguments]: When building for the 64bit
Hurd, use it in new "apply-hurd64-patch" stage.

Change-Id: I780f6a92418b49e5fe0d23eb1c90e155216f1428
---
 gnu/local.mk                                |  1 +
 gnu/packages/admin.scm                      | 14 ++++-
 gnu/packages/patches/inetutils-hurd64.patch | 65 +++++++++++++++++++++
 3 files changed, 78 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/inetutils-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb1bc43276..c8fbae91fc 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1577,6 +1577,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/indent-CVE-2024-0911.patch	\
   %D%/packages/patches/instead-use-games-path.patch		\
   %D%/packages/patches/intltool-perl-compatibility.patch	\
+  %D%/packages/patches/inetutils-hurd64.patch			\
   %D%/packages/patches/irrlicht-use-system-libs.patch		\
   %D%/packages/patches/irrlicht-link-against-needed-libs.patch	\
   %D%/packages/patches/isl-0.11.1-aarch64-support.patch	\
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 46282da67e..fbf3e26a3f 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -31,7 +31,7 @@
 ;;; Copyright © 2019, 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2019, 2020, 2021 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
@@ -1044,7 +1044,17 @@ (define-public inetutils
                              "\\\""))
       ;; On some systems, 'libls.sh' may fail with an error such as:
       ;; "Failed to tell switch -a apart from -A".
-      #:parallel-tests? #f))
+      #:parallel-tests? #f
+      #:phases (if (target-hurd64?)
+                   #~(modify-phases %standard-phases
+                       (add-after 'unpack 'apply-hurd64-patch
+                         (lambda _
+                           (let ((patch
+                                  #$(local-file
+                                     (search-patch
+                                      "inetutils-hurd64.patch"))))
+                             (invoke "patch" "--force" "-p1" "-i" patch)))))
+                   #~%standard-phases)))
     (inputs
      (list coreutils
            shadow                     ;for login (used in telnetd and rlogind)
diff --git a/gnu/packages/patches/inetutils-hurd64.patch b/gnu/packages/patches/inetutils-hurd64.patch
new file mode 100644
index 0000000000..3fb238bcdc
--- /dev/null
+++ b/gnu/packages/patches/inetutils-hurd64.patch
@@ -0,0 +1,65 @@
+Upstream-status: Not presented upstream.
+
+From 0804e655a7abfd22dc3a053f03fab8f811405f84 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Fri, 8 Nov 2024 11:07:56 +0100
+Subject: [PATCH] ifconfig hurd: Build fix for the 64bit HUrd.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+* ifconfig/system/hurd.c (check_driving): Use mach_msg_type_number_t
+instead of size_t for file_get_fs_options.
+---
+ ifconfig/system/hurd.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/ifconfig/system/hurd.c b/ifconfig/system/hurd.c
+index 70b2ed27..86fe6375 100644
+--- a/ifconfig/system/hurd.c
++++ b/ifconfig/system/hurd.c
+@@ -47,7 +47,7 @@ check_driving (const char *name)
+   error_t err;
+ 
+   char *argz = 0, *new_argz = 0;
+-  size_t argz_len = 0;
++  mach_msg_type_number_t argz_len = 0;
+   char *entry = 0;
+   const char *socket = _SERVERS_SOCKET "/2";
+ 
+@@ -106,7 +106,9 @@ check_driving (const char *name)
+   new_argz = malloc (argz_len);
+   memcpy (new_argz, argz, argz_len);
+ 
+-  err = argz_insert (&new_argz, &argz_len, new_argz, name);
++  size_t new_argz_len = 0;
++
++  err = argz_insert (&new_argz, &new_argz_len, new_argz, name);
+   if (err)
+     {
+       error (0, err, "Could not prepend name %s to '%s' for %s", name,
+@@ -114,7 +116,7 @@ check_driving (const char *name)
+       goto out;
+     }
+ 
+-  err = argz_insert (&new_argz, &argz_len, new_argz, "-i");
++  err = argz_insert (&new_argz, &new_argz_len, new_argz, "-i");
+   if (err)
+     {
+       argz_stringify (new_argz, argz_len, ' ');
+@@ -122,10 +124,10 @@ check_driving (const char *name)
+       goto out;
+     }
+ 
+-  err = fsys_set_options (fsys, new_argz, argz_len, 1);
++  err = fsys_set_options (fsys, new_argz, new_argz_len, 1);
+   if (err)
+     {
+-      argz_stringify (new_argz, argz_len, ' ');
++      argz_stringify (new_argz, new_argz_len, ' ');
+       error (0, err, "Could not make pfinet %s drive %s with '%s'", socket,
+ 	     name, new_argz);
+       goto out;
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 40/58] gnu: grub: Fix build for the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (38 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 39/58] gnu: inetutils: Fix build " Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 41/58] gnu: guile-fibers: " Janneke Nieuwenhuizen
                     ` (17 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290; +Cc: Efraim Flashner, Vagrant Cascadian

* gnu/packages/patches/grub-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/bootloaders.scm (grub)[arguments]: When building for the 64bit
Hurd, use it in new "apply-hurd64-patch" stage.

Change-Id: I780f6a92418b49e5fe0d23eb1c90e155216f1428
---
 gnu/local.mk                           |  1 +
 gnu/packages/bootloaders.scm           |  8 +++++++
 gnu/packages/patches/grub-hurd64.patch | 32 ++++++++++++++++++++++++++
 3 files changed, 41 insertions(+)
 create mode 100644 gnu/packages/patches/grub-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index c8fbae91fc..3595c68800 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1494,6 +1494,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gromacs-tinyxml2.patch			\
   %D%/packages/patches/groovy-add-exceptionutilsgenerator.patch	\
   %D%/packages/patches/grub-efi-fat-serial-number.patch		\
+  %D%/packages/patches/grub-hurd64.patch			\
   %D%/packages/patches/grub-setup-root.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-2.2-skip-oom-test.patch            \
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index da5abaca55..61ea74b69a 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -192,6 +192,14 @@ (define-public grub
                        (setenv "BUILD_FREETYPE_CFLAGS"
                                (string-append "-I" freetype
                                               "/include/freetype2"))))))
+               #$@(if (target-hurd64?)
+                      #~((add-after 'unpack 'apply-hurd64-patch
+                           (lambda _
+                             (let ((patch
+                                    #$(local-file
+                                       (search-patch "grub-hurd64.patch"))))
+                               (invoke "patch" "--force" "-p1" "-i" patch)))))
+                      #~())
                (add-before 'check 'disable-flaky-test
                  (lambda _
                    ;; This test is unreliable. For more information, see:
diff --git a/gnu/packages/patches/grub-hurd64.patch b/gnu/packages/patches/grub-hurd64.patch
new file mode 100644
index 0000000000..d5acd99eb8
--- /dev/null
+++ b/gnu/packages/patches/grub-hurd64.patch
@@ -0,0 +1,32 @@
+Upstream-status: Not presented upstream.
+
+From a4eb7d1f2cbd02132a9f5512f1294182576d4653 Mon Sep 17 00:00:00 2001
+From: Janneke Nieuwenhuizen <janneke@gnu.org>
+Date: Fri, 8 Nov 2024 11:47:49 +0100
+Subject: [PATCH] osdep/hurd: Support the 64bit Hurd.
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain; charset=UTF-8
+
+* grub-core/osdep/hurd/getroot.c (grub_util_find_hurd_root_device):
+Use mach_msg_type_number_t instead of size_t.
+---
+ grub-core/osdep/hurd/getroot.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/grub-core/osdep/hurd/getroot.c b/grub-core/osdep/hurd/getroot.c
+index 0efefdab4..b849700e6 100644
+--- a/grub-core/osdep/hurd/getroot.c
++++ b/grub-core/osdep/hurd/getroot.c
+@@ -58,7 +58,7 @@ grub_util_find_hurd_root_device (const char *path)
+   file_t file;
+   error_t err;
+   char *argz = NULL, *name = NULL, *ret;
+-  size_t argz_len = 0;
++  mach_msg_type_number_t argz_len = 0;
+   int i;
+ 
+   file = file_name_lookup (path, 0, 0);
+-- 
+Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
+Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 41/58] gnu: guile-fibers: Fix build for the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (39 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 40/58] gnu: grub: " Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 42/58] gnu: m4: " Janneke Nieuwenhuizen
                     ` (16 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/guile-xyz.scm (guile-fibers)[arguments]: Also modify phases for
the 64bit Hurd.

Change-Id: I780f6a92418b49e5fe0d23eb1c90e155216f1428
---
 gnu/packages/guile-xyz.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index a21289d368..bd5878d229 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -856,7 +856,7 @@ (define-public guile-fibers
      (list #:make-flags
            #~(list "GUILE_AUTO_COMPILE=0")
            #:phases
-           (if (target-x86-64?)
+           (if (and (target-x86-64?) (not (target-hurd?)))
                #~%standard-phases
                #~(modify-phases %standard-phases
                    (add-before 'check 'disable-some-tests
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 42/58] gnu: m4: Fix build for the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (40 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 41/58] gnu: guile-fibers: " Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 43/58] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714 Janneke Nieuwenhuizen
                     ` (15 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/base.scm (grep)[arguments]: When building for the 64bit Hurd,
add patch-sigsegv.h stage.

Change-Id: I82993ebde268867348893556a9476faa5c4e9453
---
 gnu/packages/m4.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/m4.scm b/gnu/packages/m4.scm
index 39b50b6800..081304db34 100644
--- a/gnu/packages/m4.scm
+++ b/gnu/packages/m4.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -64,6 +64,13 @@ (define-public m4
                       (("(^| )main *\\(.*" all)
                        (string-append all "{\n  exit (77);//"))))))
               '())
+        ,@(if (target-hurd64?)
+              '((add-after 'unpack 'patch-sigsegv
+                  (lambda _
+                    ;; Stack overflow recovery does not compile
+                    (substitute* "lib/sigsegv.in.h"
+                      (("__GNU__") "__XGNU__")))))
+              '())
         (add-after 'unpack 'configure-shell
           (lambda* (#:key native-inputs inputs #:allow-other-keys)
             (let ((/bin/sh (search-input-file (or native-inputs inputs)
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 43/58] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (41 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 42/58] gnu: m4: " Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 44/58] gnu: commencement: mig-boot0: Update to 1.8+git20231217 Janneke Nieuwenhuizen
                     ` (14 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (gnumach-headers-boot0): Update to
1.8+git20240714.

Change-Id: If30d7b4a688070d70741173c97a60284ca8299ef
---
 gnu/packages/commencement.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 1cfaaae1e7..2f805b3e63 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2635,7 +2635,7 @@ (define gnumach-headers-boot0
    (package
      (inherit gnumach-headers)
      (name "gnumach-headers-boot0")
-     (version "1.8+git20230410")
+     (version "1.8+git20240714")
      (source
       (origin
         (inherit (package-source gnumach-headers))
@@ -2649,7 +2649,7 @@ (define gnumach-headers-boot0
                   "gnumach-" version ".tar.gz"))
             (sha256
              (base32
-              "1s09256g2ny46idrn8frzs7r51la9ni45bmglmswlsmz9ii7dpi4")))))))
+              "1bnw5vdbq91zjxklx23qvim40fb0yw1qdxhn9n37jdfypm6q3xir")))))))
      (native-inputs (list autoconf-boot0 automake-boot0 texinfo-boot0))
      (arguments
       (substitute-keyword-arguments (package-arguments gnumach-headers)
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 44/58] gnu: commencement: mig-boot0: Update to 1.8+git20231217..
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (42 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 43/58] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714 Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 45/58] gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714 Janneke Nieuwenhuizen
                     ` (13 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (mig-boot0): Update to 1.8+git20231217.

Change-Id: I591ff7cb84ac1e567d49f51eb40be19fa6b15f5b
---
 gnu/packages/commencement.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 2f805b3e63..742ccbc63b 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2670,7 +2670,7 @@ (define mig-boot0
    (package
      (inherit mig)
      (name "mig-boot0")
-     (version "1.8+git20230520")
+     (version "1.8+git20231217")
      (source
       (origin
         (inherit (package-source mig))
@@ -2683,7 +2683,7 @@ (define mig-boot0
                   "mig-" version ".tar.gz"))
             (sha256
              (base32
-              "1l1vfm4wap5yxylv91wssgpy7fnq22wp3akgd5nv995kychfa9jy")))))))
+              "18vz3ifrhhlvrdmlv70h63wl0kh5w8jcpsjx9yscsw9yazm1lzs7")))))))
      (native-inputs (list autoconf-boot0 automake-boot0 bison-boot0 flex-boot0
                           gnumach-headers-boot0))
      (inputs (list flex-boot0 gnumach-headers-boot0))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 45/58] gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (43 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 44/58] gnu: commencement: mig-boot0: Update to 1.8+git20231217 Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 46/58] gnu: commencement: libstdc++-boot0-gcc7: Replace by make-libstdc++-boot0 Janneke Nieuwenhuizen
                     ` (12 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (hurd-headers-boot0): Update to
0.9.git20240714.

Change-Id: Ib3edaa3adb9cfe4cb8c5a3af83cb2701ee9dda1b
---
 gnu/packages/commencement.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 742ccbc63b..ad70bae501 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2699,7 +2699,7 @@ (define hurd-headers-boot0
    (package
      (inherit hurd-headers)
      (name "hurd-headers-boot0")
-     (version "0.9.git20230520")
+     (version "0.9.git20240714")
      (source
       (origin
         (inherit (package-source hurd-headers))
@@ -2712,7 +2712,7 @@ (define hurd-headers-boot0
                   "hurd-v" version ".tar.gz"))
             (sha256
              (base32
-              "0ybmx7bhy21zv1if2hfdspn13zn68vki1na72sw2jj87gj8przna")))))))
+              "0wcihffclwijjamx4cjbr8i92yg780538ipg2z208ahg96jjrmgq")))))))
      (native-inputs
       (list autoconf-boot0 automake-boot0 mig-boot0))
      (inputs '()))))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 46/58] gnu: commencement: libstdc++-boot0-gcc7: Replace by make-libstdc++-boot0.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (44 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 45/58] gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714 Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 47/58] gnu: gettext: Fix cross-build shebangs Janneke Nieuwenhuizen
                     ` (11 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (libstdc++-boot0-gcc7): Change variable to...
(make-libstdc++-boot0): ...this new procedure and update accordingly.
(gcc-boot0): Update accordingly, and cater for x86_64-gnu.

Change-Id: Ib0bc84e4dab90b080e5a01e6ab932f8be456c656
---
 gnu/packages/commencement.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index ad70bae501..a14de3002f 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2273,9 +2273,9 @@ (define libstdc++-boot0
       (inputs (%boot0-inputs))
       (native-inputs '()))))
 
-(define libstdc++-boot0-gcc7
+(define (make-libstdc++-boot0 gcc)
   ;; GCC >= 7 is needed by architectures which use C++-14 features.
-  (let ((lib (make-libstdc++ gcc-7)))
+  (let ((lib (make-libstdc++ gcc)))
     (package
       (inherit lib)
       (source (bootstrap-origin (package-source lib)))
@@ -2446,7 +2446,8 @@ (define gcc-boot0
 
               ;; The libstdc++ that libcc1 links against.
               ("libstdc++" ,(match (%current-system)
-                                   ("riscv64-linux" libstdc++-boot0-gcc7)
+                                   ("riscv64-linux" (make-libstdc++-boot0 gcc-7))
+                                   ("x86_64-gnu" (make-libstdc++-boot0 gcc-14))
                                    (_ libstdc++-boot0)))
 
               ;; Call it differently so that the builder can check whether
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 47/58] gnu: gettext: Fix cross-build shebangs.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (45 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 46/58] gnu: commencement: libstdc++-boot0-gcc7: Replace by make-libstdc++-boot0 Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 48/58] gnu: Add gdb-15.2, with support for the 64bit Hurd Janneke Nieuwenhuizen
                     ` (10 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290

This fixes running autopoint from a cross-built gettext[-minimal].

* gnu/packages/gettext.scm (gettext-minimal): When cross-building, add stage
"patch-cross-shebangs".

Change-Id: I5029a3be0b5cee3c173de66d8f0b027b02c3bc47
---
 gnu/packages/gettext.scm | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm
index cabe4f3be9..7862c296bd 100644
--- a/gnu/packages/gettext.scm
+++ b/gnu/packages/gettext.scm
@@ -9,7 +9,7 @@
 ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Miguel <rosen644835@gmail.com>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020 EuAndreh <eu@euandre.org>
 ;;; Copyright © 2022, 2024 gemmaro <gemmaro.dev@gmail.com>
 ;;; Copyright © 2023 Maxim Cournoyer maxim.cournoyer@gmail.com>
@@ -130,7 +130,19 @@ (define-public gettext-minimal
                                    ((" test-tls\\$\\(EXEEXT\\) ") " ")))
                               '())
 
-                       #t)))))
+                       #t))))
+          #$@(if (%current-target-system)
+                 #~((add-after 'install 'patch-cross-shebangs
+                      (lambda _
+                        (let ((path (list (string-append #$bash-minimal "/bin"))))
+                          (define (patch-cross-shebang file)
+                            (patch-shebang file path))
+                          (with-directory-excursion
+                              (string-append #$output "/bin")
+                            (for-each
+                             patch-cross-shebang
+                             '("autopoint" "gettext.sh" "gettextize")))))))
+                 '()))
 
        ;; When tests fail, we want to know the details.
        #:make-flags #~'("VERBOSE=yes")))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 48/58] gnu: Add gdb-15.2, with support for the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (46 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 47/58] gnu: gettext: Fix cross-build shebangs Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 49/58] gnu: bootstrap: %bootstrap-glibc: Also fix libm.so Janneke Nieuwenhuizen
                     ` (9 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290

* gnu/packages/patches/gdb-hurd64.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/gdb.scm (gdb-15): Use it in new variable.
(gdb-minmal-15): New variable.
(gdb/pinned): When building for the 64bit Hurd, set #:configure-flags to
"--enable-targets=i586-pc-gnu,x86_64-pc-gnu".

Change-Id: I52d28092be6c415b8668bb5a77d41c87df841351
---
 gnu/local.mk                          |   1 +
 gnu/packages/gdb.scm                  |  22 +
 gnu/packages/patches/gdb-hurd64.patch | 923 ++++++++++++++++++++++++++
 3 files changed, 946 insertions(+)
 create mode 100644 gnu/packages/patches/gdb-hurd64.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 3595c68800..08314ade22 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1372,6 +1372,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gcolor3-update-libportal-usage.patch	\
   %D%/packages/patches/gd-fix-tests-on-i686.patch		\
   %D%/packages/patches/gd-brect-bounds.patch			\
+  %D%/packages/patches/gdb-hurd64.patch				\
   %D%/packages/patches/gdm-default-session.patch		\
   %D%/packages/patches/gdm-elogind-support.patch		\
   %D%/packages/patches/gdm-remove-hardcoded-xwayland-path.patch	\
diff --git a/gnu/packages/gdb.scm b/gnu/packages/gdb.scm
index bf46716047..af5ebde3f6 100644
--- a/gnu/packages/gdb.scm
+++ b/gnu/packages/gdb.scm
@@ -67,6 +67,9 @@ (define-public gdb/pinned
       #:out-of-source? #t
       #:modules `((srfi srfi-1)
                   ,@%default-gnu-modules)
+      #:configure-flags (if (target-hurd64?)
+                            #~'("--enable-targets=i586-pc-gnu,x86_64-pc-gnu")
+                            #~'())
       #:phases #~(modify-phases %standard-phases
                    (add-after 'unpack 'patch-paths
                      (lambda* (#:key inputs #:allow-other-keys)
@@ -160,6 +163,19 @@ (define-public gdb-14
                 "0wkprsjyyh204fdjlkaz20k847l88i9y8m9zqsv15vcd3l3dhk9d"))))
     (properties '())))
 
+(define-public gdb-15
+  (package
+    (inherit gdb-14)
+    (version "15.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://gnu/gdb/gdb-"
+                                  version ".tar.xz"))
+              (patches (search-patches "gdb-hurd64.patch"))
+              (sha256
+               (base32
+                "0k9i8mizg4hby020k53kqmc835pajh9c8d5klv5s1ddm6p6hqdc3"))))))
+
 (define-public gdb
   ;; The "default" version.
   gdb-14)
@@ -184,6 +200,12 @@ (define-public gdb-minimal
     (inputs (fold alist-delete (package-inputs gdb)
                   '("libxml2" "ncurses" "python-wrapper" "source-highlight")))))
 
+(define-public gdb-minimal-15
+  (package/inherit gdb-15
+    (name "gdb-minimal")
+    (inputs (fold alist-delete (package-inputs gdb-15)
+                  '("libxml2" "ncurses" "python-wrapper" "source-highlight")))))
+
 (define-public avr-gdb
   (package/inherit gdb-14
     (name "avr-gdb")
diff --git a/gnu/packages/patches/gdb-hurd64.patch b/gnu/packages/patches/gdb-hurd64.patch
new file mode 100644
index 0000000000..50e44b3684
--- /dev/null
+++ b/gnu/packages/patches/gdb-hurd64.patch
@@ -0,0 +1,923 @@
+Upstream-status: Taken from bug-hurd
+
+    <https://lists.gnu.org/archive/html/bug-hurd/2024-07/msg00001.html>.
+
+and gdb-patches
+
+    <https://inbox.sourceware.org/gdb-patches/cw5yn6mfyjxdxv4kzhmqy76tjclttc3cykptidqwdfd5syrw36@r6j6p4cewhs6/T/>
+
+mailing lists.
+
+From 6131a7a8951bc255d6c013de126c46b620434d2f Mon Sep 17 00:00:00 2001
+From: Flavio Cruz <flaviocruz@gmail.com>
+Date: Wed, 3 Jul 2024 22:45:33 +0100
+Subject: [PATCH 1/2] Port GDB to Hurd x86_64.
+
+This port extends the existing i686 port to support x86_64 by trying to
+reuse existing code whenever it makes sense.
+
+* gdb/amd64-gnu-tdep.c: Adds logic for handling signal frames and
+  position of amd64 registers in the different Hurd structs.
+  The signal code is very similar to i686, except the trampoline code
+  is adapted.
+* gdb/config/i386/nm-i386gnu.h: renamed to gdb/config/i386/nm-x86-gnu.h
+  and adapt it for x86_64.
+* gdb/config/i386/i386gnu.mn: renamed to gdb/config/i386/nm-x86-gnu.mn
+  and reuse it for x86_64.
+* gdb/configure.host: recognize gnu64 as a host.
+* gdb/configure.nat: recognize gnu64 host and update existing i386gnu to
+  reuse the new shared files.
+* gdb/configure.tgt: recognize x86_64-*-gnu* triplet and use
+  amd64-gnu-tdep.c.
+* gdb/i386-gnu-tdep.c: added i386_gnu_thread_state_reg_offset that is
+  copied from i386-gnu-nat.c. This makes it similar to amd64.
+* gdb/i386-gnu-nat.c: rename it to x86-gnu-nat.c since we reuse this for
+  i386 and amd64. Updated REG_ADDR to use one of the structures. Added
+  VALID_REGISTER to make sure it's a register we can provide at this time
+  (not all of them are available in amd64). FLAGS_REGISTER is either rfl
+  or efl depending on the arch. Renamed functions and class from i386 to x86
+  whenever they can be reused.
+
+Tested on Hurd x86_64 and i686.
+---
+ gdb/Makefile.in                               |   4 +-
+ gdb/amd64-gnu-tdep.c                          | 231 ++++++++++++++++++
+ .../i386/{nm-i386gnu.h => nm-x86-gnu.h}       |   7 +
+ gdb/config/i386/{i386gnu.mn => x86-gnu.mn}    |   0
+ gdb/configure.host                            |   1 +
+ gdb/configure.nat                             |  27 +-
+ gdb/configure.tgt                             |   6 +-
+ gdb/i386-gnu-tdep.c                           |  13 +-
+ gdb/{i386-gnu-nat.c => x86-gnu-nat.c}         | 171 +++++++++----
+ 9 files changed, 403 insertions(+), 57 deletions(-)
+ create mode 100644 gdb/amd64-gnu-tdep.c
+ rename gdb/config/i386/{nm-i386gnu.h => nm-x86-gnu.h} (83%)
+ rename gdb/config/i386/{i386gnu.mn => x86-gnu.mn} (100%)
+ rename gdb/{i386-gnu-nat.c => x86-gnu-nat.c} (68%)
+
+diff --git a/gdb/Makefile.in b/gdb/Makefile.in
+index 84bc54b303e..67a15e2cc68 100644
+--- a/gdb/Makefile.in
++++ b/gdb/Makefile.in
+@@ -737,6 +737,7 @@ ALL_64_TARGET_OBS = \
+ 	amd64-darwin-tdep.o \
+ 	amd64-dicos-tdep.o \
+ 	amd64-fbsd-tdep.o \
++	amd64-gnu-tdep.o \
+ 	amd64-linux-tdep.o \
+ 	amd64-netbsd-tdep.o \
+ 	amd64-obsd-tdep.o \
+@@ -1688,6 +1689,7 @@ ALLDEPFILES = \
+ 	amd64-dicos-tdep.c \
+ 	amd64-fbsd-nat.c \
+ 	amd64-fbsd-tdep.c \
++	amd64-gnu-tdep.c \
+ 	amd64-linux-nat.c \
+ 	amd64-linux-tdep.c \
+ 	amd64-nat.c \
+@@ -1743,7 +1745,6 @@ ALLDEPFILES = \
+ 	i386-dicos-tdep.c \
+ 	i386-fbsd-nat.c \
+ 	i386-fbsd-tdep.c \
+-	i386-gnu-nat.c \
+ 	i386-gnu-tdep.c \
+ 	i386-linux-nat.c \
+ 	i386-linux-tdep.c \
+@@ -1872,6 +1873,7 @@ ALLDEPFILES = \
+ 	vax-tdep.c \
+ 	windows-nat.c \
+ 	windows-tdep.c \
++	x86-gnu-nat.c \
+ 	x86-nat.c \
+ 	x86-tdep.c \
+ 	xcoffread.c \
+diff --git a/gdb/amd64-gnu-tdep.c b/gdb/amd64-gnu-tdep.c
+new file mode 100644
+index 00000000000..435095e3359
+--- /dev/null
++++ b/gdb/amd64-gnu-tdep.c
+@@ -0,0 +1,231 @@
++/* Target-dependent code for the GNU Hurd.
++   Copyright (C) 2024 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   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
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include "defs.h"
++#include "extract-store-integer.h"
++#include "gdbcore.h"
++#include "osabi.h"
++#include "solib-svr4.h"
++
++#include "amd64-tdep.h"
++#include "glibc-tdep.h"
++
++/* Recognizing signal handler frames.  */
++
++/* When the GNU/Hurd libc calls a signal handler, the return address points
++   inside the trampoline assembly snippet.
++
++   If the trampoline function name can not be identified, we resort to reading
++   memory from the process in order to identify it.  */
++
++static const gdb_byte gnu_sigtramp_code[] =
++{
++/* rpc_wait_trampoline: */
++  0x48, 0xc7, 0xc0, 0xe7, 0xff, 0xff, 0xff,	/* mov    $-25,%rax */
++  0x0f, 0x05,					/* syscall */
++  0x49, 0x89, 0x04, 0x24,			/* mov    %rax,(%r12) */
++  0x48, 0x89, 0xdc,				/* mov    %rbx,%rsp */
++
++/* trampoline: */
++  0x5f,			                        /* pop    %rdi */
++  0x5e,						/* pop    %rsi */
++  0x5a,						/* pop    %rdx */
++  0x48, 0x83, 0xc4, 0x08,			/* add    $0x8,%rsp */
++  0x41, 0xff, 0xd5,				/* call   *%r13 */
++
++/* RA HERE */
++  0x48, 0x8b, 0x7c, 0x24, 0x10,			/* mov    0x10(%rsp),%rdi */
++  0xc3,						/* ret */
++
++/* firewall: */
++  0xf4,						/* hlt */
++};
++
++#define GNU_SIGTRAMP_LEN (sizeof gnu_sigtramp_code)
++#define GNU_SIGTRAMP_TAIL 7			/* length of tail after RA */
++
++/* If THIS_FRAME is a sigtramp routine, return the address of the
++   start of the routine.  Otherwise, return 0.  */
++
++static CORE_ADDR
++amd64_gnu_sigtramp_start (frame_info_ptr this_frame)
++{
++  CORE_ADDR pc = get_frame_pc (this_frame);
++  gdb_byte buf[GNU_SIGTRAMP_LEN];
++
++  if (!safe_frame_unwind_memory (this_frame,
++				 pc + GNU_SIGTRAMP_TAIL - GNU_SIGTRAMP_LEN,
++				 buf))
++    return 0;
++
++  if (memcmp (buf, gnu_sigtramp_code, GNU_SIGTRAMP_LEN) != 0)
++    return 0;
++
++  return pc;
++}
++
++/* Return whether THIS_FRAME corresponds to a Hurd sigtramp routine.  */
++
++static int
++amd64_gnu_sigtramp_p (const frame_info_ptr &this_frame)
++{
++  CORE_ADDR pc = get_frame_pc (this_frame);
++  const char *name;
++
++  find_pc_partial_function (pc, &name, NULL, NULL);
++
++  /* If we have a NAME, we can check for the trampoline function */
++  if (name != NULL && strcmp (name, "trampoline") == 0)
++    return 1;
++
++  return amd64_gnu_sigtramp_start (this_frame) != 0;
++}
++
++/* Offset to sc_i386_thread_state in sigcontext, from <bits/sigcontext.h>.  */
++#define AMD64_GNU_SIGCONTEXT_THREAD_STATE_OFFSET 32
++
++/* Assuming THIS_FRAME is a Hurd sigtramp routine, return the
++   address of the associated sigcontext structure.  */
++
++static CORE_ADDR
++amd64_gnu_sigcontext_addr (const frame_info_ptr &this_frame)
++{
++  struct gdbarch *gdbarch = get_frame_arch (this_frame);
++  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
++  CORE_ADDR pc;
++  CORE_ADDR sp;
++  gdb_byte buf[8];
++
++  get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
++  sp = extract_unsigned_integer (buf, 8, byte_order);
++
++  pc = amd64_gnu_sigtramp_start (this_frame);
++  if (pc)
++    {
++      CORE_ADDR sigcontext_addr;
++
++      /* The sigcontext structure address is passed as the third argument
++       * of the signal handler but %RDX is not saved across calls. Luckily,
++       * the structured is saved underneath the &__sigreturn and a dummy word
++       * to fill the slot for the address for __sigreturn to return to.
++       */
++      read_memory (sp + 16, buf, 8);
++      sigcontext_addr = extract_unsigned_integer (buf, 8, byte_order);
++      return sigcontext_addr + AMD64_GNU_SIGCONTEXT_THREAD_STATE_OFFSET;
++    }
++
++  error (_("Couldn't recognize signal trampoline."));
++  return 0;
++}
++
++/* Mapping between the general-purpose registers in `struct
++   sigcontext' format (starting at sc_i386_thread_state)
++   and GDB's register cache layout.  */
++
++/* From <bits/sigcontext.h>.  */
++static int amd64_gnu_sc_reg_offset[] =
++{
++  15 * 8,			/* %rax */
++  12 * 8,			/* %rbx */
++  14 * 8,			/* %rcx */
++  13 * 8,			/* %rdx */
++  10 * 8,			/* %rsi */
++  9 * 8,			/* %rdi */
++  10 * 8,			/* %rbp */
++  11 * 8,			/* %rsp */
++  0 * 8,			/* %r8 ...  */
++  8 * 8,
++  7 * 8,
++  6 * 8,
++  3 * 8,
++  2 * 8,
++  1 * 8,
++  0 * 8,			/* ... %r15 */
++  16 * 8,			/* %rip */
++  18 * 8,			/* %eflags */
++  17 * 8,			/* %cs */
++};
++
++/* From <sys/ucontext.h>.  */
++static int amd64_gnu_gregset_reg_offset[] =
++{
++  10 * 8,			/* %rax */
++  5 * 8,			/* %rbx */
++  11 * 8,			/* %rcx */
++  12 * 8,			/* %rdx */
++  13 * 8,			/* %rsi */
++  14 * 8,			/* %rdi */
++  4 * 8,			/* %rbp */
++  19 * 8,			/* %rsp */
++  9 * 8,			/* %r8 ...  */
++  8 * 8,
++  7 * 8,
++  6 * 8,
++  3 * 8,
++  2 * 8,
++  1 * 8,
++  0 * 8,			/* ... %r15 */
++  16 * 8,			/* %rip */
++  18 * 8,			/* %eflags */
++  17 * 8,			/* %cs */
++  -1,				  /* %ss */
++  -1,				  /* %ds */
++  -1,				  /* %es */
++  -1,				  /* %fs */
++  -1,				  /* %gs */
++};
++
++static void
++amd64_gnu_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
++{
++  i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
++
++  amd64_init_abi (info, gdbarch,
++      amd64_target_description (X86_XSTATE_SSE_MASK, true));
++
++  /* Enable TLS support.  */
++  set_gdbarch_fetch_tls_load_module_address (gdbarch,
++      svr4_fetch_objfile_link_map);
++
++  /* Hurd uses SVR4-style shared libraries.  */
++  set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
++
++  /* Hurd uses the dynamic linker included in the GNU C Library.  */
++  set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
++
++  tdep->gregset_reg_offset = amd64_gnu_gregset_reg_offset;
++  tdep->gregset_num_regs = ARRAY_SIZE (amd64_gnu_gregset_reg_offset);
++  tdep->sizeof_gregset = 21 * 8; /* sizeof (struct i386_thread_state); */
++
++  tdep->sigtramp_p = amd64_gnu_sigtramp_p;
++  tdep->sigcontext_addr = amd64_gnu_sigcontext_addr;
++  tdep->sc_reg_offset = amd64_gnu_sc_reg_offset;
++  tdep->sc_num_regs = ARRAY_SIZE (amd64_gnu_sc_reg_offset);
++
++  /* Hurd uses SVR4-style shared libraries.  */
++  set_solib_svr4_fetch_link_map_offsets
++    (gdbarch, svr4_lp64_fetch_link_map_offsets);
++}
++
++void _initialize_amd64_gnu_tdep ();
++void
++_initialize_amd64_gnu_tdep ()
++{
++  gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
++			  GDB_OSABI_HURD, amd64_gnu_init_abi);
++}
+diff --git a/gdb/config/i386/nm-i386gnu.h b/gdb/config/i386/nm-x86-gnu.h
+similarity index 83%
+rename from gdb/config/i386/nm-i386gnu.h
+rename to gdb/config/i386/nm-x86-gnu.h
+index d2d5de83948..ed4d1729227 100644
+--- a/gdb/config/i386/nm-i386gnu.h
++++ b/gdb/config/i386/nm-x86-gnu.h
+@@ -22,9 +22,16 @@
+ /* Thread flavors used in re-setting the T bit.  */
+ #define THREAD_STATE_FLAVOR		i386_REGS_SEGS_STATE
+ #define THREAD_STATE_SIZE		i386_THREAD_STATE_COUNT
++#ifdef __x86_64__
++#define THREAD_STATE_SET_TRACED(state) \
++	((struct i386_thread_state *) (state))->rfl |= 0x100
++#define THREAD_STATE_CLEAR_TRACED(state) \
++	((((struct i386_thread_state *) (state))->rfl &= ~0x100), 1)
++#else
+ #define THREAD_STATE_SET_TRACED(state) \
+   	((struct i386_thread_state *) (state))->efl |= 0x100
+ #define THREAD_STATE_CLEAR_TRACED(state) \
+   	((((struct i386_thread_state *) (state))->efl &= ~0x100), 1)
++#endif /* __x86_64__ */
+ 
+ #endif /* CONFIG_I386_NM_I386GNU_H */
+diff --git a/gdb/config/i386/i386gnu.mn b/gdb/config/i386/x86-gnu.mn
+similarity index 100%
+rename from gdb/config/i386/i386gnu.mn
+rename to gdb/config/i386/x86-gnu.mn
+diff --git a/gdb/configure.host b/gdb/configure.host
+index da71675b201..999af8e59ae 100644
+--- a/gdb/configure.host
++++ b/gdb/configure.host
+@@ -184,6 +184,7 @@ x86_64-*-mingw*)        gdb_host=mingw64
+ 			gdb_host_obs=mingw-hdep.o
+ 			;;
+ x86_64-*-cygwin*)	gdb_host=cygwin64 ;;
++x86_64-*-gnu*)		gdb_host=gnu64 ;;
+ m32r*-*-linux*)          gdb_host=linux ;;
+ 
+ xtensa*-*-linux*)	gdb_host=linux ;;
+diff --git a/gdb/configure.nat b/gdb/configure.nat
+index 8b98511cef7..00402f888a9 100644
+--- a/gdb/configure.nat
++++ b/gdb/configure.nat
+@@ -211,23 +211,44 @@ case ${gdb_host} in
+ 		;;
+ 	esac
+ 	;;
++    gnu64)
++	case ${gdb_host_cpu} in
++	    i386)
++		# Host: x86_64 running the GNU Hurd
++		NATDEPFILES='x86-gnu-nat.o gnu-nat.o \
++		     x86-nat.o nat/x86-dregs.o \
++		     amd64-nat.o fork-child.o \
++		     nat/fork-inferior.o \
++		     notify_S.o process_reply_S.o msg_reply_S.o \
++		     msg_U.o exc_request_U.o exc_request_S.o'
++		HAVE_NATIVE_GCORE_HOST=1
++
++		NAT_FILE='nm-x86-gnu.h'
++		MH_CFLAGS='-D_GNU_SOURCE'
++
++		XM_CLIBS='-lshouldbeinlibc'
++
++		nat_makefile_frag="${srcdir}/config/${gdb_host_cpu}/x86-gnu.mn"
++		;;
++	esac
++	;;
+     i386gnu)
+ 	case ${gdb_host_cpu} in
+ 	    i386)
+ 		# Host: Intel 386 running the GNU Hurd
+-		NATDEPFILES='i386-gnu-nat.o gnu-nat.o \
++		NATDEPFILES='x86-gnu-nat.o gnu-nat.o \
+ 		     x86-nat.o nat/x86-dregs.o fork-child.o \
+ 		     nat/fork-inferior.o \
+ 		     notify_S.o process_reply_S.o msg_reply_S.o \
+ 		     msg_U.o exc_request_U.o exc_request_S.o'
+ 		HAVE_NATIVE_GCORE_HOST=1
+ 
+-		NAT_FILE='nm-i386gnu.h'
++		NAT_FILE='nm-x86-gnu.h'
+ 		MH_CFLAGS='-D_GNU_SOURCE'
+ 
+ 		XM_CLIBS='-lshouldbeinlibc'
+ 
+-		nat_makefile_frag="${srcdir}/config/${gdb_host_cpu}/i386gnu.mn"
++		nat_makefile_frag="${srcdir}/config/${gdb_host_cpu}/x86-gnu.mn"
+ 		;;
+ 	esac
+ 	;;
+diff --git a/gdb/configure.tgt b/gdb/configure.tgt
+index 47a674201f9..df9e9917ad1 100644
+--- a/gdb/configure.tgt
++++ b/gdb/configure.tgt
+@@ -328,7 +328,7 @@ i[34567]86-*-linux*)
+ 	;;
+ i[34567]86-*-gnu*)
+ 	# Target: Intel 386 running the GNU Hurd
+-	gdb_target_obs="i386-gnu-tdep.o solib-svr4.o"
++	gdb_target_obs="i386-gnu-tdep.o glibc-tdep.o solib-svr4.o"
+ 	;;
+ i[34567]86-*-cygwin*)
+ 	# Target: Intel 386 running win32
+@@ -744,6 +744,10 @@ x86_64-*-openbsd*)
+ x86_64-*-rtems*)
+ 	gdb_target_obs="${amd64_tobjs} ${i386_tobjs} i386-bsd-tdep.o"
+ 	;;
++x86_64-*-gnu*)
++	# Target: x86_64 running the GNU Hurd
++	gdb_target_obs="amd64-gnu-tdep.o glibc-tdep.o solib-svr4.o"
++	;;
+ xtensa*-*-*linux*)
+ 	# Target: GNU/Linux Xtensa
+ 	gdb_target_obs="xtensa-linux-tdep.o symfile-mem.o linux-tdep.o"
+diff --git a/gdb/i386-gnu-tdep.c b/gdb/i386-gnu-tdep.c
+index 98e11518a91..5ffc1388ec0 100644
+--- a/gdb/i386-gnu-tdep.c
++++ b/gdb/i386-gnu-tdep.c
+@@ -21,6 +21,7 @@
+ #include "osabi.h"
+ #include "solib-svr4.h"
+ 
++#include "glibc-tdep.h"
+ #include "i386-tdep.h"
+ 
+ /* Recognizing signal handler frames.  */
+@@ -72,8 +73,7 @@ i386_gnu_sigtramp_start (const frame_info_ptr &this_frame)
+   return pc;
+ }
+ 
+-/* Return whether THIS_FRAME corresponds to a GNU/Linux sigtramp
+-   routine.  */
++/* Return whether THIS_FRAME corresponds to a Hurd sigtramp routine.  */
+ 
+ static int
+ i386_gnu_sigtramp_p (const frame_info_ptr &this_frame)
+@@ -178,9 +178,18 @@ i386gnu_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+   /* GNU uses ELF.  */
+   i386_elf_init_abi (info, gdbarch);
+ 
++  /* Hurd uses SVR4-style shared libraries.  */
++  set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
+   set_solib_svr4_fetch_link_map_offsets
+     (gdbarch, svr4_ilp32_fetch_link_map_offsets);
+ 
++  /* Hurd uses the dynamic linker included in the GNU C Library.  */
++  set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
++
++  /* Enable TLS support.  */
++  set_gdbarch_fetch_tls_load_module_address (gdbarch,
++					     svr4_fetch_objfile_link_map);
++
+   tdep->gregset_reg_offset = i386gnu_gregset_reg_offset;
+   tdep->gregset_num_regs = ARRAY_SIZE (i386gnu_gregset_reg_offset);
+   tdep->sizeof_gregset = 19 * 4;
+diff --git a/gdb/i386-gnu-nat.c b/gdb/x86-gnu-nat.c
+similarity index 68%
+rename from gdb/i386-gnu-nat.c
+rename to gdb/x86-gnu-nat.c
+index 52d4a4b7cec..da3b7e923dd 100644
+--- a/gdb/i386-gnu-nat.c
++++ b/gdb/x86-gnu-nat.c
+@@ -34,7 +34,13 @@ extern "C"
+ #include "floatformat.h"
+ #include "regcache.h"
+ 
++
++#ifdef __x86_64__
++#include "amd64-tdep.h"
++#include "amd64-nat.h"
++#else
+ #include "i386-tdep.h"
++#endif
+ 
+ #include "inf-child.h"
+ #include "i387-tdep.h"
+@@ -42,21 +48,82 @@ extern "C"
+ /* Offset to the thread_state_t location where REG is stored.  */
+ #define REG_OFFSET(reg) offsetof (struct i386_thread_state, reg)
+ 
++#ifdef __x86_64__
++
+ /* At REG_OFFSET[N] is the offset to the thread_state_t location where
+    the GDB register N is stored.  */
+-static int reg_offset[] =
++static int amd64_gnu_thread_state_reg_offset[] =
+ {
+-  REG_OFFSET (eax), REG_OFFSET (ecx), REG_OFFSET (edx), REG_OFFSET (ebx),
+-  REG_OFFSET (uesp), REG_OFFSET (ebp), REG_OFFSET (esi), REG_OFFSET (edi),
+-  REG_OFFSET (eip), REG_OFFSET (efl), REG_OFFSET (cs), REG_OFFSET (ss),
+-  REG_OFFSET (ds), REG_OFFSET (es), REG_OFFSET (fs), REG_OFFSET (gs)
++  REG_OFFSET (rax),		/* %rax */
++  REG_OFFSET (rbx),		/* %rbx */
++  REG_OFFSET (rcx),		/* %rcx */
++  REG_OFFSET (rdx),		/* %rdx */
++  REG_OFFSET (rsi),		/* %rsi */
++  REG_OFFSET (rdi),		/* %rdi */
++  REG_OFFSET (rbp),		/* %rbp */
++  REG_OFFSET (ursp),	/* %rsp */
++  REG_OFFSET (r8),		/* %r8 ...  */
++  REG_OFFSET (r9),
++  REG_OFFSET (r10),
++  REG_OFFSET (r11),
++  REG_OFFSET (r12),
++  REG_OFFSET (r13),
++  REG_OFFSET (r14),
++  REG_OFFSET (r15),		/* ... %r15 */
++  REG_OFFSET (rip),		/* %rip */
++  REG_OFFSET (rfl),		/* %rflags */
++  REG_OFFSET (cs)	    /* %cs */
+ };
+ 
+-#define REG_ADDR(state, regnum) ((char *)(state) + reg_offset[regnum])
++static const int amd64_gnu_thread_state_num_regs =
++  ARRAY_SIZE (amd64_gnu_thread_state_reg_offset);
++
++#define REG_ADDR(state, regnum) \
++  ((char *)(state) + amd64_gnu_thread_state_reg_offset[regnum])
++#define VALID_REGISTER(regnum) \
++  ((regnum) >= 0 && (regnum) < amd64_gnu_thread_state_num_regs)
++#define NUM_GREGS amd64_gnu_thread_state_num_regs
++#define FLAGS_REGISTER rfl
++
++#else
++
++/* At REG_OFFSET[N] is the offset to the thread_state_t location where
++   the GDB register N is stored.  */
++static int i386_gnu_thread_state_reg_offset[] =
++{
++  REG_OFFSET (eax),	/* %eax */
++  REG_OFFSET (ecx),	/* %ecx */
++  REG_OFFSET (edx),	/* %edx */
++  REG_OFFSET (ebx),	/* %ebx */
++  REG_OFFSET (uesp),	/* %esp */
++  REG_OFFSET (ebp),	/* %ebp */
++  REG_OFFSET (esi),	/* %esi */
++  REG_OFFSET (edi),	/* %edi */
++  REG_OFFSET (eip),	/* %eip */
++  REG_OFFSET (efl),	/* %efl */
++  REG_OFFSET (cs),	/* %cs */
++  REG_OFFSET (ss),	/* %ss */
++  REG_OFFSET (ds),	/* %ds */
++  REG_OFFSET (es),	/* %es */
++  REG_OFFSET (fs),	/* %fs */
++  REG_OFFSET (gs)	/* gs */
++};
++
++static const int i386_gnu_thread_state_num_regs =
++  ARRAY_SIZE (i386_gnu_thread_state_reg_offset);
++
++#define REG_ADDR(state, regnum) \
++  ((char *)(state) + i386_gnu_thread_state_reg_offset[regnum])
++#define VALID_REGISTER(regnum) \
++  ((regnum) >= 0 && (regnum) < i386_gnu_thread_state_num_regs)
++#define NUM_GREGS i386_gnu_thread_state_num_regs
++#define FLAGS_REGISTER efl
++
++#endif  /* __x86_64__ */
+ 
+ \f
+ 
+-/* The i386 GNU Hurd target.  */
++/* The x86 GNU Hurd target.  */
+ 
+ #ifdef i386_DEBUG_STATE
+ using gnu_base_target = x86_nat_target<gnu_nat_target>;
+@@ -64,13 +131,13 @@ using gnu_base_target = x86_nat_target<gnu_nat_target>;
+ using gnu_base_target = gnu_nat_target;
+ #endif
+ 
+-struct i386_gnu_nat_target final : public gnu_base_target
++struct x86_gnu_nat_target final : public gnu_base_target
+ {
+   void fetch_registers (struct regcache *, int) override;
+   void store_registers (struct regcache *, int) override;
+ };
+ 
+-static i386_gnu_nat_target the_i386_gnu_nat_target;
++static x86_gnu_nat_target the_x86_gnu_nat_target;
+ 
+ /* Get the whole floating-point state of THREAD and record the values
+    of the corresponding (pseudo) registers.  */
+@@ -105,7 +172,7 @@ fetch_fpregs (struct regcache *regcache, struct proc *thread)
+ 
+ /* Fetch register REGNO, or all regs if REGNO is -1.  */
+ void
+-i386_gnu_nat_target::fetch_registers (struct regcache *regcache, int regno)
++x86_gnu_nat_target::fetch_registers (struct regcache *regcache, int regno)
+ {
+   struct proc *thread;
+   ptid_t ptid = regcache->ptid ();
+@@ -118,7 +185,7 @@ i386_gnu_nat_target::fetch_registers (struct regcache *regcache, int regno)
+     error (_("Can't fetch registers from thread %s: No such thread"),
+ 	   target_pid_to_str (ptid).c_str ());
+ 
+-  if (regno < I386_NUM_GREGS || regno == -1)
++  if (VALID_REGISTER (regno) || regno == -1)
+     {
+       thread_state_t state;
+ 
+@@ -137,7 +204,7 @@ i386_gnu_nat_target::fetch_registers (struct regcache *regcache, int regno)
+ 
+ 	  proc_debug (thread, "fetching all register");
+ 
+-	  for (i = 0; i < I386_NUM_GREGS; i++)
++	  for (i = 0; i < NUM_GREGS; i++)
+ 	    regcache->raw_supply (i, REG_ADDR (state, i));
+ 	  thread->fetched_regs = ~0;
+ 	}
+@@ -152,7 +219,7 @@ i386_gnu_nat_target::fetch_registers (struct regcache *regcache, int regno)
+ 	}
+     }
+ 
+-  if (regno >= I386_NUM_GREGS || regno == -1)
++  if (!VALID_REGISTER(regno) || regno == -1)
+     {
+       proc_debug (thread, "fetching floating-point registers");
+ 
+@@ -195,7 +262,7 @@ store_fpregs (const struct regcache *regcache, struct proc *thread, int regno)
+ 
+ /* Store at least register REGNO, or all regs if REGNO == -1.  */
+ void
+-i386_gnu_nat_target::store_registers (struct regcache *regcache, int regno)
++x86_gnu_nat_target::store_registers (struct regcache *regcache, int regno)
+ {
+   struct proc *thread;
+   struct gdbarch *gdbarch = regcache->arch ();
+@@ -209,7 +276,7 @@ i386_gnu_nat_target::store_registers (struct regcache *regcache, int regno)
+     error (_("Couldn't store registers into thread %s: No such thread"),
+ 	   target_pid_to_str (ptid).c_str ());
+ 
+-  if (regno < I386_NUM_GREGS || regno == -1)
++  if (VALID_REGISTER (regno) || regno == -1)
+     {
+       thread_state_t state;
+       thread_state_data_t old_state;
+@@ -230,14 +297,14 @@ i386_gnu_nat_target::store_registers (struct regcache *regcache, int regno)
+ 
+       /* Save the T bit.  We might try to restore the %eflags register
+ 	 below, but changing the T bit would seriously confuse GDB.  */
+-      trace = ((struct i386_thread_state *)state)->efl & 0x100;
++      trace = ((struct i386_thread_state *)state)->FLAGS_REGISTER & 0x100;
+ 
+       if (!was_aborted && was_valid)
+ 	/* See which registers have changed after aborting the thread.  */
+ 	{
+ 	  int check_regno;
+ 
+-	  for (check_regno = 0; check_regno < I386_NUM_GREGS; check_regno++)
++	  for (check_regno = 0; check_regno < NUM_GREGS; check_regno++)
+ 	    if ((thread->fetched_regs & (1 << check_regno))
+ 		&& memcpy (REG_ADDR (&old_state, check_regno),
+ 			   REG_ADDR (state, check_regno),
+@@ -262,7 +329,7 @@ i386_gnu_nat_target::store_registers (struct regcache *regcache, int regno)
+ 
+ 	  proc_debug (thread, "storing all registers");
+ 
+-	  for (i = 0; i < I386_NUM_GREGS; i++)
++	  for (i = 0; i < NUM_GREGS; i++)
+ 	    if (REG_VALID == regcache->get_register_status (i))
+ 	      regcache->raw_collect (i, REG_ADDR (state, i));
+ 	}
+@@ -276,11 +343,11 @@ i386_gnu_nat_target::store_registers (struct regcache *regcache, int regno)
+ 	}
+ 
+       /* Restore the T bit.  */
+-      ((struct i386_thread_state *)state)->efl &= ~0x100;
+-      ((struct i386_thread_state *)state)->efl |= trace;
++      ((struct i386_thread_state *)state)->FLAGS_REGISTER &= ~0x100;
++      ((struct i386_thread_state *)state)->FLAGS_REGISTER |= trace;
+     }
+ 
+-  if (regno >= I386_NUM_GREGS || regno == -1)
++  if (!VALID_REGISTER (regno) || regno == -1)
+     {
+       proc_debug (thread, "storing floating-point registers");
+ 
+@@ -295,7 +362,7 @@ i386_gnu_nat_target::store_registers (struct regcache *regcache, int regno)
+ /* Get debug registers for thread THREAD.  */
+ 
+ static void
+-i386_gnu_dr_get (struct i386_debug_state *regs, struct proc *thread)
++x86_gnu_dr_get (struct i386_debug_state *regs, struct proc *thread)
+ {
+   mach_msg_type_number_t count = i386_DEBUG_STATE_COUNT;
+   kern_return_t err;
+@@ -310,7 +377,7 @@ i386_gnu_dr_get (struct i386_debug_state *regs, struct proc *thread)
+ /* Set debug registers for thread THREAD.  */
+ 
+ static void
+-i386_gnu_dr_set (const struct i386_debug_state *regs, struct proc *thread)
++x86_gnu_dr_set (const struct i386_debug_state *regs, struct proc *thread)
+ {
+   kern_return_t err;
+ 
+@@ -324,23 +391,23 @@ i386_gnu_dr_set (const struct i386_debug_state *regs, struct proc *thread)
+ /* Set DR_CONTROL in THREAD.  */
+ 
+ static void
+-i386_gnu_dr_set_control_one (struct proc *thread, void *arg)
++x86_gnu_dr_set_control_one (struct proc *thread, void *arg)
+ {
+   unsigned long *control = (unsigned long *) arg;
+   struct i386_debug_state regs;
+ 
+-  i386_gnu_dr_get (&regs, thread);
++  x86_gnu_dr_get (&regs, thread);
+   regs.dr[DR_CONTROL] = *control;
+-  i386_gnu_dr_set (&regs, thread);
++  x86_gnu_dr_set (&regs, thread);
+ }
+ 
+ /* Set DR_CONTROL to CONTROL in all threads.  */
+ 
+ static void
+-i386_gnu_dr_set_control (unsigned long control)
++x86_gnu_dr_set_control (unsigned long control)
+ {
+   inf_update_procs (gnu_current_inf);
+-  inf_threads (gnu_current_inf, i386_gnu_dr_set_control_one, &control);
++  inf_threads (gnu_current_inf, x86_gnu_dr_set_control_one, &control);
+ }
+ 
+ /* Parameters to set a debugging address.  */
+@@ -354,20 +421,20 @@ struct reg_addr
+ /* Set address REGNUM (zero based) to ADDR in THREAD.  */
+ 
+ static void
+-i386_gnu_dr_set_addr_one (struct proc *thread, void *arg)
++x86_gnu_dr_set_addr_one (struct proc *thread, void *arg)
+ {
+   struct reg_addr *reg_addr = (struct reg_addr *) arg;
+   struct i386_debug_state regs;
+ 
+-  i386_gnu_dr_get (&regs, thread);
++  x86_gnu_dr_get (&regs, thread);
+   regs.dr[reg_addr->regnum] = reg_addr->addr;
+-  i386_gnu_dr_set (&regs, thread);
++  x86_gnu_dr_set (&regs, thread);
+ }
+ 
+ /* Set address REGNUM (zero based) to ADDR in all threads.  */
+ 
+ static void
+-i386_gnu_dr_set_addr (int regnum, CORE_ADDR addr)
++x86_gnu_dr_set_addr (int regnum, CORE_ADDR addr)
+ {
+   struct reg_addr reg_addr;
+ 
+@@ -377,13 +444,13 @@ i386_gnu_dr_set_addr (int regnum, CORE_ADDR addr)
+   reg_addr.addr = addr;
+ 
+   inf_update_procs (gnu_current_inf);
+-  inf_threads (gnu_current_inf, i386_gnu_dr_set_addr_one, &reg_addr);
++  inf_threads (gnu_current_inf, x86_gnu_dr_set_addr_one, &reg_addr);
+ }
+ 
+ /* Get debug register REGNUM value from only the one LWP of PTID.  */
+ 
+ static unsigned long
+-i386_gnu_dr_get_reg (ptid_t ptid, int regnum)
++x86_gnu_dr_get_reg (ptid_t ptid, int regnum)
+ {
+   struct i386_debug_state regs;
+   struct proc *thread;
+@@ -392,7 +459,7 @@ i386_gnu_dr_get_reg (ptid_t ptid, int regnum)
+   inf_update_procs (gnu_current_inf);
+ 
+   thread = inf_tid_to_thread (gnu_current_inf, ptid.lwp ());
+-  i386_gnu_dr_get (&regs, thread);
++  x86_gnu_dr_get (&regs, thread);
+ 
+   return regs.dr[regnum];
+ }
+@@ -400,46 +467,50 @@ i386_gnu_dr_get_reg (ptid_t ptid, int regnum)
+ /* Return the inferior's debug register REGNUM.  */
+ 
+ static CORE_ADDR
+-i386_gnu_dr_get_addr (int regnum)
++x86_gnu_dr_get_addr (int regnum)
+ {
+   gdb_assert (DR_FIRSTADDR <= regnum && regnum <= DR_LASTADDR);
+ 
+-  return i386_gnu_dr_get_reg (inferior_ptid, regnum);
++  return x86_gnu_dr_get_reg (inferior_ptid, regnum);
+ }
+ 
+ /* Get DR_STATUS from only the one thread of INFERIOR_PTID.  */
+ 
+ static unsigned long
+-i386_gnu_dr_get_status (void)
++x86_gnu_dr_get_status (void)
+ {
+-  return i386_gnu_dr_get_reg (inferior_ptid, DR_STATUS);
++  return x86_gnu_dr_get_reg (inferior_ptid, DR_STATUS);
+ }
+ 
+ /* Return the inferior's DR7 debug control register.  */
+ 
+ static unsigned long
+-i386_gnu_dr_get_control (void)
++x86_gnu_dr_get_control (void)
+ {
+-  return i386_gnu_dr_get_reg (inferior_ptid, DR_CONTROL);
++  return x86_gnu_dr_get_reg (inferior_ptid, DR_CONTROL);
+ }
+ #endif /* i386_DEBUG_STATE */
+ 
+-void _initialize_i386gnu_nat ();
++void _initialize_x86_gnu_nat ();
+ void
+-_initialize_i386gnu_nat ()
++_initialize_x86_gnu_nat ()
+ {
+ #ifdef i386_DEBUG_STATE
+-  x86_dr_low.set_control = i386_gnu_dr_set_control;
++  x86_dr_low.set_control = x86_gnu_dr_set_control;
+   gdb_assert (DR_FIRSTADDR == 0 && DR_LASTADDR < i386_DEBUG_STATE_COUNT);
+-  x86_dr_low.set_addr = i386_gnu_dr_set_addr;
+-  x86_dr_low.get_addr = i386_gnu_dr_get_addr;
+-  x86_dr_low.get_status = i386_gnu_dr_get_status;
+-  x86_dr_low.get_control = i386_gnu_dr_get_control;
++  x86_dr_low.set_addr = x86_gnu_dr_set_addr;
++  x86_dr_low.get_addr = x86_gnu_dr_get_addr;
++  x86_dr_low.get_status = x86_gnu_dr_get_status;
++  x86_dr_low.get_control = x86_gnu_dr_get_control;
++#ifdef __x86_64__
++  x86_set_debug_register_length (8);
++#else
+   x86_set_debug_register_length (4);
++#endif
+ #endif /* i386_DEBUG_STATE */
+ 
+-  gnu_target = &the_i386_gnu_nat_target;
++  gnu_target = &the_x86_gnu_nat_target;
+ 
+   /* Register the target.  */
+-  add_inf_child_target (&the_i386_gnu_nat_target);
++  add_inf_child_target (&the_x86_gnu_nat_target);
+ }
+-- 
+2.46.0
+
+From 7cfe6f639e601d6cca567342360ecbd3cdca128c Mon Sep 17 00:00:00 2001
+From: Flavio Cruz <flaviocruz@gmail.com>
+Date: Wed, 3 Jul 2024 23:05:06 +0100
+Subject: [PATCH 2/2] Hurd: do not include defs.h when compiling MiG stubs
+ since they are compiled as C files
+
+Otherwise, GDB will fail to compile for Hurd.
+---
+ gdb/Makefile.in            | 3 ++-
+ gdb/config/i386/x86-gnu.mn | 4 +++-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/Makefile.in b/gdb/Makefile.in
+index 67a15e2cc68..d847a8bad72 100644
+--- a/gdb/Makefile.in
++++ b/gdb/Makefile.in
+@@ -603,11 +603,12 @@ CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
+ # your system doesn't have fcntl.h in /usr/include (which is where it
+ # should be according to Posix).
+ DEFS = @DEFS@
++GDB_INCLUDED_HEADER = -include $(srcdir)/defs.h
+ GDB_CFLAGS = \
+ 	-I. \
+ 	-I$(srcdir) \
+ 	-I$(srcdir)/config \
+-	-include $(srcdir)/defs.h \
++	$(GDB_INCLUDED_HEADER) \
+ 	-DLOCALEDIR="\"$(localedir)\"" \
+ 	$(DEFS)
+ 
+diff --git a/gdb/config/i386/x86-gnu.mn b/gdb/config/i386/x86-gnu.mn
+index b7414e3bcb4..24c58b02e98 100644
+--- a/gdb/config/i386/x86-gnu.mn
++++ b/gdb/config/i386/x86-gnu.mn
+@@ -21,7 +21,9 @@ MIGCOM = $(MIG) -cc cat - /dev/null
+ 	| $(MIGCOM) -sheader /dev/null -server /dev/null -user $*_U.c -header $*_U.h
+ 
+ # MIG stubs are not yet ready for C++ compilation.
+-%_S.o %_U.o : COMPILE.post += -x c -include gnu-nat-mig.h
++%_S.o %_U.o : COMPILE.post += -x c
++# Do not include defs.h since it requires C++. Rather include our own gnu-nat-mig.h
++%_S.o %_U.o : GDB_INCLUDED_HEADER = -include gnu-nat-mig.h
+ 
+ NAT_GENERATED_FILES = notify_S.h notify_S.c \
+ 	process_reply_S.h process_reply_S.c \
+-- 
+2.46.0
+
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 49/58] gnu: bootstrap: %bootstrap-glibc: Also fix libm.so.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (47 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 48/58] gnu: Add gdb-15.2, with support for the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 50/58] system: examples: Add bare-hurd64.tmpl Janneke Nieuwenhuizen
                     ` (8 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Ludovic Courtès

On the 64bit Hurd, glibc-2.39's libm.so is also a linker script.  This fixes
having it refer to

    /gnu/store/eee...-glibc-cross-x86_64-pc-gnu-2.39/lib/libm.so.6
    /gnu/store/eee...-glibc-cross-x86_64-pc-gnu-2.39/lib/libmvec.so.1

* gnu/packages/bootstrap.scm (%bootstrap-glibc)[arguments]: When building for
the 64bit Hurd, also substitute libm.so linker script.  Update the regexp to
also cater for libh[urduser] and libm[achuser].

Change-Id: I878e63d18f1012b6e186e90eb68cb97bec5ae94c
---
 gnu/packages/bootstrap.scm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 8027918323..a6cdda2122 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -774,12 +774,12 @@ (define %bootstrap-glibc
                                      "/binaries.tar"))
               (chmod "lib" #o755)
 
-              ;; Patch libc.so so it refers to the right path.
-              (substitute* "lib/libc.so"
-                (("/[^ ]+/lib/(libc|ld)" _ prefix)
-                 (string-append out "/lib/" prefix)))
-
-              #t))))))
+              ;; Patch linker scripts so they refer to the right file-names.
+              (substitute* ,(if (target-hurd64?)
+                                ''("lib/libc.so" "lib/libm.so")
+                                "lib/libc.so")
+                (("/[^ ]+/lib/(libc|libm|libh|ld)" _ prefix)
+                 (string-append out "/lib/" prefix)))))))))
     (inputs
      `(("tar" ,(bootstrap-executable "tar" (%current-system)))
        ("xz"  ,(bootstrap-executable "xz" (%current-system)))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 50/58] system: examples: Add bare-hurd64.tmpl.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (48 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 49/58] gnu: bootstrap: %bootstrap-glibc: Also fix libm.so Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 51/58] system: examples: Add devel-hurd64.tmpl Janneke Nieuwenhuizen
                     ` (7 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290

* gnu/system/examples/bare-hurd.tmpl: Update comments.
* gnu/system/examples/bare-hurd64.tmpl: New file.

Change-Id: I8d26afd19afaa8fb3558948b50b0efdc0f83f29c
---
 gnu/system/examples/bare-hurd.tmpl   | 21 +++++----
 gnu/system/examples/bare-hurd64.tmpl | 70 ++++++++++++++++++++++++++++
 2 files changed, 82 insertions(+), 9 deletions(-)
 create mode 100644 gnu/system/examples/bare-hurd64.tmpl

diff --git a/gnu/system/examples/bare-hurd.tmpl b/gnu/system/examples/bare-hurd.tmpl
index 68c6d3c166..9bfa776769 100644
--- a/gnu/system/examples/bare-hurd.tmpl
+++ b/gnu/system/examples/bare-hurd.tmpl
@@ -3,23 +3,26 @@
 ;; This is an operating system configuration template
 ;; for a "bare bones" QEMU setup, with no X11 display server.
 
-;; To build a disk image for a virtual machine, do
+;; To build a disk image for a virtual machine, do:
 ;;
-;;     ./pre-inst-env guix system image --image-type=hurd-raw \
+;;     ./pre-inst-env guix system image --image-type=hurd-qcow2 \
 ;;         gnu/system/examples/bare-hurd.tmpl
 ;;
-;; You may run it like so
+;; You may run it like so:
 ;;
-;;     guix shell qemu -- qemu-system-i386 -enable-kvm -m 2048 \
-;;      -device rtl8139,netdev=net0 -netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222 \
-;;      -snapshot -hda <the-image>
+;;     guix shell qemu -- qemu-system-i386 -m 2048                \
+;;       --enable-kvm                                             \
+;;       --device e1000,netdev=net0                               \
+;;       --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222  \
+;;       --snapshot
+;;       --hda /gnu/store/...-disk-image
 ;;
-;; and use it like
+;; and use it like:
 ;;
 ;;     ssh -p 10022 root@localhost
 ;;     guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
 ;;
-;; or even (if you use --image-size=3G)
+;; or even, if you build the image with at least --image-size=3G:
 ;;
 ;;     guix build hello
 
@@ -34,7 +37,7 @@
                  (bootloader grub-minimal-bootloader)
                  (targets '("/dev/sdX"))))
     (file-systems (cons (file-system
-                          (device (file-system-label "my-root"))
+                          (device (file-system-label "hurd"))
                           (mount-point "/")
                           (type "ext2"))
                         %base-file-systems))
diff --git a/gnu/system/examples/bare-hurd64.tmpl b/gnu/system/examples/bare-hurd64.tmpl
new file mode 100644
index 0000000000..89811e458a
--- /dev/null
+++ b/gnu/system/examples/bare-hurd64.tmpl
@@ -0,0 +1,70 @@
+;; -*-scheme-*-
+
+;; This is an operating system configuration template
+;; for a "bare bones" QEMU setup, with no X11 display server.
+
+;; To build a disk image for a virtual machine, do:
+;;
+;;     ./pre-inst-env guix system image --image-type=hurd64-qcow2 \
+;;         gnu/system/examples/bare-hurd64.tmpl
+;;
+;; You may run it like so:
+;;
+;;     guix shell qemu@7 -- qemu-system-x86_64 -m 2048            \
+;;       --machine q35                                            \
+;;       --enable-kvm                                             \
+;;       --device e1000,netdev=net0                               \
+;;       --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222  \
+;;       --snapshot
+;;       --hda /gnu/store/...-disk-image
+;;
+;; and use it like:
+;;
+;;     ssh -p 10022 root@localhost
+;;     guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
+;;
+;; or even, if you build the image with at least --image-size=3G:
+;;
+;;     guix build hello
+
+(use-modules (gnu) (gnu system hurd) (guix utils))
+(use-service-modules ssh)
+(use-package-modules ssh)
+
+(define %hurd64-os
+  (operating-system
+    (inherit %hurd64-default-operating-system)
+    (bootloader (bootloader-configuration
+                 (bootloader grub-minimal-bootloader)
+                 (targets '("/dev/sdX"))))
+    (kernel-arguments '("noide")) ;use rumpdisk
+    (file-systems (cons (file-system
+                          (device (file-system-label "hurd"))
+                          (mount-point "/")
+                          (type "ext2"))
+                        %base-file-systems))
+    (host-name "guixygnu64")
+    (timezone "Europe/Amsterdam")
+    (users (cons (user-account
+                  (name "guix")
+                  (comment "Anonymous Hurd Hacker")
+                  (group "users")
+                  (supplementary-groups '("wheel")))
+                 %base-user-accounts))
+    (packages (cons openssh-sans-x %base-packages/hurd))
+    (services (cons (service openssh-service-type
+                             (openssh-configuration
+                              (openssh openssh-sans-x)
+                              (port-number 2222)
+                              (permit-root-login #t)
+                              (allow-empty-passwords? #t)
+                              (password-authentication? #t)))
+                    ;; For installing on a real (non-QEMU) machine, use:
+                    ;; (static-networking-service-type
+                    ;;   (list %loopback-static-networking
+                    ;;        (static-networking
+                    ;;         ...)))
+                    ;; %base-services/hurd
+                    %base-services+qemu-networking/hurd))))
+
+%hurd64-os
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 51/58] system: examples: Add devel-hurd64.tmpl.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (49 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 50/58] system: examples: Add bare-hurd64.tmpl Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 52/58] gnu: Use gcc-14, gcc-toolchain-14 on the 64bit Hurd Janneke Nieuwenhuizen
                     ` (6 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290

This also updates comments and removes the comment about a very old
`bootstrap-profile' hack.

* gnu/system/examples/devel-hurd.tmpl (hurd-packages): New variable
(%hurd-devel-os): Use it.
* gnu/system/examples/devel-hurd64.tmpl: New file.

Change-Id: I54b6b0843f0dd635d89cca483ae43d23b20d21e8
---
 gnu/system/examples/devel-hurd.tmpl   | 70 +++++++++++----------------
 gnu/system/examples/devel-hurd64.tmpl | 65 +++++++++++++++++++++++++
 2 files changed, 93 insertions(+), 42 deletions(-)
 create mode 100644 gnu/system/examples/devel-hurd64.tmpl

diff --git a/gnu/system/examples/devel-hurd.tmpl b/gnu/system/examples/devel-hurd.tmpl
index 3dca0706d1..066bdfe9d8 100644
--- a/gnu/system/examples/devel-hurd.tmpl
+++ b/gnu/system/examples/devel-hurd.tmpl
@@ -3,7 +3,7 @@
 ;; This is an operating system configuration template for a "bare bones
 ;; development" setup, with no X11 display server.
 
-;; To build a disk image for a virtual machine, do
+;; To build a disk image for a virtual machine, do something like:
 ;;
 ;;   ./pre-inst-env guix system image --image-type=hurd-qcow2 --image-size=6G \
 ;;      --no-offload gnu/system/examples/devel-hurd.tmpl
@@ -11,41 +11,38 @@
 ;; You may run it like so
 ;;
 ;;     cp /gnu/store/.../disk-image devel-hurd.img
-;;     guix shell qemu -- qemu-system-i386 -enable-kvm -m 4096 \
-;;      -device rtl8139,netdev=net0                            \
-;;      -netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222 \
-;;      -hda devel-hurd.img
-;;
-;; and use it like
+;;     guix shell qemu -- qemu-system-i386 -m 4096                \
+;;       --enable-kvm                                             \
+;;       --device e1000,netdev=net0                               \
+;;       --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222  \
+;;       --hda devel-hurd.img
 ;;
 ;;     ssh -p 10022 root@localhost
 ;;     guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
 ;;
-;; or even (if you use --image-size=3G)
+;; or even:
 ;;
 ;;     guix build hello
 ;;
-;; Building Guix, do something like:
+;; For Guix hacking, do something like:
 ;;
-;;     GUIX_PROFILE=/run/current-system/bootstrap-profile
-;;     source $GUIX_PROFILE/etc/profile
+;;     guix shell --boostrap -D guix
 ;;     mkdir -p ~/src/guix
 ;;     cd src/guix
 ;;     git clone https://git.savannah.gnu.org/git/guix.git master
 ;;     cd master
 ;;     ./bootstrap
-;;     ./configure --with-courage
+;;     ./configure
 ;;     make
 
+(include "bare-hurd.tmpl")
+
 (use-modules (srfi srfi-1)
              (ice-9 match)
-             (gnu)
              (gnu system hurd)
-             (gnu system locale)
              (guix packages)
-             (guix store)
-             (guix utils))
-(use-service-modules ssh virtualization)
+             (guix store))
+
 (use-package-modules base compression file gawk gdb hurd less m4
                      package-management ssh version-control)
 
@@ -64,23 +61,23 @@
                     ;; These are not essential and do not build yet.
                     '("graphviz" "guile-avahi" "po4a"))))
 
+(define hurd-packages
+  (filter-map input->package
+              (fold alist-delete (package-direct-inputs hurd)
+                    ;; These are not essential, rumpkernel is very big.
+                    '("dde-sources" "parted" "rumpkernel" "util-linux"
+                      "texinfo"))))
+
 (define %hurd-devel-os
   (operating-system
-    (inherit %hurd-vm-operating-system)
-    (host-name "guixydevel")
+    (inherit %hurd-os)
+    (bootloader (bootloader-configuration
+                 (bootloader grub-minimal-bootloader)
+                 (targets '("/dev/sdX"))
+                 (timeout 0)))
     (timezone "Europe/Berlin")
-    (file-systems (cons (file-system
-                          (device (file-system-label "hurd"))
-                          (mount-point "/")
-                          (type "ext2"))
-                        %base-file-systems))
     (swap-devices (list (swap-space
                           (target "/swapfile"))))
-    (users (cons (user-account
-                  (name "guix")
-                  (group "users")
-                  (supplementary-groups '("wheel")))
-                 %base-user-accounts))
     (packages (cons*
                gdb-minimal
                git-minimal
@@ -89,18 +86,7 @@
                openssh-sans-x
                (append
                 guix-packages
-                %base-packages/hurd)))
-    (services (cons*
-               (modify-services (operating-system-user-services
-                                 %hurd-vm-operating-system)
-                 (openssh-service-type
-                  config =>
-                  ;; Set wide open
-                  (openssh-configuration
-                   (openssh openssh-sans-x)
-                   (port-number 2222)
-                   (permit-root-login #t)
-                   (allow-empty-passwords? #t)
-                   (password-authentication? #t))))))))
+                hurd-packages
+                %base-packages/hurd)))))
 
 %hurd-devel-os
diff --git a/gnu/system/examples/devel-hurd64.tmpl b/gnu/system/examples/devel-hurd64.tmpl
new file mode 100644
index 0000000000..146a35adcf
--- /dev/null
+++ b/gnu/system/examples/devel-hurd64.tmpl
@@ -0,0 +1,65 @@
+;; -*-scheme-*-
+
+;; This is an operating system configuration template
+;; for a "bare bones" QEMU setup, with no X11 display server.
+
+;; To build a disk image for a virtual machine, do:
+;;
+;;   ./pre-inst-env guix system image --image-type=hurd-qcow2 --image-size=6G \
+;;      --no-offload gnu/system/examples/devel-hurd64.tmpl
+;;
+;; You may run it like so:
+;;
+;;     cp /gnu/store/.../disk-image devel-hurd.img
+;;     guix shell qemu@7 -- qemu-system-x86_64 -m 4096            \
+;;       --machine q35                                            \
+;;       --enable-kvm                                             \
+;;       --device e1000,netdev=net0                               \
+;;       --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222  \
+;;       --hda devel-hurd.img
+;;
+;; and use it like:
+;;
+;;     ssh -p 10022 root@localhost
+;;     guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
+;;
+;; or even:
+;;
+;;     guix build hello
+;;
+;; For Guix hacking, do something like:
+;;
+;;     guix shell --boostrap -D guix
+;;     mkdir -p ~/src/guix
+;;     cd src/guix
+;;     git clone git clone git://git.savannah.gnu.org/guix
+;;     cd master
+;;     ./bootstrap
+;;     ./configure
+;;     make
+
+(include "devel-hurd.tmpl")
+(include "bare-hurd64.tmpl")
+
+(define %hurd64-devel-os
+  (operating-system
+    (inherit %hurd64-os)
+    (bootloader (bootloader-configuration
+                 (bootloader grub-minimal-bootloader)
+                 (targets '("/dev/sdX"))
+                 (timeout 0)))
+    (timezone "Europe/Berlin")
+    (swap-devices (list (swap-space
+                          (target "/swapfile"))))
+    (packages (cons*
+               gdb-minimal-15
+               git-minimal
+               gnu-make
+               m4
+               openssh-sans-x
+               (append
+                guix-packages
+                hurd-packages
+                %base-packages/hurd)))))
+
+%hurd64-devel-os
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 52/58] gnu: Use gcc-14, gcc-toolchain-14 on the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (50 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 51/58] system: examples: Add devel-hurd64.tmpl Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 53/58] gnu: commencement: kernel-headers-boot0: Support " Janneke Nieuwenhuizen
                     ` (5 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290
  Cc: Andreas Enge, Christopher Baines, Efraim Flashner, Ekaitz Zarraga,
	Josselin Poiret, Ludovic Courtès, Mathieu Othacehe,
	Simon Tournier, Tobias Geerinckx-Rice

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))
 
 \f
 ;;;
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





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 53/58] gnu: commencement: kernel-headers-boot0: Support the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (51 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 52/58] gnu: Use gcc-14, gcc-toolchain-14 on the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 54/58] gnu: hurd: Add refcounts-assert patch Janneke Nieuwenhuizen
                     ` (4 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (kernel-headers-boot0): Match using
target-hurd? rather than "i586-gnu".

Change-Id: I3c05f110674e55c97d6712202da9d9af6c1d953f
---
 gnu/packages/commencement.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 3f11bb3384..dab65c7ca1 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2742,7 +2742,7 @@ (define/system-dependent hurd-core-headers-boot0
 
 (define* (kernel-headers-boot0 #:optional (system (%current-system)))
   (match system
-    ("i586-gnu" hurd-core-headers-boot0)
+    ((? target-hurd?) hurd-core-headers-boot0)
     (_ linux-libre-headers-boot0)))
 
 (define texinfo-boot0
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 54/58] gnu: hurd: Add refcounts-assert patch.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (52 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 53/58] gnu: commencement: kernel-headers-boot0: Support " Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 55/58] gnu: bootstrap: %bootstrap-gcc: Also wrap g++ for the 64bit Hurd Janneke Nieuwenhuizen
                     ` (3 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290

See <https://logs.guix.gnu.org/hurd/2024-11-20.log#082237>.

* gnu/packages/patches/hurd-refcounts-assert.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hurd.scm (hurd): Use it.

Change-Id: I51ee319f1b7e26a7ed0f4e9f69755aa596ea6877
---
 gnu/local.mk                                  |  1 +
 gnu/packages/hurd.scm                         |  3 ++-
 .../patches/hurd-refcounts-assert.patch       | 26 +++++++++++++++++++
 3 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/hurd-refcounts-assert.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 08314ade22..c75345ee93 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1556,6 +1556,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/hubbub-sort-entities.patch		\
   %D%/packages/patches/hueplusplus-mbedtls.patch		\
   %D%/packages/patches/hurd-64bit.patch				\
+  %D%/packages/patches/hurd-refcounts-assert.patch		\
   %D%/packages/patches/hurd-rumpdisk-no-hd.patch		\
   %D%/packages/patches/hurd-startup.patch			\
   %D%/packages/patches/hwloc-1-test-btrfs.patch			\
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 63249b4ef7..61833219c4 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -316,7 +316,8 @@ (define-public hurd
     (name "hurd")
     (source (origin
               (inherit (package-source hurd-headers))
-              (patches (search-patches "hurd-rumpdisk-no-hd.patch"
+              (patches (search-patches "hurd-refcounts-assert.patch"
+                                       "hurd-rumpdisk-no-hd.patch"
                                        "hurd-startup.patch"
                                        "hurd-64bit.patch"))))
     (version (package-version hurd-headers))
diff --git a/gnu/packages/patches/hurd-refcounts-assert.patch b/gnu/packages/patches/hurd-refcounts-assert.patch
new file mode 100644
index 0000000000..fe6d5e814f
--- /dev/null
+++ b/gnu/packages/patches/hurd-refcounts-assert.patch
@@ -0,0 +1,26 @@
+Upstream-status: Taken from <https://salsa.debian.org/hurd-team/hurd/-/blob/12f30157cc381a1987d5a2464a9c30092241aad1/debian/patches/libports-iterate-refcount.patch>.
+
+libports-iterate-refcount.patch>
+
+http://lists.gnu.org/archive/html/bug-hurd/2016-03/msg00034.html
+
+diff --git a/libports/bucket-iterate.c b/libports/bucket-iterate.c
+index b021b99..76dc3f7 100644
+--- a/libports/bucket-iterate.c
++++ b/libports/bucket-iterate.c
+@@ -58,7 +58,14 @@ _ports_bucket_class_iterate (struct hurd_ihash *ht,
+ 
+       if (class == 0 || pi->class == class)
+ 	{
+-	  refcounts_ref (&pi->refcounts, NULL);
++	  struct references result;
++	  refcounts_unsafe_ref (&pi->refcounts, &result);
++	  if (result.hard == 1 && result.weak == 0)
++	  {
++	    /* This one is on its way out, skip it.  */
++	    refcounts_deref (&pi->refcounts, NULL);
++	    continue;
++	  }
+ 	  p[n] = pi;
+ 	  n++;
+ 	}
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 55/58] gnu: bootstrap: %bootstrap-gcc: Also wrap g++ for the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (53 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 54/58] gnu: hurd: Add refcounts-assert patch Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 56/58] gnu: commencement: libstdc++-boot0: Support " Janneke Nieuwenhuizen
                     ` (2 subsequent siblings)
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290; +Cc: Efraim Flashner, Andreas Enge, Ludovic Courtès

* gnu/packages/bootstrap.scm (%bootstrap-gcc)[arguments] When building for
thee 64bit Hurd have the #:builder also wrap g++.

Co-authored-by: Efraim Flashner <efraim@flashner.co.il>

Change-Id: I2cdbc6837e1c451f108b309f2608240a7f57b82c
---
 gnu/packages/bootstrap.scm | 35 +++++++++++++++++++++--------------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index a6cdda2122..48c7b42cc9 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -866,29 +866,36 @@ (define %bootstrap-gcc
                (tarball (assoc-ref %build-inputs "tarball")))
 
            (mkdir out)
-           (copy-file tarball "binaries.tar.xz")
+           (copy-file tarball "binaries.tar.xz") ;avoid: more than one hard link
            (invoke xz "-d" "binaries.tar.xz")
            (let ((builddir (getcwd))
                  (bindir   (string-append out "/bin")))
+
+             (define (wrap-program program)
+               (let ((wrapped (format #f ".~a-wrapped" program)))
+                 (rename-file program wrapped)
+                 (call-with-output-file program
+                   (lambda (p)
+                     (format p "#!~a
+exec ~a/bin/~a -B~a/lib \
+     -Wl,-rpath -Wl,~a/lib \
+     -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
+                             bash
+                             out wrapped
+                             libc libc libc
+                             ,(glibc-dynamic-linker)))))
+               (chmod program #o555))
+
              (with-directory-excursion out
                (invoke tar "xvf"
                        (string-append builddir "/binaries.tar")))
 
              (with-directory-excursion bindir
                (chmod "." #o755)
-               (rename-file "gcc" ".gcc-wrapped")
-               (call-with-output-file "gcc"
-                 (lambda (p)
-                   (format p "#!~a
-exec ~a/bin/.gcc-wrapped -B~a/lib \
-     -Wl,-rpath -Wl,~a/lib \
-     -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
-                           bash
-                           out libc libc libc
-                           ,(glibc-dynamic-linker))))
-
-               (chmod "gcc" #o555)
-               #t))))))
+               (for-each wrap-program
+                         ,(if (target-hurd64?)
+                              ''("gcc" "g++")
+                              ''("gcc")))))))))
     (inputs
      `(("tar" ,(bootstrap-executable "tar" (%current-system)))
        ("xz"  ,(bootstrap-executable "xz" (%current-system)))
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 56/58] gnu: commencement: libstdc++-boot0: Support the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (54 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 55/58] gnu: bootstrap: %bootstrap-gcc: Also wrap g++ for the 64bit Hurd Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 57/58] gnu: commencement: gcc-boot0: " Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 58/58] gnu: commencement: gcc-final: " Janneke Nieuwenhuizen
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (make-libstdc++-boot0)[arguments]: When
creating libstdc++-boot0 for the 64bit Hurd, add disable options similar to
libstdc++ to #:configure-flags.

Change-Id: I00636fa48e38823b00ede7dcbd0c1c23544d898c
---
 gnu/packages/commencement.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index dab65c7ca1..2a32485fc0 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2288,6 +2288,14 @@ (define (make-libstdc++-boot0 gcc)
          #:validate-runpath? #f
 
          ,@(substitute-keyword-arguments (package-arguments lib)
+             ((#:configure-flags flags)
+              (if (target-hurd64?)
+                  #~(cons* "--disable-shared"
+                           "--disable-libstdcxx-dual-abi"
+                           "--disable-libstdcxx-threads"
+                           "--disable-libstdcxx-pch"
+                           #$flags)
+                  flags))
              ((#:phases phases)
               #~(modify-phases #$phases
                   (add-after 'unpack 'unpack-gmp&co
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 57/58] gnu: commencement: gcc-boot0: Support the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (55 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 56/58] gnu: commencement: libstdc++-boot0: Support " Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 58/58] gnu: commencement: gcc-final: " Janneke Nieuwenhuizen
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

Asking gcc to "--disable-shared" is overridden for libcc1 by the build system,
which lateron fails with

    install: cannot stat '.libs/libcc1.so.0.0.0': No such file or directory

because no shared libcc1.so.0.0.0 could actually be built.

* gnu/packages/commencement.scm (gcc-boot0)[arguments]: When building for the
64bit Hurd, add CC_FOR_BUILD to #:make-flags to convince gmp's configure that
gcc works.  Also, add phase "patch-libcc1-static" to avoid attempting a shared
libcc1.
---
 gnu/packages/commencement.scm | 36 ++++++++++++++++++++++++++++-------
 1 file changed, 29 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 2a32485fc0..3dbd27b660 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2391,13 +2391,21 @@ (define gcc-boot0
          `(let* ((libc        (assoc-ref %build-inputs "libc"))
                  (libc-native (or (assoc-ref %build-inputs "libc-native")
                                   libc)))
-            `(,(string-append "LDFLAGS="
-                              "-Wl,-rpath=" libc-native "/lib "
-                              "-Wl,-dynamic-linker "
-                              "-Wl," libc-native ,(glibc-dynamic-linker
-                                                   (match (%current-system)
-                                                     ("x86_64-linux" "i686-linux")
-                                                     (_ (%current-system))))))))
+            `(,,@(append
+                  `((string-append "LDFLAGS="
+                                   "-Wl,-rpath=" libc-native "/lib "
+                                   "-Wl,-dynamic-linker "
+                                   "-Wl," libc-native
+                                   ,(glibc-dynamic-linker
+                                     (match (%current-system)
+                                       ("x86_64-linux" "i686-linux")
+                                       (_ (%current-system))))))
+                  (if (target-hurd64?)
+                      ;;Convince gmp's configure that gcc works
+                      (list (string-append
+                             "CC_FOR_BUILD=gcc"
+                             " -Wno-implicit-function-declaration"))
+                      '())))))
         ((#:phases phases)
          #~(modify-phases #$phases
              (add-after 'unpack 'unpack-gmp&co
@@ -2421,6 +2429,20 @@ (define gcc-boot0
                                            char-set:letter)
                                         #$(package-name lib)))
                            (list gmp-6.0 mpfr mpc)))))
+             #$@(if (target-hurd64?)
+                    #~((add-after 'unpack 'patch-libcc1-static
+                         (lambda _
+                           ;;Attempting to build libcc1 shared gives:
+                           ;;  install: cannot stat '.libs/libcc1.so.0.0.0':
+                           ;;  No such file or directory
+                           ;;convince gcc harder to not build a shared libcc1
+                           (substitute* "Makefile.def"
+                             (("module= libcc1; [^;]*;") "module= libcc1;"))
+                           (substitute* "Makefile.in"
+                             (("(--target=[$][{]target_alias[}]) --enable-shared \\\\"
+                               all target)
+                              (string-append target " \\"))))))
+                    #~())
              #$(match (%current-system)
                  ((or "i686-linux" "x86_64-linux")
                   #~(add-before 'configure 'fix-libcc1
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

* [bug#74290] [PATCH v4 58/58] gnu: commencement: gcc-final: Support the 64bit Hurd.
  2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
                     ` (56 preceding siblings ...)
  2024-11-24  7:55   ` [bug#74290] [PATCH v4 57/58] gnu: commencement: gcc-boot0: " Janneke Nieuwenhuizen
@ 2024-11-24  7:55   ` Janneke Nieuwenhuizen
  57 siblings, 0 replies; 206+ messages in thread
From: Janneke Nieuwenhuizen @ 2024-11-24  7:55 UTC (permalink / raw)
  To: 74290; +Cc: Andreas Enge, Efraim Flashner, Ekaitz Zarraga,
	Ludovic Courtès

* gnu/packages/commencement.scm (gcc-final)[arguments]: When building for the
64bit Hurd, create a gcc wrapper in phase "create-stage-wrapper", use it
by adding STAGE_CC_WRAPPER to #:make-flags, and CC to #:configure-flags
to convince configure gmp that gcc and g++ work.

Change-Id: I939c03c6c0fd9698efc4b293e59cf576249e3b77
---
 gnu/packages/commencement.scm | 37 ++++++++++++++++++++++++++++++++---
 1 file changed, 34 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 3dbd27b660..4368893f4d 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3255,13 +3255,32 @@ (define gcc-final
          ;; Since $LIBRARY_PATH is not honored, add the relevant flags.
          #~(let ((zlib (assoc-ref %build-inputs "zlib")))
              (map (lambda (flag)
-                    (if (string-prefix? "LDFLAGS=" flag)
+                    (if #$(if (target-hurd64?)
+                              #~(and (string? flag)
+                                     (string-prefix? "LDFLAGS=" flag))
+                              #~(string-prefix? "LDFLAGS=" flag))
                         (string-append flag " -L"
                                        (assoc-ref %build-inputs "libstdc++")
                                        "/lib -L" zlib "/lib -Wl,-rpath="
                                        zlib "/lib")
                         flag))
-                  #$flags)))
+                  #$(if (target-hurd64?)
+                        `(cons
+                          (string-append
+                           ;;Convince gmp's configure that gcc works
+                           "STAGE_CC_WRAPPER=" (getcwd) "/build/gcc.sh")
+                          ,flags)
+                        flags))))
+        ((#:configure-flags flags)
+         (if (target-hurd64?)
+             #~(append
+                #$flags
+                (list #$(string-append
+                         ;;Convince gmp's configure that gcc works
+                         "CC=gcc"
+                         " -Wno-implicit-function-declaration")
+                      "--disable-plugin"))
+             flags))
         ;; Build again GMP & co. within GCC's build process, because it's hard
         ;; to do outside (because GCC-BOOT0 is a cross-compiler, and thus
         ;; doesn't honor $LIBRARY_PATH, which breaks `gnu-build-system'.)
@@ -3306,7 +3325,19 @@ (define gcc-final
                                                (getenv "CPLUS_INCLUDE_PATH")
                                                #\:))
                                       ":")
-                                     "\nAM_CXXFLAGS = ")))))))))))
+                                     "\nAM_CXXFLAGS = "))))))
+             #$@(if (target-hurd64?)
+                    #~((add-after 'configure 'create-stage-wrapper
+                         (lambda _
+                           (with-output-to-file "gcc.sh"
+                             (lambda _
+                               (format #t "#! ~a/bin/bash
+exec \"$@\" \
+    -Wno-error \
+    -Wno-implicit-function-declaration"
+                                       #$static-bash-for-glibc)))
+                           (chmod "gcc.sh" #o555))))
+                    #~()))))))
 
     ;; This time we want Texinfo, so we get the manual.  Add
     ;; STATIC-BASH-FOR-GLIBC so that it's used in the final shebangs of
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 206+ messages in thread

end of thread, other threads:[~2024-11-24  8:42 UTC | newest]

Thread overview: 206+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-10 10:32 [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
2024-11-10 10:37 ` [bug#74290] [PATCH 01/31] gnu: mig: Update to v1.8+git20231217 Janneke Nieuwenhuizen
2024-11-10 10:37 ` [bug#74290] [PATCH 02/31] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
2024-11-10 11:45   ` janneke
2024-11-10 10:37 ` [bug#74290] [PATCH 03/31] gnu: hurd: Update to v0.9.git20240714 Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 04/31] gnu: gcc: Add indirections current-gcc, current-gcc-toolchain Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 05/31] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 06/31] gnu: cross-libc: Support cross-building for the " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 07/31] gnu: bash-minimal: Fix build for " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 08/31] gnu: elfutils: " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 09/31] gnu: grep: Fix build for the " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 10/31] gnu: patch: " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 11/31] gnu: libxcrypt: Support " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 12/31] gnu: libstdc++: " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 13/31] gnu: gcc-13, gcc-14: Support being used as parent for gcc-static Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 14/31] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
2024-11-11 18:05   ` janneke
2024-11-10 10:38 ` [bug#74290] [PATCH 15/31] system: image: Add hurd64 image types Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 16/31] gnu: Add libgpg-error-1.50 Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 17/31] gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 18/31] gnu: perl: Support cross-building " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 19/31] gnu: openssl-3.0: Support " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 20/31] gnu: pciutils: " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 21/31] gnu: libpciaccess: " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 22/31] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 23/31] gnu: netdde: Support the 64bit Hurd Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 24/31] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337 Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 25/31] gnu: rumpkernel: Support the 64bit Hurd Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 26/31] gnu: hurd: Build fixes for " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 27/31] gnu: git-minimal: Support " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 28/31] gnu: inetutils: Fix build for " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 29/31] gnu: grub: " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 30/31] gnu: guile-fibers: " Janneke Nieuwenhuizen
2024-11-10 10:38 ` [bug#74290] [PATCH 31/31] system: hurd: Use 64bit gnumach " Janneke Nieuwenhuizen
2024-11-10 14:40   ` janneke
2024-11-10 14:15 ` [bug#74290] [PATCH 00/31] Add support for x86_64-gnu, aka " janneke
2024-11-12  1:17   ` Maxim Cournoyer
2024-11-12 16:25 ` [bug#74290] [PATCH v2 00/40] " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 01/40] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 02/40] gnu: mig: Update to 1.8+git20231217 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 03/40] gnu: hurd: Update to 0.9.git20240714 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 04/40] gnu: gcc: Add indirections current-gcc, current-gcc-toolchain Janneke Nieuwenhuizen
2024-11-17 16:51     ` Ludovic Courtès
2024-11-12 16:25   ` [bug#74290] [PATCH v2 05/40] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
2024-11-17 16:59     ` Ludovic Courtès
2024-11-17 17:26       ` janneke
2024-11-18  8:45         ` janneke
2024-11-18  9:07           ` janneke
2024-11-20 11:43             ` Ludovic Courtès
2024-11-20 11:48         ` Ludovic Courtès
2024-11-12 16:25   ` [bug#74290] [PATCH v2 06/40] gnu: cross-libc: Support cross-building for the " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 07/40] gnu: bash-minimal: Fix build for " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 08/40] gnu: elfutils: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 09/40] gnu: grep: Fix build for the " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 10/40] gnu: patch: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 11/40] gnu: libxcrypt: Support " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 12/40] gnu: libstdc++: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 13/40] gnu: gcc-13, gcc-14: Support being used as parent for gcc-static Janneke Nieuwenhuizen
2024-11-17 16:49     ` Ludovic Courtès
2024-11-17 18:27       ` janneke
2024-11-17 18:46         ` janneke
2024-11-12 16:25   ` [bug#74290] [PATCH v2 14/40] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka the 64bit Hurd Janneke Nieuwenhuizen
2024-11-17 16:50     ` Ludovic Courtès
2024-11-17 17:34       ` janneke
2024-11-20 11:50         ` Ludovic Courtès
2024-11-12 16:25   ` [bug#74290] [PATCH v2 15/40] system: image: Add hurd64 image types Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 16/40] gnu: Add libgpg-error-1.50 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 17/40] gnu: libgcrypt: Use libgpg-error-1.50 for the 64bit Hurd Janneke Nieuwenhuizen
2024-11-17 16:51     ` Ludovic Courtès
2024-11-17 17:53       ` janneke
2024-11-12 16:25   ` [bug#74290] [PATCH v2 18/40] gnu: perl: Support cross-building " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 19/40] gnu: openssl-3.0: Support " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 20/40] gnu: pciutils: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 21/40] gnu: libpciaccess: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 22/40] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 23/40] gnu: netdde: Support the 64bit Hurd Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 24/40] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 25/40] gnu: rumpkernel: Support the 64bit Hurd Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 26/40] gnu: hurd: Build fixes for " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 27/40] gnu: git-minimal: Support " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 28/40] gnu: inetutils: Fix build for " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 29/40] gnu: grub: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 30/40] gnu: guile-fibers: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 31/40] gnu: m4: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 32/40] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 33/40] gnu: commencement: mig-boot0: Update to 1.8+git20231217 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 34/40] gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 35/40] gnu: commencement: libstdc++-boot0-gcc7: Replace by make-libstdc++-boot0 Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 36/40] gnu: gettext: Fix cross-build shebangs Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 37/40] gnu: texinfo-4: Fix build for the 64bit Hurd Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 38/40] gnu: flex: " Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 39/40] system: examples: Add bare-hurd64.tmpl Janneke Nieuwenhuizen
2024-11-12 16:25   ` [bug#74290] [PATCH v2 40/40] system: examples: Add devel-hurd64.tmpl Janneke Nieuwenhuizen
2024-11-17 17:03   ` [bug#74290] [PATCH v2 00/40] Add support for x86_64-gnu, aka the 64bit Hurd Ludovic Courtès
2024-11-17 17:51     ` janneke
2024-11-19  6:54 ` [bug#74290] [PATCH v3 00/51] " Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 01/51] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 02/51] gnu: mig: Update to 1.8+git20231217 Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 03/51] gnu: hurd: Update to 0.9.git20240714 Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 04/51] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 05/51] gnu: cross-libc: Support cross-building for the " Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 06/51] gnu: bash-minimal: Support [cross-]build with gcc-14 Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 07/51] gnu: elfutils: Fix build for 64bit Hurd Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 08/51] gnu: grep: Fix build for the " Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 09/51] gnu: patch: " Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 10/51] gnu: libxcrypt: Support " Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 11/51] gnu: libstdc++: " Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 12/51] gnu: glibc/hurd: Add patches for " Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 13/51] gnu: bash: Avoid hang when cross-built for the Hurd Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 14/51] gnu: git-minimal: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 15/51] gnu: flex: Fix [cross-]build with gcc-14 Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 16/51] gnu: libffi: " Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 17/51] gnu: perl: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 18/51] gnu: texinfo-4: Fix " Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 19/51] gnu: hurd: Fix build with gcc-14 Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 20/51] gnu: netdde: " Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 21/51] gnu: libedit: Fix [cross-]build with gcc-14 for 32bit Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 22/51] gnu: libssh: " Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 23/51] gnu: guile-lzlib: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 24/51] gnu: cross-base: Update %xgcc to gcc-14, to support " Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 25/51] gnu: make-bootstrap: Update gcc-static to gcc-14, for " Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 26/51] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 27/51] system: image: Add hurd64 image types Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 28/51] gnu: libgpg-error: Support the 64bit Hurd Janneke Nieuwenhuizen
2024-11-19  6:54   ` [bug#74290] [PATCH v3 29/51] gnu: openssl-3.0: " Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 30/51] gnu: pciutils: " Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 31/51] gnu: libpciaccess: " Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 32/51] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 33/51] gnu: netdde: Support the 64bit Hurd Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 34/51] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337 Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 35/51] gnu: rumpkernel: Support the 64bit Hurd Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 36/51] gnu: hurd: Build fixes for " Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 37/51] gnu: inetutils: Fix build " Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 38/51] gnu: grub: " Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 39/51] gnu: guile-fibers: " Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 40/51] gnu: m4: " Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 41/51] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714 Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 42/51] gnu: commencement: mig-boot0: Update to 1.8+git20231217 Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 43/51] gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714 Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 44/51] gnu: commencement: libstdc++-boot0-gcc7: Replace by make-libstdc++-boot0 Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 45/51] gnu: gettext: Fix cross-build shebangs Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 46/51] gnu: Add gdb-15.2, with support for the 64bit Hurd Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 47/51] gnu: bootstrap: %bootstrap-glibc: Also fix libm.so Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 48/51] gnu: findutils: Disable tests on the 64bit Hurd Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 49/51] system: examples: Add bare-hurd64.tmpl Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 50/51] system: examples: Add devel-hurd64.tmpl Janneke Nieuwenhuizen
2024-11-19  6:55   ` [bug#74290] [PATCH v3 51/51] gnu: Use gcc-14, gcc-toolchain-14 on the 64bit Hurd Janneke Nieuwenhuizen
2024-11-24  7:54 ` [bug#74290] [PATCH v4 00/58] Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 01/58] gnu: gnumach: Update to v1.8+git20240714 Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 02/58] gnu: mig: Update to 1.8+git20231217 Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 03/58] gnu: hurd: Update to 0.9.git20240714 Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 04/58] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 05/58] gnu: cross-libc: Support cross-building for the " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 06/58] gnu: bash-minimal: Support [cross-]build with gcc-14 Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 07/58] gnu: elfutils: Fix build for 64bit Hurd Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 08/58] gnu: grep: Fix build for the " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 09/58] gnu: patch: " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 10/58] gnu: libxcrypt: Support " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 11/58] gnu: libstdc++: " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 12/58] gnu: glibc/hurd: Add patches for " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 13/58] gnu: bash: Avoid hang when cross-built for the Hurd Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 14/58] gnu: git-minimal: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 15/58] gnu: flex: Fix [cross-]build with gcc-14 Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 16/58] gnu: libffi: " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 17/58] gnu: perl: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 18/58] gnu: texinfo-4: Fix " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 19/58] gnu: hurd: Fix build with gcc-14 Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 20/58] gnu: netdde: " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 21/58] gnu: libedit: Fix [cross-]build with gcc-14 for 32bit Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 22/58] gnu: libssh: " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 23/58] gnu: guile-lzlib: Support [cross-]build with gcc-14 and the 64bit Hurd Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 24/58] gnu: cross-base: Update %xgcc to gcc-14, to support " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 25/58] gnu: gcc-14: Force libdir /lib instead of /lib64 for " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 26/58] gnu: glibc/hurd: Add patch for the 64bit Hurd, fixing "raise" Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 27/58] gnu: make-bootstrap: Update gcc-static to gcc-14, for the 64bit Hurd Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 28/58] DRAFT gnu: bootstrap: Add support for x86_64-gnu, aka " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 29/58] system: image: Add hurd64 image types Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 30/58] gnu: libgpg-error: Support the 64bit Hurd Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 31/58] gnu: openssl-3.0: " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 32/58] gnu: pciutils: " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 33/58] gnu: libpciaccess: " Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 34/58] gnu: netdde: Update to c0ef248dc7c5ccc1273e2a796f3ece30c5b645df Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 35/58] gnu: netdde: Support the 64bit Hurd Janneke Nieuwenhuizen
2024-11-24  7:54   ` [bug#74290] [PATCH v4 36/58] gnu: rumpkernel: Update to f1ffd6405f225336e595a0f99f01095ed7438337 Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 37/58] gnu: rumpkernel: Support the 64bit Hurd Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 38/58] gnu: hurd: Build fixes for " Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 39/58] gnu: inetutils: Fix build " Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 40/58] gnu: grub: " Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 41/58] gnu: guile-fibers: " Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 42/58] gnu: m4: " Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 43/58] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20240714 Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 44/58] gnu: commencement: mig-boot0: Update to 1.8+git20231217 Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 45/58] gnu: commencement: hurd-headers-boot0: Update to 0.9.git20240714 Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 46/58] gnu: commencement: libstdc++-boot0-gcc7: Replace by make-libstdc++-boot0 Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 47/58] gnu: gettext: Fix cross-build shebangs Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 48/58] gnu: Add gdb-15.2, with support for the 64bit Hurd Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 49/58] gnu: bootstrap: %bootstrap-glibc: Also fix libm.so Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 50/58] system: examples: Add bare-hurd64.tmpl Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 51/58] system: examples: Add devel-hurd64.tmpl Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 52/58] gnu: Use gcc-14, gcc-toolchain-14 on the 64bit Hurd Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 53/58] gnu: commencement: kernel-headers-boot0: Support " Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 54/58] gnu: hurd: Add refcounts-assert patch Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 55/58] gnu: bootstrap: %bootstrap-gcc: Also wrap g++ for the 64bit Hurd Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 56/58] gnu: commencement: libstdc++-boot0: Support " Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 57/58] gnu: commencement: gcc-boot0: " Janneke Nieuwenhuizen
2024-11-24  7:55   ` [bug#74290] [PATCH v4 58/58] gnu: commencement: gcc-final: " Janneke Nieuwenhuizen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).