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 <m.othacehe@gmail.com>
This commit is contained in:
David Truby 2019-11-13 16:56:04 +00:00 committed by Mathieu Othacehe
parent cf9dad6c87
commit 496bbeee7a
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -11,6 +11,7 @@
;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2019 David Truby <David.Truby@arm.com>
;;;
;;; This file is part of GNU Guix.
;;;
@ -202,6 +203,7 @@ (define* (clang-from-llvm llvm clang-runtime hash
(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 @@ (define* (clang-from-llvm llvm clang-runtime hash
(("(^[[: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@")