GNU bug report logs - #54239
[PATCH] gnu: Add cross-clang.

Previous Next

Package: guix-patches;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Thu, 3 Mar 2022 16:04:02 UTC

Severity: normal

Tags: patch

Full log


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

From: Julien Lepiller <julien <at> lepiller.eu>
To: 54239 <at> debbugs.gnu.org
Subject: [PATCH v3 06/10] gnu: libcxx: Allow cross-compilation.
Date: Sat, 16 Jul 2022 21:48:03 +0200
* gnu/packages/llvm.scm (libcxx)[native-inputs]: Move llvm to...
[inputs]: ...here.
[arguments]: adjust CROSS_INCLUDE_PATH when cross-compiling.
(libcxx-6)[native-inputs]: Move llvm to...
[inputs]: ...here.
---
 gnu/packages/llvm.scm | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 560a64840a..96620f1c3c 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -1640,8 +1640,9 @@ (define-public libcxx
      `(#:phases
        (modify-phases (@ (guix build cmake-build-system) %standard-phases)
          (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let ((gcc (assoc-ref inputs  "gcc")))
+           (lambda* (#:key inputs native-inputs #:allow-other-keys)
+             (let ((gcc (or (assoc-ref (or native-inputs inputs) "gcc")))
+                   (cross-gcc (assoc-ref native-inputs "cross-gcc")))
                ;; Hide GCC's C++ headers so that they do not interfere with
                ;; the ones we are attempting to build.
                (setenv "CPLUS_INCLUDE_PATH"
@@ -1649,12 +1650,19 @@ (define-public libcxx
                                             (string-split (getenv "CPLUS_INCLUDE_PATH")
                                                           #\:))
                                     ":"))
+               (when cross-gcc
+                 (setenv "CROSS_CPLUS_INCLUDE_PATH"
+                         (string-join (delete (string-append cross-gcc "/include/c++")
+                                              (string-split (getenv "CROSS_CPLUS_INCLUDE_PATH")
+                                                            #\:))
+                                      ":"))
+                 (format #t
+                         "environment variable `CROSS_CPLUS_INCLUDE_PATH' changed to ~a~%"
+                         (getenv "CROSS_CPLUS_INCLUDE_PATH")))
                (format #t
                        "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
-                       (getenv "CPLUS_INCLUDE_PATH"))
-               #t))))))
-    (native-inputs
-     (list clang llvm))
+                       (getenv "CPLUS_INCLUDE_PATH"))))))))
+    (inputs (list llvm-9))
     (home-page "https://libcxx.llvm.org")
     (synopsis "C++ standard library")
     (description
@@ -1675,8 +1683,7 @@ (define-public libcxx-6
        (sha256
         (base32
          "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n"))))
-    (native-inputs
-     (list clang-6 llvm-6))))
+    (inputs (list llvm-6))))
 
 (define-public libcxxabi-6
   (package
-- 
2.37.0





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

Previous Next


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