GNU bug report logs - #60056
cross-compilation doesn't honor gcc native input

Previous Next

Package: guix;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Wed, 14 Dec 2022 02:17:02 UTC

Severity: normal

Full log


Message #13 received at 60056 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 60056 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH RFC 2/6] build: gnu-build-system2: Remove source from native
 inputs.
Date: Wed, 14 Dec 2022 22:23:24 -0500
Fixes <https://issues.guix.gnu.org/44924>, in a cross-compilation context.

Having the source in inputs when computing search paths can break builds.  One
example is a git checkout of the Linux source tree, where the source (a
directory) 'include' subdirectory gets picked up in C_INCLUDE_PATH and causes
conflicts with the includes provided by glibc.

* guix/build/gnu-build-system2.scm (set-paths): Remove any "source" native
input.
---
 guix/build/gnu-build-system2.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/build/gnu-build-system2.scm b/guix/build/gnu-build-system2.scm
index 54129549c2..1766f9d474 100644
--- a/guix/build/gnu-build-system2.scm
+++ b/guix/build/gnu-build-system2.scm
@@ -83,10 +83,12 @@ (define input-directories
        dir)))
 
   (define native-input-directories
-    (match native-inputs
+    ;; When cross-compiling, the source appears in native-inputs rather than
+    ;; inputs.
+    (match (and=> native-inputs (cut alist-delete "source" <>))
       (((_ . dir) ...)
        dir)
-      (#f                                         ; not cross compiling
+      (#f                               ;not cross-compiling
        '())))
 
   ;; Tell 'ld-wrapper' to disallow non-store libraries.
-- 
2.38.1





This bug report was last modified 2 years and 178 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.