gnu: cross-libc: Build fix for the Hurd.
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 9 Mar 2020 13:38:18 +0000 (14:38 +0100)
committerLudovic Courtès <ludo@gnu.org>
Tue, 31 Mar 2020 22:12:31 +0000 (00:12 +0200)
This fixes cross building of coreutils, e.g.

    ./pre-inst-env guix build --target=i586-pc-gnu coreutils

* gnu/packages/cross-base.scm (cross-libc): Add -lhurduser, -lmachuser for the
Hurd.

gnu/packages/cross-base.scm

index 13237fb..ab866ee 100644 (file)
@@ -491,7 +491,17 @@ and the cross tool chain."
                                  ',%gcc-cross-include-paths)
                        (setenv "CROSS_LIBRARY_PATH"
                                (string-append kernel "/lib")) ; for Hurd's libihash
-                       #t)))))))
+                       #t)))
+                 ,@(if (hurd-triplet? target)
+                       '((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")
+                                 (("/[^ ]+/lib/libc.so.0.3")
+                                  (string-append out "/lib/libc.so.0.3"
+                                                 " libmachuser.so libhurduser.so"))))
+                             #t)))
+                       '())))))
 
           ;; Shadow the native "kernel-headers" because glibc's recipe expects the
           ;; "kernel-headers" input to point to the right thing.