diff mbox series

[bug#74290,v3,05/51] gnu: cross-libc: Support cross-building for the 64bit Hurd.

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

Commit Message

Janneke Nieuwenhuizen Nov. 19, 2024, 6:54 a.m. UTC
* 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 mbox series

Patch

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)