Files
gentoo/dev-util/bcc/files/bcc-0.36.1-llvm22.patch
Holger Hoffstätte 0407cbbfcf dev-util/bcc: add patches for llvm-22 support
All merged upstream, except for the build fix silencing git.

Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
Part-of: https://github.com/gentoo/gentoo/pull/45976
Closes: https://github.com/gentoo/gentoo/pull/45976
Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
2026-04-03 12:07:21 -07:00

43 lines
1.7 KiB
Diff

https://github.com/iovisor/bcc/pull/5484
diff --git a/src/cc/frontends/clang/loader.cc b/src/cc/frontends/clang/loader.cc
index 6f8387a..1f70634 100644
--- a/src/cc/frontends/clang/loader.cc
+++ b/src/cc/frontends/clang/loader.cc
@@ -464,7 +464,10 @@ int ClangLoader::do_compile(
}
invocation0.getFrontendOpts().DisableFree = false;
-#if LLVM_VERSION_MAJOR >= 20
+#if LLVM_VERSION_MAJOR >= 22
+ compiler0.setVirtualFileSystem(llvm::vfs::getRealFileSystem());
+ compiler0.createDiagnostics(new IgnoringDiagConsumer());
+#elif LLVM_VERSION_MAJOR >= 20
compiler0.createDiagnostics(*llvm::vfs::getRealFileSystem(), new IgnoringDiagConsumer());
#else
compiler0.createDiagnostics(new IgnoringDiagConsumer());
@@ -487,7 +490,10 @@ int ClangLoader::do_compile(
add_main_input(invocation1, main_path, &*out_buf);
invocation1.getFrontendOpts().DisableFree = false;
-#if LLVM_VERSION_MAJOR >= 20
+#if LLVM_VERSION_MAJOR >= 22
+ compiler1.setVirtualFileSystem(llvm::vfs::getRealFileSystem());
+ compiler1.createDiagnostics();
+#elif LLVM_VERSION_MAJOR >= 20
compiler1.createDiagnostics(*llvm::vfs::getRealFileSystem());
#else
compiler1.createDiagnostics();
@@ -517,7 +523,10 @@ int ClangLoader::do_compile(
invocation2.getCodeGenOpts().setInlining(CodeGenOptions::NormalInlining);
// suppress warnings in the 2nd pass, but bail out on errors (our fault)
invocation2.getDiagnosticOpts().IgnoreWarnings = true;
-#if LLVM_VERSION_MAJOR >= 20
+#if LLVM_VERSION_MAJOR >= 22
+ compiler2.setVirtualFileSystem(llvm::vfs::getRealFileSystem());
+ compiler2.createDiagnostics();
+#elif LLVM_VERSION_MAJOR >= 20
compiler2.createDiagnostics(*llvm::vfs::getRealFileSystem());
#else
compiler2.createDiagnostics();