GNU bug report logs -
#38276
Fix kernel-headers path in clang
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hello,
Indexing tools such as ccls use "clang" package (and more specifically
the libclang library it provides) to analyse code.
In that use case, clang cannot find kernel headers path. This is because
it is normally set as propagated inputs of gcc-toolchain and clang-toolchain, an
thus available via CPATH.
This patch proposes to hardcode kernel headers path into clang.
What do you think?
Mathieu
[0001-gnu-clang-from-llvm-Add-kernel-headers-to-default-in.patch (text/x-diff, inline)]
From 198e59f7645bffbc2ba1e68db2747b8c07997ad6 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe <at> gmail.com>
Date: Tue, 19 Nov 2019 16:41:33 +0100
Subject: [PATCH] gnu: clang-from-llvm: Add kernel-headers to default include
directories.
Stand-alone "clang" binary is not able to find kernel headers because they are
normally set as propagated inputs of gcc-toolchain and clang-toolchain, an
thus available via CPATH.
As some code indexers rely on libclang, kernel-headers include path needs to
be hard-coded.
* gnu/packages/llvm.scm (clang-from-llvm):
---
gnu/packages/llvm.scm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 863d43d7d6..c5bc1e2c5c 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -195,6 +195,8 @@ compiler. In LLVM this library is called \"compiler-rt\".")
;; Use a sane default include directory.
(string-append "-DC_INCLUDE_DIRS="
(assoc-ref %build-inputs "libc")
+ "/include:"
+ (assoc-ref %build-inputs "kernel-headers")
"/include"))
;; Don't use '-g' during the build to save space.
--
2.24.0
This bug report was last modified 5 years and 206 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.