summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanneke Nieuwenhuizen <janneke@gnu.org>2024-11-06 12:26:47 +0100
committerJanneke Nieuwenhuizen <janneke@gnu.org>2024-12-03 08:33:12 +0100
commitb8c5057e50370d9f65ef7565afe11666528b341a (patch)
tree7b775da689b2f3e24b52d73aebb65938b2295926
parent94dfb68d4378377dfe49d6653e4ed668cecd2783 (diff)
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
-rw-r--r--gnu/packages/base.scm9
-rw-r--r--gnu/packages/bootstrap.scm2
-rw-r--r--gnu/packages/cross-base.scm8
3 files changed, 14 insertions, 5 deletions
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 90c25b54e17..02ef71f20d9 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1079,7 +1079,7 @@ the store.")
1079 (string-append locale "/C.UTF-8"))))) 1079 (string-append locale "/C.UTF-8")))))
1080 1080
1081 ,@(if (target-hurd?) 1081 ,@(if (target-hurd?)
1082 '((add-after 'install 'augment-libc.so 1082 `((add-after 'install 'augment-libc.so
1083 (lambda* (#:key outputs #:allow-other-keys) 1083 (lambda* (#:key outputs #:allow-other-keys)
1084 (let ((out (assoc-ref outputs "out"))) 1084 (let ((out (assoc-ref outputs "out")))
1085 (substitute* (string-append out "/lib/libc.so") 1085 (substitute* (string-append out "/lib/libc.so")
@@ -1089,7 +1089,12 @@ the store.")
1089 (add-after 'install 'create-machine-symlink 1089 (add-after 'install 'create-machine-symlink
1090 (lambda* (#:key outputs #:allow-other-keys) 1090 (lambda* (#:key outputs #:allow-other-keys)
1091 (let* ((out (assoc-ref outputs "out")) 1091 (let* ((out (assoc-ref outputs "out"))
1092 (cpu "i386") 1092 (cpu ,(match (or (%current-target-system)
1093 (%current-system))
1094 ((? target-x86-32?)
1095 "i386")
1096 ((? target-x86-64?)
1097 "x86_64")))
1093 (machine (string-append 1098 (machine (string-append
1094 out "/include/mach/machine"))) 1099 out "/include/mach/machine")))
1095 (unless (file-exists? machine) 1100 (unless (file-exists? machine)
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 33cbaa30ae6..27798fe2783 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -311,7 +311,7 @@ or false to signal an error."
311 gnu-triplet->nix-system) 311 gnu-triplet->nix-system)
312 (%current-system)))) 312 (%current-system))))
313 "Return the name of Glibc's dynamic linker for SYSTEM." 313 "Return the name of Glibc's dynamic linker for SYSTEM."
314 ;; See the 'SYSDEP_KNOWN_INTERPRETER_NAMES' cpp macro in libc. 314 ;; See the appropriate 'shlib-versions' file in libc.
315 (let ((platform (false-if-platform-not-found 315 (let ((platform (false-if-platform-not-found
316 (lookup-platform-by-system system)))) 316 (lookup-platform-by-system system))))
317 (cond 317 (cond
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 83672ab383e..4961b3b4c0f 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -738,7 +738,7 @@ returned."
738 (delete 'install-utf8-c-locale) 738 (delete 'install-utf8-c-locale)
739 739
740 ,@(if (target-hurd? target) 740 ,@(if (target-hurd? target)
741 '((add-after 'install 'augment-libc.so 741 `((add-after 'install 'augment-libc.so
742 (lambda* (#:key outputs #:allow-other-keys) 742 (lambda* (#:key outputs #:allow-other-keys)
743 (let ((out (assoc-ref outputs "out"))) 743 (let ((out (assoc-ref outputs "out")))
744 (substitute* (string-append out "/lib/libc.so") 744 (substitute* (string-append out "/lib/libc.so")
@@ -748,7 +748,11 @@ returned."
748 (add-after 'install 'create-machine-symlink 748 (add-after 'install 'create-machine-symlink
749 (lambda* (#:key outputs #:allow-other-keys) 749 (lambda* (#:key outputs #:allow-other-keys)
750 (let* ((out (assoc-ref outputs "out")) 750 (let* ((out (assoc-ref outputs "out"))
751 (cpu "i386") 751 (cpu ,(match target
752 ((? target-x86-32?)
753 "i386")
754 ((? target-x86-64?)
755 "x86_64")))
752 (machine (string-append 756 (machine (string-append
753 out "/include/mach/machine"))) 757 out "/include/mach/machine")))
754 (unless (file-exists? machine) 758 (unless (file-exists? machine)