From patchwork Tue Nov 19 16:19:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 16148 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B20781777A; Tue, 19 Nov 2019 16:20:24 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 7675117777 for ; Tue, 19 Nov 2019 16:20:24 +0000 (GMT) Received: from localhost ([::1]:47116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX6Ep-0005TX-B9 for patchwork@mira.cbaines.net; Tue, 19 Nov 2019 11:20:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37000) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX6Eb-0005Oo-Ot for guix-patches@gnu.org; Tue, 19 Nov 2019 11:20:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX6EV-0004qP-KS for guix-patches@gnu.org; Tue, 19 Nov 2019 11:20:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39516) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iX6EU-0004q0-Ep for guix-patches@gnu.org; Tue, 19 Nov 2019 11:20:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iX6EU-00022w-7P for guix-patches@gnu.org; Tue, 19 Nov 2019 11:20:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38276] Fix kernel-headers path in clang Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 19 Nov 2019 16:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38276 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 38276@debbugs.gnu.org X-Debbugs-Original-To: "guix-patches\@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.15741803507797 (code B ref -1); Tue, 19 Nov 2019 16:20:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Nov 2019 16:19:10 +0000 Received: from localhost ([127.0.0.1]:48337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iX6De-00021g-7D for submit@debbugs.gnu.org; Tue, 19 Nov 2019 11:19:10 -0500 Received: from lists.gnu.org ([209.51.188.17]:50474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iX6Dc-00021Z-DA for submit@debbugs.gnu.org; Tue, 19 Nov 2019 11:19:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36793) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iX6Da-0004ZS-Qd for guix-patches@gnu.org; Tue, 19 Nov 2019 11:19:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iX6DZ-000423-Jl for guix-patches@gnu.org; Tue, 19 Nov 2019 11:19:06 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:35050) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iX6DZ-00040p-Bq for guix-patches@gnu.org; Tue, 19 Nov 2019 11:19:05 -0500 Received: by mail-wm1-x330.google.com with SMTP id 8so4412372wmo.0 for ; Tue, 19 Nov 2019 08:19:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=uJ5cw7PgStC5DIA5uD02e4h8TCVh7uefVY+ZisFXdNA=; b=izd8uHSICGzoYo3iMI1NGWfkgYWY9xj2lUy2Qhr/3BuPr4Q4wl088f9QCv6IvbKwve mVoT6BtDSRADWwwKRxWf4NlVKrFsOl1UnvlRyuhZ+BbH4rxKdhBLPyYJmT2YOA9l6H3x SVAL4phHlVbR1x8wYDAIs1mfzyZ4P9ZT7eBDr6jGvSgnDZ3DRDo7UkhI3V18M2DiLIy4 xZ8jJu22//iONz3yNoS+HEF6csla1Eq0gjm5r+6q5Q80Rf8oPL5hDslTOu0oeoeQaom0 4hBtKMg7JqKij/462xUPYBKI6fT9XY3fb8HfeEOhXWhtxm2quj8xZV7BziYvNT4kIIgV 65LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=uJ5cw7PgStC5DIA5uD02e4h8TCVh7uefVY+ZisFXdNA=; b=DRYG86cNRw0eRwFqs1lNr1f+yqywNih/Eave8irMpsWlYrblPe66aSNhLEgF9Ee7xP dgWqWrqvVLobdfh6VrFtIOzw/6qupr1pEvs9LNMOzE0ZdGeqUJd63lrKYWsG5FmOyoyI UBS8pv/s+/yBMR+uovu3Yn5wo5gZImydFIvJb+d2b9WooFObRAoGYQDWTxiduDaJHuuZ zwzG10aavupHij/1MyJN3E/g/K9rgTMPMJlbhQsp8gse3Rgd7/mKHJZAkJHbmDRX73/f Mzr+RknFCUf5vt5uQ1nWaxF6uKR2at/B9lbO0vW8DwTKaF4zl/ljb/J6vq81mmatECSM RCMg== X-Gm-Message-State: APjAAAWm4JyGrDI8Anz1964BTCNxw8zzGJC2s09awrPeLZTymL7uql55 GmTKMnuKYX6kc0jMMpdFK8fgfpU4 X-Google-Smtp-Source: APXvYqwe0x0r/yhoRr0nm40PK9Ol8GpYdEA1JdLzy7kzNZPgGkrqU9GETxnzxaOjflaL2Wed4B58pg== X-Received: by 2002:a1c:4e1a:: with SMTP id g26mr6880958wmh.138.1574180343863; Tue, 19 Nov 2019 08:19:03 -0800 (PST) Received: from meru ([90.114.75.61]) by smtp.gmail.com with ESMTPSA id y6sm28328292wrn.21.2019.11.19.08.19.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2019 08:19:02 -0800 (PST) User-agent: mu4e 1.2.0; emacs 26.3 From: Mathieu Othacehe Date: Tue, 19 Nov 2019 17:19:01 +0100 Message-ID: <871ru34z62.fsf@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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 From 198e59f7645bffbc2ba1e68db2747b8c07997ad6 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe 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