diff mbox

gnu: cross-libc: Use the correct libc.

Message ID eeec8c69-fb81-b2f6-b2ac-0d0e6d8de1ad@gmail.com
State New
Headers show

Commit Message

Manolis Ragkousis Aug. 11, 2016, 6:56 p.m. UTC
Hello everyone,

I noticed that in commit ef21276053b980 from core-updates-next I am
using (cross-libc-for-target ...) only in one place while I should have
used (let ((libc (cross-libc-for-target target))) (package ...

With this patch I fix this.

Thank you,
Manolis

Comments

Leo Famulari Aug. 12, 2016, 6:40 p.m. UTC | #1
On Thu, Aug 11, 2016 at 09:56:27PM +0300, Manolis Ragkousis wrote:
> Hello everyone,
> 
> I noticed that in commit ef21276053b980 from core-updates-next I am
> using (cross-libc-for-target ...) only in one place while I should have
> used (let ((libc (cross-libc-for-target target))) (package ...

Can you try applying it on top of WIP-core-updates [0]?

And perhaps reviewing the new branch as requested in [0], while you're
at it?

[0]
http://lists.gnu.org/archive/html/guix-devel/2016-08/msg00731.html
Manolis Ragkousis Aug. 12, 2016, 6:52 p.m. UTC | #2
Hey Leo,

On 08/12/16 21:40, Leo Famulari wrote:
> Can you try applying it on top of WIP-core-updates [0]?
> 
> And perhaps reviewing the new branch as requested in [0], while you're
> at it?
> 
> [0]
> http://lists.gnu.org/archive/html/guix-devel/2016-08/msg00731.html
> 

The patch applied cleanly to WIP-core-updates and I am currently
checking the new branch.

Manolis
Ludovic Courtès Oct. 31, 2016, 5:49 p.m. UTC | #3
Hi Manolis, and sorry for the delay on this one!

Manolis Ragkousis <manolis837@gmail.com> skribis:

> I noticed that in commit ef21276053b980 from core-updates-next I am
> using (cross-libc-for-target ...) only in one place while I should have
> used (let ((libc (cross-libc-for-target target))) (package ...
>
> With this patch I fix this.
>
> Thank you,
> Manolis
>
> From b0481b1af1ea64cdfc1dcac6f2c1f9a24dc9a70b Mon Sep 17 00:00:00 2001
> From: Manolis Ragkousis <manolis837@gmail.com>
> Date: Thu, 11 Aug 2016 21:28:00 +0300
> Subject: [PATCH] gnu: cross-libc: Use the correct libc.
>
> * gnu/packages/cross-base.scm (cross-libc): Use cross-libc-for-target
> to determine the correct libc to use.

LGTM, for ‘core-updates’.

Before pushing, please make sure that:

  ./pre-inst-env guix build -s x86_64-linux coreutils
  ./pre-inst-env guix build -s armhf-linux coreutils
  ./pre-inst-env guix build --target=arm-linux-gnueabihf coreutils -n

are unchanged (I suppose they have substitutes available.)

Thanks!

Ludo’.
Manolis Ragkousis Oct. 31, 2016, 7:36 p.m. UTC | #4
On 10/31/16 19:49, Ludovic Courtès wrote:
> Before pushing, please make sure that:
> 
>   ./pre-inst-env guix build -s x86_64-linux coreutils
>   ./pre-inst-env guix build -s armhf-linux coreutils
>   ./pre-inst-env guix build --target=arm-linux-gnueabihf coreutils -n
> 
> are unchanged (I suppose they have substitutes available.)
> 

Done and done.

Thank you Ludo!
diff mbox

Patch

From b0481b1af1ea64cdfc1dcac6f2c1f9a24dc9a70b Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Thu, 11 Aug 2016 21:28:00 +0300
Subject: [PATCH] gnu: cross-libc: Use the correct libc.

* gnu/packages/cross-base.scm (cross-libc): Use cross-libc-for-target
to determine the correct libc to use.
---
 gnu/packages/cross-base.scm | 102 ++++++++++++++++++++++----------------------
 1 file changed, 51 insertions(+), 51 deletions(-)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index b4324c2..1524451 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -464,62 +464,62 @@  XBINUTILS and the cross tool chain."
       ((or "i586-pc-gnu" "i586-gnu") glibc/hurd)
       (_ glibc/linux)))
 
-  (package (inherit glibc)
-    (name (string-append "glibc-cross-" target))
-    (arguments
-     (substitute-keyword-arguments
-         `(;; Disable stripping (see above.)
-           #:strip-binaries? #f
+  ;; Use (cross-libc-for-target ...) to determine the correct libc to use.
+  (let ((libc (cross-libc-for-target target)))
+    (package (inherit libc)
+      (name (string-append "glibc-cross-" target))
+      (arguments
+       (substitute-keyword-arguments
+           `(;; Disable stripping (see above.)
+             #:strip-binaries? #f
 
-           ;; This package is used as a target input, but it should not have
-           ;; the usual cross-compilation inputs since that would include
-           ;; itself.
-           #:implicit-cross-inputs? #f
+             ;; This package is used as a target input, but it should not have
+             ;; the usual cross-compilation inputs since that would include
+             ;; itself.
+             #:implicit-cross-inputs? #f
 
-           ;; We need SRFI 26.
-           #:modules ((guix build gnu-build-system)
-                      (guix build utils)
-                      (srfi srfi-26))
+             ;; We need SRFI 26.
+             #:modules ((guix build gnu-build-system)
+                        (guix build utils)
+                        (srfi srfi-26))
 
-           ;; Package-arguments does not use the correct libc, so we use
-           ;; (cross-libc-for-target ...) to determine the correct one.
-           ,@(package-arguments (cross-libc-for-target target)))
-       ((#:configure-flags flags)
-        `(cons ,(string-append "--host=" target)
+             ,@(package-arguments libc))
+         ((#:configure-flags flags)
+          `(cons ,(string-append "--host=" target)
                ,flags))
-       ((#:phases phases)
-        `(alist-cons-before
-          'configure 'set-cross-kernel-headers-path
-          (lambda* (#:key inputs #:allow-other-keys)
-            (let* ((kernel (assoc-ref inputs "kernel-headers"))
-                   (cpath (string-append kernel "/include")))
-              (for-each (cut setenv <> cpath)
-                        '("CROSS_C_INCLUDE_PATH"
-                          "CROSS_CPLUS_INCLUDE_PATH"
-                          "CROSS_OBJC_INCLUDE_PATH"
-                          "CROSS_OBJCPLUS_INCLUDE_PATH"))
-              (setenv "CROSS_LIBRARY_PATH"
-                      (string-append kernel "/lib")) ;for Hurd's libihash
-              #t))
-          ,phases))))
-
-    ;; Shadow the native "kernel-headers" because glibc's recipe expects the
-    ;; "kernel-headers" input to point to the right thing.
-    (propagated-inputs `(("kernel-headers" ,xheaders)))
-
-    ;; FIXME: 'static-bash' should really be an input, not a native input, but
-    ;; to do that will require building an intermediate cross libc.
-    (inputs '())
+         ((#:phases phases)
+          `(alist-cons-before
+            'configure 'set-cross-kernel-headers-path
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let* ((kernel (assoc-ref inputs "kernel-headers"))
+                     (cpath (string-append kernel "/include")))
+                (for-each (cut setenv <> cpath)
+                          '("CROSS_C_INCLUDE_PATH"
+                            "CROSS_CPLUS_INCLUDE_PATH"
+                            "CROSS_OBJC_INCLUDE_PATH"
+                            "CROSS_OBJCPLUS_INCLUDE_PATH"))
+                (setenv "CROSS_LIBRARY_PATH"
+                        (string-append kernel "/lib")) ;for Hurd's libihash
+                #t))
+            ,phases))))
+
+      ;; Shadow the native "kernel-headers" because glibc's recipe expects the
+      ;; "kernel-headers" input to point to the right thing.
+      (propagated-inputs `(("kernel-headers" ,xheaders)))
+
+      ;; FIXME: 'static-bash' should really be an input, not a native input, but
+      ;; to do that will require building an intermediate cross libc.
+      (inputs '())
 
-    (native-inputs `(("cross-gcc" ,xgcc)
-                     ("cross-binutils" ,xbinutils)
-                     ,@(if (string-match (or "i586-pc-gnu" "i586-gnu") target)
-                           `(("cross-mig"
-                              ,@(assoc-ref (package-native-inputs xheaders)
-                                           "cross-mig")))
-                           '())
-                     ,@(package-inputs glibc)     ;FIXME: static-bash
-                     ,@(package-native-inputs glibc)))))
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ,@(if (string-match (or "i586-pc-gnu" "i586-gnu") target)
+                             `(("cross-mig"
+                                ,@(assoc-ref (package-native-inputs xheaders)
+                                             "cross-mig")))
+                             '())
+                       ,@(package-inputs libc)     ;FIXME: static-bash
+                       ,@(package-native-inputs libc))))))
 
 
 ;;;
-- 
2.9.2