From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BD1F81382C5 for ; Sat, 1 May 2021 21:24:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2098CE0D23; Sat, 1 May 2021 21:24:19 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EA4C3E0D1D for ; Sat, 1 May 2021 21:24:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 45632340D2B for ; Sat, 1 May 2021 21:24:16 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3B7D3750 for ; Sat, 1 May 2021 21:24:13 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1619904116.10d7a5b482f6282eaefdb28ceda51f2ec99056f8.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/files/, dev-util/clazy/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-util/clazy/clazy-1.9.ebuild dev-util/clazy/files/clazy-1.9-llvm12.patch dev-util/clazy/files/clazy-1.9-llvm13.patch X-VCS-Directories: dev-util/clazy/files/ dev-util/clazy/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 10d7a5b482f6282eaefdb28ceda51f2ec99056f8 X-VCS-Branch: master Date: Sat, 1 May 2021 21:24:13 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: a8779aa1-aacb-4900-ab12-9e419e93f534 X-Archives-Hash: afff4840aa9c322a4ac68367bf87774c commit: 10d7a5b482f6282eaefdb28ceda51f2ec99056f8 Author: Andreas Sturmlechner gentoo org> AuthorDate: Sat May 1 20:18:02 2021 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Sat May 1 21:21:56 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10d7a5b4 dev-util/clazy: Fix build with LLVM-12/13 Closes: https://bugs.gentoo.org/786525 Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Andreas Sturmlechner gentoo.org> dev-util/clazy/clazy-1.9.ebuild | 2 + dev-util/clazy/files/clazy-1.9-llvm12.patch | 88 +++++++++++++++++++++++++++++ dev-util/clazy/files/clazy-1.9-llvm13.patch | 31 ++++++++++ 3 files changed, 121 insertions(+) diff --git a/dev-util/clazy/clazy-1.9.ebuild b/dev-util/clazy/clazy-1.9.ebuild index 9062383103c..781b5104055 100644 --- a/dev-util/clazy/clazy-1.9.ebuild +++ b/dev-util/clazy/clazy-1.9.ebuild @@ -20,6 +20,8 @@ RDEPEND=" " DEPEND="${RDEPEND}" +PATCHES=( "${FILESDIR}"/${P}-llvm{12,13}.patch ) # bug 786525 + src_prepare() { cmake_src_prepare diff --git a/dev-util/clazy/files/clazy-1.9-llvm12.patch b/dev-util/clazy/files/clazy-1.9-llvm12.patch new file mode 100644 index 00000000000..3862f40ad98 --- /dev/null +++ b/dev-util/clazy/files/clazy-1.9-llvm12.patch @@ -0,0 +1,88 @@ +From 2592a6e3393ebc75e16c91e606ad2015a16295c3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20Sch=C3=A4rf?= +Date: Sat, 23 Jan 2021 15:34:10 +0100 +Subject: [PATCH] Fix build with Clang 12 + +Required due to Clang changes https://github.com/llvm/llvm-project/commit/b3eff6b7bb31e7ef059a3d238de138849839fbbd and https://github.com/llvm/llvm-project/commit/d758f79e5d381bd4f5122193a9538d89c907c812 +--- + src/SourceCompatibilityHelpers.h | 26 ++++++++++++++++++++++++++ + src/SuppressionManager.cpp | 5 ++--- + 2 files changed, 28 insertions(+), 3 deletions(-) + +diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h +index 4db141ab..1737d5a5 100644 +--- a/src/SourceCompatibilityHelpers.h ++++ b/src/SourceCompatibilityHelpers.h +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + + #if defined(CLAZY_USES_BOOST_REGEX) +@@ -103,6 +104,31 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d + #endif + } + ++inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid) ++{ ++#if LLVM_VERSION_MAJOR >= 12 ++ auto buffer = sm.getBufferOrNone(id); ++ *invalid = !buffer.hasValue(); ++ return buffer; ++#else ++ return sm.getBuffer(id, invalid); ++#endif ++} ++ ++#if LLVM_VERSION_MAJOR >= 12 ++inline clang::Lexer getLexer(clang::FileID id, llvm::Optional inputFile, ++ const clang::SourceManager &sm, const clang::LangOptions &lo) ++{ ++ return clang::Lexer(id, inputFile.getValue(), sm, lo); ++} ++#else ++inline clang::Lexer getLexer(clang::FileID id, const llvm::MemoryBuffer *inputFile, ++ const clang::SourceManager &sm, const clang::LangOptions &lo) ++{ ++ return clang::Lexer(id, inputFile, sm, lo); ++} ++#endif ++ + } + + #endif +diff --git a/src/SuppressionManager.cpp b/src/SuppressionManager.cpp +index 9d774ea6..9881388d 100644 +--- a/src/SuppressionManager.cpp ++++ b/src/SuppressionManager.cpp +@@ -24,7 +24,6 @@ + #include "clazy_stl.h" + + #include +-#include + #include + #include + #include +@@ -84,7 +83,7 @@ void SuppressionManager::parseFile(FileID id, const SourceManager &sm, const cla + Suppressions &suppressions = (*it).second; + + bool invalid = false; +- auto buffer = sm.getBuffer(id, &invalid); ++ auto buffer = clazy::getBuffer(sm, id, &invalid); + if (invalid) { + llvm::errs() << "SuppressionManager::parseFile: Invalid buffer "; + if (buffer) +@@ -92,7 +91,7 @@ void SuppressionManager::parseFile(FileID id, const SourceManager &sm, const cla + return; + } + +- Lexer lexer(id, buffer, sm, lo); ++ auto lexer = clazy::getLexer(id, buffer, sm, lo); + lexer.SetCommentRetentionState(true); + + Token token; +-- +GitLab + diff --git a/dev-util/clazy/files/clazy-1.9-llvm13.patch b/dev-util/clazy/files/clazy-1.9-llvm13.patch new file mode 100644 index 00000000000..9bbac8f7624 --- /dev/null +++ b/dev-util/clazy/files/clazy-1.9-llvm13.patch @@ -0,0 +1,31 @@ +From 0bf4e428c76270f4534a0a8df3cf6912157f22ab Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= +Date: Sat, 17 Apr 2021 20:57:10 +0200 +Subject: [PATCH] Fix build with LLVM 13 + +--- + src/ClazyStandaloneMain.cpp | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/ClazyStandaloneMain.cpp b/src/ClazyStandaloneMain.cpp +index 41c4fcf9..7b4cf5d3 100644 +--- a/src/ClazyStandaloneMain.cpp ++++ b/src/ClazyStandaloneMain.cpp +@@ -158,7 +158,13 @@ llvm::IntrusiveRefCntPtr getVfsFromFile(const std::string &over + + int main(int argc, const char **argv) + { +- CommonOptionsParser optionsParser(argc, argv, s_clazyCategory, cl::ZeroOrMore); ++ auto expectedParser = CommonOptionsParser::create(argc, argv, s_clazyCategory, cl::ZeroOrMore); ++ if (!expectedParser) { ++ llvm::errs() << expectedParser.takeError(); ++ return 1; ++ } ++ ++ auto &optionsParser = expectedParser.get(); + // llvm::errs() << optionsParser.getSourcePathList().size() << "\n"; + + if (s_supportedChecks.getValue()) { +-- +GitLab +