summary refs log tree commit diff
path: root/gnu/packages/llvm.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-03-05 17:22:17 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-03-05 23:36:04 +0100
commit3fd9c90c4ae79ff1e9a0dbe840c3ff10d099d7ca (patch)
tree0de4104a68daa670254e1d89739749e79235377b /gnu/packages/llvm.scm
parent08cf730a7ee1b4943f1c1b6a42a6ee9d08ee41c1 (diff)
downloadguix-3fd9c90c4ae79ff1e9a0dbe840c3ff10d099d7ca.tar.gz
gnu: clang-runtime: Adjust for CPLUS_INCLUDE_PATH changes.
* gnu/packages/llvm.scm (clang-runtime-from-llvm)[arguments]: Add #:modules
and #:phases.
Diffstat (limited to 'gnu/packages/llvm.scm')
-rw-r--r--gnu/packages/llvm.scm23
1 files changed, 22 insertions, 1 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index bf32322df5..659631e263 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -164,7 +164,28 @@ of programming tools as well as libraries with equivalent functionality.")
     (arguments
      `(;; Don't use '-g' during the build to save space.
        #:build-type "Release"
-       #:tests? #f))                    ; Tests require gtest
+       #:tests? #f                      ; Tests require gtest
+       #:modules ((srfi srfi-1)
+                  (ice-9 match)
+                  ,@%cmake-build-system-modules)
+       #:phases (modify-phases (@ (guix build cmake-build-system) %standard-phases)
+                  (add-after 'set-paths 'hide-glibc
+                    ;; Work around https://issues.guix.info/issue/36882.  We need to
+                    ;; remove glibc from CPLUS_INCLUDE_PATH so that the one hardcoded
+                    ;; in GCC, at the bottom of GCC include search-path is used.
+                    (lambda* (#:key inputs #:allow-other-keys)
+                      (let* ((filters '("libc"))
+                             (input-directories
+                              (filter-map (lambda (input)
+                                            (match input
+                                              ((name . dir)
+                                               (and (not (member name filters))
+                                                    dir))))
+                                          inputs)))
+                        (set-path-environment-variable "CPLUS_INCLUDE_PATH"
+                                                       '("include")
+                                                       input-directories)
+                        #t))))))
     (home-page "https://compiler-rt.llvm.org")
     (synopsis "Runtime library for Clang/LLVM")
     (description