summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Fix-a-build-failure-with-clang21-5369.patch50
-rw-r--r--meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb1
2 files changed, 51 insertions, 0 deletions
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Fix-a-build-failure-with-clang21-5369.patch b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Fix-a-build-failure-with-clang21-5369.patch
new file mode 100644
index 0000000000..571b496f71
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Fix-a-build-failure-with-clang21-5369.patch
@@ -0,0 +1,50 @@
1From 2e3997121af597f3a54d97505a38b7fdb9febae3 Mon Sep 17 00:00:00 2001
2From: yonghong-song <ys114321@gmail.com>
3Date: Mon, 14 Jul 2025 20:21:59 -0700
4Subject: [PATCH] Fix a build failure with clang21 (#5369)
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9The build error message:
10 src/cc/frontends/clang/loader.cc:400:73: error: no matching function for
11 call to ‘clang::TextDiagnosticPrinter::TextDiagnosticPrinter(
12 llvm::raw_fd_ostream&, clang::DiagnosticOptions*)’
13 400 | auto diag_client = new TextDiagnosticPrinter(llvm::errs(), &*diag_opts);
14 | ^
15The llvm commit
16 https://github.com/llvm/llvm-project/pull/139584
17caused the build failure.
18
19Adjust the code properly and the error is fixed.
20
21Upstream-Status: Backport [https://github.com/iovisor/bcc/commit/8c5c96ad3beeed2fa827017f451a952306826974]
22Signed-off-by: Khem Raj <raj.khem@gmail.com>
23---
24 src/cc/frontends/clang/loader.cc | 8 ++++++++
25 1 file changed, 8 insertions(+)
26
27diff --git a/src/cc/frontends/clang/loader.cc b/src/cc/frontends/clang/loader.cc
28index 07dc9d6a..6f8387aa 100644
29--- a/src/cc/frontends/clang/loader.cc
30+++ b/src/cc/frontends/clang/loader.cc
31@@ -396,11 +396,19 @@ int ClangLoader::do_compile(
32 flags_cstr_rem.end());
33
34 // set up the error reporting class
35+#if LLVM_VERSION_MAJOR >= 21
36+ DiagnosticOptions diag_opts;
37+ auto diag_client = new TextDiagnosticPrinter(llvm::errs(), diag_opts);
38+
39+ IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
40+ DiagnosticsEngine diags(DiagID, diag_opts, diag_client);
41+#else
42 IntrusiveRefCntPtr<DiagnosticOptions> diag_opts(new DiagnosticOptions());
43 auto diag_client = new TextDiagnosticPrinter(llvm::errs(), &*diag_opts);
44
45 IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
46 DiagnosticsEngine diags(DiagID, &*diag_opts, diag_client);
47+#endif
48
49 // set up the command line argument wrapper
50
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb
index b810f6ec77..8c6e44edbc 100644
--- a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb
@@ -21,6 +21,7 @@ RDEPENDS:${PN}-ptest = "kernel-devsrc packagegroup-core-buildessential cmake bas
21SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https;tag=v${PV} \ 21SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https;tag=v${PV} \
22 file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ 22 file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \
23 file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \ 23 file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \
24 file://0001-Fix-a-build-failure-with-clang21-5369.patch \
24 file://run-ptest \ 25 file://run-ptest \
25 file://ptest_wrapper.sh \ 26 file://ptest_wrapper.sh \
26 file://fix_for_memleak.patch \ 27 file://fix_for_memleak.patch \