@@ -141,7 +141,7 @@ (define* (clang-runtime-from-llvm llvm
;; 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)
+ (lambda* (#:key inputs target #:allow-other-keys)
(let* ((filters '("libc"))
(input-directories
(filter-map (lambda (input)
@@ -153,7 +153,20 @@ (define* (clang-runtime-from-llvm llvm
(set-path-environment-variable "CPLUS_INCLUDE_PATH"
'("include")
input-directories)
- #t))))))
+ (when target
+ (let ((libc (assoc-ref inputs "cross-libc")))
+ (setenv "CROSS_CPLUS_INCLUDE_PATH"
+ (string-join
+ (filter
+ (lambda (path)
+ (and
+ (not (equal? path
+ (string-append libc "/include")))
+ (string-suffix? "include" path)))
+
+ (string-split (getenv "CROSS_CPLUS_INCLUDE_PATH")
+ #\:))
+ ":"))))))))))
(home-page "https://compiler-rt.llvm.org")
(synopsis "Runtime library for Clang/LLVM")
(description