diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-04-29 22:55:34 +0900 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-05-02 09:53:54 +0900 |
commit | 94593917394f2580926c89d9546528a16da90e5f (patch) | |
tree | 25571dc63cf7ec0774ac42bb75e8caa0e6c939a1 | |
parent | f87204b2b2f0ccf5408f3f906cc9517ad164c232 (diff) | |
download | guix-94593917394f2580926c89d9546528a16da90e5f.tar.gz guix-94593917394f2580926c89d9546528a16da90e5f.zip |
gnu: libcxx: Fix cross-compilation build.
* gnu/packages/llvm.scm (libcxx) [arguments] <#:test-target>: New argument.
<#:tests?>: Add explanatory comment.
<#:implicit-inputs?>: Set to #f.
<#:phases>: Remove adjust-CPLUS_INCLUDE_PATH.
[native-inputs]: Explicitly provide standard inputs, filtering out gcc.
Remove extraneous llvm and libunwind-headers. Replace python with
python-minimal.
Change-Id: I8cbc73ef90dce0a57bf2f8198c3176932bf24185
Reviewed-by: Greg Hogan <code@greghogan.com>
-rw-r--r-- | gnu/packages/llvm.scm | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 8cdc2e8a48..ecfffd4b95 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -17,7 +17,7 @@ ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org> ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net> ;;; Copyright © 2021, 2022 Maxime Devos <maximedevos@telenet.be> -;;; Copyright © 2020, 2021, 2022, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com> +;;; Copyright © 2020-2022, 2024-2025 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu> ;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net> ;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net> @@ -54,6 +54,7 @@ #:use-module (guix utils) #:use-module (guix build-system cmake) #:use-module (guix build-system emacs) + #:use-module (guix build-system gnu) #:use-module (guix build-system python) #:use-module (guix build-system pyproject) #:use-module (guix build-system trivial) @@ -1905,7 +1906,9 @@ which highly leverage existing libraries in the larger LLVM project.") (build-system cmake-build-system) (arguments (list - #:tests? #f + #:test-target "check-cxx" + #:tests? #f ;prohibitively expensive to run + #:implicit-inputs? #f ;to avoid conflicting GCC headers #:configure-flags #~(list "-DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind" "-DCMAKE_C_COMPILER=clang" @@ -1920,23 +1923,14 @@ which highly leverage existing libraries in the larger LLVM project.") #~(modify-phases %standard-phases (add-after 'unpack 'enter-subdirectory (lambda _ - (chdir "runtimes"))) - (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH - (lambda* (#:key inputs #:allow-other-keys) - (let ((gcc (assoc-ref inputs "gcc"))) - ;; Hide GCC's C++ headers so that they do not interfere with - ;; the ones we are attempting to build. - (setenv "CPLUS_INCLUDE_PATH" - (string-join (delete (string-append gcc "/include/c++") - (string-split (getenv "CPLUS_INCLUDE_PATH") - #\:)) - ":")) - (format #t - "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" - (getenv "CPLUS_INCLUDE_PATH")) - #t)))))) + (chdir "runtimes")))))) (native-inputs - (list clang-19 libunwind-headers llvm python)) + (modify-inputs (standard-packages) + ;; Remove GCC from the build environment, to avoid its C++ + ;; headers (include/c++), which would interfere and cause build + ;; failures. + (delete "gcc") + (prepend clang-19 python-minimal))) (home-page "https://libcxx.llvm.org") (synopsis "C++ standard library") (description |