From 92391eaf8df8fecbf6844c57ce5bcd3014eb5d28 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 16 Dec 2018 15:36:48 +0100 Subject: gnu: glibc: Add patch implementing "pid/…" magic lookup on the Hurd. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch is missing from glibc 2.28 and is needed to support /proc/self lookup when using the Hurd's procfs, which in turn is needed for our 'guile-relocatable.patch'. See . * gnu/packages/patches/glibc-hurd-magic-pid.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/base.scm (glibc)[arguments]: Add 'apply-hurd-patch' phase. [native-inputs]: Add "hurd-magic-pid-patch" input. * gnu/packages/cross-base.scm (cross-libc)[arguments]: Duplicate 'apply-hurd-patch' phase. --- gnu/packages/cross-base.scm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'gnu/packages/cross-base.scm') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 2fcb7fb36b..bb3d6d916a 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -454,6 +454,23 @@ (define* (cross-libc target flags))) ((#:phases phases) `(modify-phases ,phases + ;; XXX: The hack below allows us to make sure the + ;; 'apply-hurd-patch' phase gets added in the first + ;; cross-libc, but does *not* get added twice subsequently + ;; when cross-building another libc. + ,@(if (and (hurd-triplet? target) + (not (hurd-target?))) + `((add-after 'unpack 'apply-hurd-patch + (lambda* (#:key inputs native-inputs + #:allow-other-keys) + ;; TODO: Move this to 'patches' field. + (let ((patch (or (assoc-ref native-inputs + "hurd-magic-pid-patch") + (assoc-ref inputs + "hurd-magic-pid-patch")))) + (invoke "patch" "-p1" "--force" "--input" + patch))))) + '()) (add-before 'configure 'set-cross-kernel-headers-path (lambda* (#:key inputs #:allow-other-keys) (let* ((kernel (assoc-ref inputs "kernel-headers")) @@ -477,7 +494,9 @@ (define* (cross-libc target ,@(if (hurd-triplet? target) `(("cross-mig" ,@(assoc-ref (package-native-inputs xheaders) - "cross-mig"))) + "cross-mig")) + ("hurd-magic-pid-patch" + ,(search-patch "glibc-hurd-magic-pid.patch"))) '()) ,@(package-inputs libc) ;FIXME: static-bash ,@(package-native-inputs libc))))))) -- cgit v1.2.3