gnu: cross-libc: Support cross-building for the 64bit Hurd.

* 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
This commit is contained in:
Janneke Nieuwenhuizen 2024-11-06 12:26:47 +01:00
parent 94dfb68d43
commit b8c5057e50
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
3 changed files with 14 additions and 5 deletions

View file

@ -1079,7 +1079,7 @@ the store.")
(string-append locale "/C.UTF-8"))))) (string-append locale "/C.UTF-8")))))
,@(if (target-hurd?) ,@(if (target-hurd?)
'((add-after 'install 'augment-libc.so `((add-after 'install 'augment-libc.so
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
(substitute* (string-append out "/lib/libc.so") (substitute* (string-append out "/lib/libc.so")
@ -1089,7 +1089,12 @@ the store.")
(add-after 'install 'create-machine-symlink (add-after 'install 'create-machine-symlink
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (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 (machine (string-append
out "/include/mach/machine"))) out "/include/mach/machine")))
(unless (file-exists? machine) (unless (file-exists? machine)

View file

@ -311,7 +311,7 @@ or false to signal an error."
gnu-triplet->nix-system) gnu-triplet->nix-system)
(%current-system)))) (%current-system))))
"Return the name of Glibc's dynamic linker for 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 (let ((platform (false-if-platform-not-found
(lookup-platform-by-system system)))) (lookup-platform-by-system system))))
(cond (cond

View file

@ -738,7 +738,7 @@ returned."
(delete 'install-utf8-c-locale) (delete 'install-utf8-c-locale)
,@(if (target-hurd? target) ,@(if (target-hurd? target)
'((add-after 'install 'augment-libc.so `((add-after 'install 'augment-libc.so
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
(substitute* (string-append out "/lib/libc.so") (substitute* (string-append out "/lib/libc.so")
@ -748,7 +748,11 @@ returned."
(add-after 'install 'create-machine-symlink (add-after 'install 'create-machine-symlink
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
(cpu "i386") (cpu ,(match target
((? target-x86-32?)
"i386")
((? target-x86-64?)
"x86_64")))
(machine (string-append (machine (string-append
out "/include/mach/machine"))) out "/include/mach/machine")))
(unless (file-exists? machine) (unless (file-exists? machine)