From: Matthew Dawson <matthew@mjdsystems.ca>
To: linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com
Cc: Matthew Dawson <matthew@mjdsystems.ca>
Subject: [PATCH] tools build: Fix clang detection with clang >= 8.0
Date: Tue, 13 Aug 2019 01:07:31 -0400 [thread overview]
Message-ID: <20190813050731.57131-1-matthew@mjdsystems.ca> (raw)
The 8.0 release of clang/llvm moved the VirtualFileSystem.h header
to from clang to llvm. This change causes a compile error, causing
perf to not detect clang/llvm.
Fix by including the right header for the different versions of llvm,
using the older header for llvm < 8, and the new header for llvm >= 8.
Signed-off-by: Matthew Dawson <matthew@mjdsystems.ca>
---
tools/build/feature/test-clang.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/build/feature/test-clang.cpp b/tools/build/feature/test-clang.cpp
index a2b3f092d2f0..313ef1568880 100644
--- a/tools/build/feature/test-clang.cpp
+++ b/tools/build/feature/test-clang.cpp
@@ -1,10 +1,14 @@
// SPDX-License-Identifier: GPL-2.0
-#include "clang/Basic/VirtualFileSystem.h"
#include "clang/Driver/Driver.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/raw_ostream.h"
+#if LLVM_VERSION_MAJOR >= 8
+#include "llvm/Support/VirtualFileSystem.h"
+#else
+#include "clang/Basic/VirtualFileSystem.h"
+#endif
using namespace clang;
using namespace clang::driver;
--
2.21.0
next reply other threads:[~2019-08-13 5:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-13 5:07 Matthew Dawson [this message]
2019-08-14 20:47 ` Nick Desaulniers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190813050731.57131-1-matthew@mjdsystems.ca \
--to=matthew@mjdsystems.ca \
--cc=clang-built-linux@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®