diff mbox

gnu: glibc-hurd: Force mach/hurd/libpthread subdirs to build first.

Message ID 20161113131946.4185-2-manolis837@gmail.com
State New
Headers show

Commit Message

Manolis Ragkousis Nov. 13, 2016, 1:19 p.m. UTC
From: Manolis Ragkousis <manolis837@gmail.com>

* gnu/packages/base.scm (glibc/hurd): Avoid linking errors by forcing
mach/hurd/libpthread glibc subdirs to build before anything else.
---
 gnu/packages/base.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Ludovic Courtès Nov. 14, 2016, 1:05 p.m. UTC | #1
manolis837@gmail.com skribis:

> From: Manolis Ragkousis <manolis837@gmail.com>
>
> * gnu/packages/base.scm (glibc/hurd): Avoid linking errors by forcing
> mach/hurd/libpthread glibc subdirs to build before anything else.

Rather:

* gnu/packages/base.scm (glibc/hurd)[arguments]: Replace 'build' phase.

The comment in there is what explains the details.

> +           (alist-replace
> +            'build
> +            (lambda _
> +              ;; Force mach/hurd/libpthread subdirs to build first in order to avoid
> +              ;; linking errors.

If there’s a link to a bug-hurd discussion, you can add it here, in case
someone wants to see the details at a later point in time.

> +              (zero?
> +               (and (system* "make" "mach/subdir_lib")
> +                    (system* "make" "hurd/subdir_lib")
> +                    (system* "make" "libpthread/subdir_lib")
> +                    (system* "make"))))

The ‘zero?’ call is misplaced.

Also, I’d suggest enabling parallel builds, so something like this:

  (let ((-j (list "-j" (number->string (parallel-job-count)))))
    (let-syntax ((make (syntax-rules ()
                         ((_ target)
                          (zero? (apply system* "make" target -j))))))
      (and (make "mach/subdir_lib")
           (make "hurd/subdir_lib")
           (make "libpthread/subdir_lib")
           (zero? (apply system* "make" -j)))))

OK with changes along these lines.

Thank you!

Ludo’.
Manolis Ragkousis Nov. 30, 2016, 1:21 p.m. UTC | #2
Updated the patch with your suggestions, added you as a co-author and I
pushed it to core-updates.

Thank you,
Manolis
diff mbox

Patch

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 1c01874..abefe4e 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -714,7 +714,17 @@  with the Linux kernel.")
              ;; Use the right 'pwd'.
              (substitute* "configure"
                (("/bin/pwd") "pwd")))
-          ,original-phases)))
+           (alist-replace
+            'build
+            (lambda _
+              ;; Force mach/hurd/libpthread subdirs to build first in order to avoid
+              ;; linking errors.
+              (zero?
+               (and (system* "make" "mach/subdir_lib")
+                    (system* "make" "hurd/subdir_lib")
+                    (system* "make" "libpthread/subdir_lib")
+                    (system* "make"))))
+            ,original-phases))))
         ((#:configure-flags original-configure-flags)
         `(append (list "--host=i586-pc-gnu"