guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: gnu: linux-libre: Remove cross-libc from CROSS_CPATH.


From: guix-commits
Subject: 01/01: gnu: linux-libre: Remove cross-libc from CROSS_CPATH.
Date: Sat, 16 Nov 2019 14:37:43 -0500 (EST)

mothacehe pushed a commit to branch core-updates
in repository guix.

commit eacd072c09f8e4b5e0264d39ea9afe7814247f46
Author: Mathieu Othacehe <address@hidden>
Date:   Sat Nov 16 18:14:31 2019 +0100

    gnu: linux-libre: Remove cross-libc from CROSS_CPATH.
    
    * gnu/packages/linux.scm (make-linux-libre*)[arguments]: Do not unset
    CROSS_CPATH completely, instead remove cross-libc from CROSS_CPATH in the 
same
    way that libc is removed from CPATH.
---
 gnu/packages/linux.scm | 37 ++++++++++++++++++++-----------------
 1 file changed, 20 insertions(+), 17 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 1943281..3552c2e 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -679,23 +679,26 @@ for ARCH and optionally VARIANT, or #f if there is no 
such configuration."
              #t))
          (replace 'configure
            (lambda* (#:key inputs native-inputs target #:allow-other-keys)
-             ;; Unset CROSS_CPATH to make sure that cross-libc is not
-             ;; found. Otherwise, some of its header would conflict with the
-             ;; one from linux (stdint.h and linux/types.h)
-             ,@(if (%current-target-system)
-                   '((unsetenv "CROSS_CPATH"))
-                   '())
-
-             ;; On AArch64 (at least), we need to remove glibc headers from 
CPATH
-             ;; (they are still available as "system headers"), so that the 
kernel
-             ;; can override uint64_t.  See <https://bugs.gnu.org/37593>.
-             (setenv "CPATH"
-                     (string-join
-                      (remove (cut string-prefix? (assoc-ref inputs "libc") <>)
-                              (string-split (getenv "CPATH") #\:))
-                      ":"))
-             (format #t "environment variable `CPATH' changed to `~a'~%"
-                     (getenv "CPATH"))
+             ;; On AArch64 (at least), we need to remove glibc headers from
+             ;; CPATH (they are still available as "system headers"), so that
+             ;; the kernel can override uint64_t.  See
+             ;; <https://bugs.gnu.org/37593>. This is also true when
+             ;; cross-compiling, except in that case, cross-libc must be
+             ;; removed from CROSS_CPATH.
+             (let ((var ,(if (%current-target-system)
+                             "CROSS_CPATH"
+                             "CPATH"))
+                   (libc ,(if (%current-target-system)
+                              "cross-libc"
+                              "libc")))
+               (setenv var
+                       (string-join
+                        (remove
+                         (cut string-prefix? (assoc-ref inputs libc) <>)
+                         (string-split (getenv var) #\:))
+                        ":"))
+               (format #t "environment variable `~a' changed to `~a'~%"
+                       var (getenv var)))
 
              ;; Avoid introducing timestamps
              (setenv "KCONFIG_NOTIMESTAMP" "1")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]