From 496bbeee7a0afbf1c7cbcc0de8c33c2111cb661f Mon Sep 17 00:00:00 2001 From: David Truby Date: Wed, 13 Nov 2019 16:56:04 +0000 Subject: gnu: clang-from-llvm: Fix libstdc++ header location search. Make clang use libstdc++ from gcc package. In the future, the build of clang could be parametrized to build clang with libstdc++ support or with libcxx support. * gnu/packages/llvm.scm (clang-from-llvm)[arguments]: Make clang look for libstdc++ in the right location, which is gcc c++ includes directory. Signed-off-by: Mathieu Othacehe --- gnu/packages/llvm.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gnu') diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 33fb53d65e..d1b1981ad6 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2018 Tim Gesthuizen ;;; Copyright © 2018 Pierre Neidhardt ;;; Copyright © 2019 Rutger Helling +;;; Copyright © 2019 David Truby ;;; ;;; This file is part of GNU Guix. ;;; @@ -202,6 +203,7 @@ compiler. In LLVM this library is called \"compiler-rt\".") (lambda* (#:key inputs #:allow-other-keys) (let ((libc (assoc-ref inputs "libc")) (compiler-rt (assoc-ref inputs "clang-runtime")) + (gcc (assoc-ref inputs "gcc")) (version (string->number ,(version-major (package-version clang-runtime))))) @@ -218,6 +220,12 @@ compiler. In LLVM this library is called \"compiler-rt\".") (("(^[[:blank:]]+LibDir = ).*" _ declaration) (string-append declaration "\"" libc "/lib\";\n")) + ;; Make clang look for libstdc++ in the right + ;; location. + (("LibStdCXXIncludePathCandidates\\[\\] = \\{") + (string-append + "LibStdCXXIncludePathCandidates[] = { \"" gcc "/include/c++\",")) + ;; Make sure libc's libdir is on the search path, to ;; allow crt1.o & co. to be found. (("@GLIBC_LIBDIR@") -- cgit v1.2.3