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/0001-Fix-build-with-LLVM-22.patch61
-rw-r--r--meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/fix_for_memleak.patch16
-rw-r--r--meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.36.1.bb (renamed from meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb)7
4 files changed, 64 insertions, 70 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
deleted file mode 100644
index 571b496f71..0000000000
--- a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Fix-a-build-failure-with-clang21-5369.patch
+++ /dev/null
@@ -1,50 +0,0 @@
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/0001-Fix-build-with-LLVM-22.patch b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Fix-build-with-LLVM-22.patch
new file mode 100644
index 0000000000..19f0a6ccb4
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-Fix-build-with-LLVM-22.patch
@@ -0,0 +1,61 @@
1From 4c7be1ec6ab74e973f8d18a9011fa349c3d9dd58 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= <holger@applied-asynchrony.com>
3Date: Mon, 2 Mar 2026 10:03:15 +0100
4Subject: [PATCH] Fix build with LLVM-22
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9LLVM-22 changed the signatures of various createDiagnostics() calls [1].
10Introduce a new version macro guard and adapt the code to the changed API.
11
12Fixes #5483
13
14[1] https://github.com/llvm/llvm-project/commit/30633f30894129919050f24fdd1f8f6bc46beae0
15
16Upstream-Status: Backport [https://github.com/iovisor/bcc/commit/4c7be1ec6ab74e973f8d18a9011fa349c3d9dd58]
17Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
18---
19 src/cc/frontends/clang/loader.cc | 15 ++++++++++++---
20 1 file changed, 12 insertions(+), 3 deletions(-)
21
22diff --git a/src/cc/frontends/clang/loader.cc b/src/cc/frontends/clang/loader.cc
23index 6f8387aa..1f706344 100644
24--- a/src/cc/frontends/clang/loader.cc
25+++ b/src/cc/frontends/clang/loader.cc
26@@ -464,7 +464,10 @@ int ClangLoader::do_compile(
27 }
28 invocation0.getFrontendOpts().DisableFree = false;
29
30-#if LLVM_VERSION_MAJOR >= 20
31+#if LLVM_VERSION_MAJOR >= 22
32+ compiler0.setVirtualFileSystem(llvm::vfs::getRealFileSystem());
33+ compiler0.createDiagnostics(new IgnoringDiagConsumer());
34+#elif LLVM_VERSION_MAJOR >= 20
35 compiler0.createDiagnostics(*llvm::vfs::getRealFileSystem(), new IgnoringDiagConsumer());
36 #else
37 compiler0.createDiagnostics(new IgnoringDiagConsumer());
38@@ -487,7 +490,10 @@ int ClangLoader::do_compile(
39 add_main_input(invocation1, main_path, &*out_buf);
40 invocation1.getFrontendOpts().DisableFree = false;
41
42-#if LLVM_VERSION_MAJOR >= 20
43+#if LLVM_VERSION_MAJOR >= 22
44+ compiler1.setVirtualFileSystem(llvm::vfs::getRealFileSystem());
45+ compiler1.createDiagnostics();
46+#elif LLVM_VERSION_MAJOR >= 20
47 compiler1.createDiagnostics(*llvm::vfs::getRealFileSystem());
48 #else
49 compiler1.createDiagnostics();
50@@ -517,7 +523,10 @@ int ClangLoader::do_compile(
51 invocation2.getCodeGenOpts().setInlining(CodeGenOptions::NormalInlining);
52 // suppress warnings in the 2nd pass, but bail out on errors (our fault)
53 invocation2.getDiagnosticOpts().IgnoreWarnings = true;
54-#if LLVM_VERSION_MAJOR >= 20
55+#if LLVM_VERSION_MAJOR >= 22
56+ compiler2.setVirtualFileSystem(llvm::vfs::getRealFileSystem());
57+ compiler2.createDiagnostics();
58+#elif LLVM_VERSION_MAJOR >= 20
59 compiler2.createDiagnostics(*llvm::vfs::getRealFileSystem());
60 #else
61 compiler2.createDiagnostics();
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/fix_for_memleak.patch b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/fix_for_memleak.patch
deleted file mode 100644
index a3a1ec931d..0000000000
--- a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/fix_for_memleak.patch
+++ /dev/null
@@ -1,16 +0,0 @@
1Upstream-Status: Submitted [https://github.com/iovisor/bcc/pull/5355]
2Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
3
4diff --git a/tests/python/test_tools_memleak.py b/tests/python/test_tools_memleak.py
5--- a/tests/python/test_tools_memleak.py
6+++ b/tests/python/test_tools_memleak.py
7@@ -26,7 +26,7 @@
8 # Build the memory leaking application.
9 c_src = 'test_tools_memleak_leaker_app.c'
10 tmp_dir = tempfile.mkdtemp(prefix='bcc-test-memleak-')
11- c_src_full = os.path.dirname(sys.argv[0]) + os.path.sep + c_src
12+ c_src_full = os.path.abspath(os.path.dirname(sys.argv[0])) + os.path.sep + c_src
13 exec_dst = tmp_dir + os.path.sep + 'leaker_app'
14
15 if subprocess.call(['gcc', '-g', '-O0', '-o', exec_dst, c_src_full]) != 0:
16
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.36.1.bb
index 6e821cca7a..0d8bee5da4 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.36.1.bb
@@ -19,20 +19,19 @@ DEPENDS += "bison-native \
19RDEPENDS:${PN} += "bash python3 python3-core python3-setuptools xz" 19RDEPENDS:${PN} += "bash python3 python3-core python3-setuptools xz"
20RDEPENDS:${PN}-ptest = "kernel-devsrc packagegroup-core-buildessential cmake bash python3 python3-netaddr python3-pyroute2" 20RDEPENDS:${PN}-ptest = "kernel-devsrc packagegroup-core-buildessential cmake bash python3 python3-netaddr python3-pyroute2"
21 21
22SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https;tag=v${PV} \ 22SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https;lfs=0;tag=v${PV} \
23 file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ 23 file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \
24 file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \ 24 file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \
25 file://0001-Fix-a-build-failure-with-clang21-5369.patch \
26 file://0001-Add-ARM64-syscall-prefix-detection-in-C-API.patch \ 25 file://0001-Add-ARM64-syscall-prefix-detection-in-C-API.patch \
27 file://0002-Add-riscv-syscall-prefix-detection-in-C-API.patch \ 26 file://0002-Add-riscv-syscall-prefix-detection-in-C-API.patch \
28 file://0003-folly-tracing-Remove-x86-specific-naming-from-tracin.patch \ 27 file://0003-folly-tracing-Remove-x86-specific-naming-from-tracin.patch \
29 file://0004-folly-tracing-Add-ARM-and-AArch64-support-to-static-.patch \ 28 file://0004-folly-tracing-Add-ARM-and-AArch64-support-to-static-.patch \
29 file://0001-Fix-build-with-LLVM-22.patch \
30 file://run-ptest \ 30 file://run-ptest \
31 file://ptest_wrapper.sh \ 31 file://ptest_wrapper.sh \
32 file://fix_for_memleak.patch \
33 " 32 "
34 33
35SRCREV = "c31a1ca305f787ba53e001ead45ebf65233a32cf" 34SRCREV = "b9f1b2ab025e3ac95b6aaa1cb20bf222a7b8804e"
36 35
37PACKAGECONFIG ??= "examples" 36PACKAGECONFIG ??= "examples"
38PACKAGECONFIG:remove:libc-musl = "examples" 37PACKAGECONFIG:remove:libc-musl = "examples"