Subject: [bug#74290] [PATCH v3 00/51] Add support for x86_64-gnu, aka the 64bit Hurd.

From: Janneke Nieuwenhuizen <[email-masked]>
Date: Tue, 19 Nov 2024 07:54:30 +0100

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