Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: sunilkumar.dora@windriver.com
To: openembedded-devel@lists.openembedded.org
Cc: raj.khem@gmail.com, deepesh.varatharajan@windriver.com,
	sundeep.kokkonda@windriver.com
Subject: [meta-oe][PATCH 2/2] bcc: Fix build with LLVM 23
Date: Sat, 29 Aug 2026 11:35:20 +0530	[thread overview]
Message-ID: <20260829060520.2905173-3-sunilkumar.dora@windriver.com> (raw)
In-Reply-To: <20260829060520.2905173-1-sunilkumar.dora@windriver.com>

From: Sunil Dora <sunilkumar.dora@windriver.com>

LLVM 23 changed the MCContext constructor to take MCAsmInfo,
MCRegisterInfo and MCSubtargetInfo by reference rather than by pointer,
so bcc no longer builds:

  src/cc/bcc_debug.cc:151:68: error: no matching function for call to
  'llvm::MCContext::MCContext(...)'

Backport the upstream fix. It is guarded on LLVM_VERSION_MAJOR so older
Clang keeps working. There is no release carrying it yet; v0.37.0 is
still the newest tag.

Co-authored-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
---
 ...ix-MCContext-constructor-for-LLVM-23.patch | 36 +++++++++++++++++++
 .../recipes-devtools/bcc/bcc_0.37.0.bb        |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-src-cc-Fix-MCContext-constructor-for-LLVM-23.patch

diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-src-cc-Fix-MCContext-constructor-for-LLVM-23.patch b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-src-cc-Fix-MCContext-constructor-for-LLVM-23.patch
new file mode 100644
index 0000000000..b29e85ee64
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc/0001-src-cc-Fix-MCContext-constructor-for-LLVM-23.patch
@@ -0,0 +1,36 @@
+From dad0db93fd0f443b2a4f43bc2f23c621c9202516 Mon Sep 17 00:00:00 2001
+From: Viktor Malik <viktor.malik@gmail.com>
+Date: Thu, 13 Aug 2026 08:22:00 +0200
+Subject: [PATCH] src/cc: Fix MCContext constructor for LLVM 23
+
+Two LLVM 23 patches [1,2] changed the MCContext constructor to take
+MCAsmInfo, MCRegisterInfo, and MCSubtargetInfo by a reference rather
+than by a pointer. Reflect the change in call of the constructor.
+
+[1] https://github.com/llvm/llvm-project/commit/13e98d834101efd1794cdd026377c508293ee21b
+[2] https://github.com/llvm/llvm-project/commit/d50631faad3003e73589528c83d3bbbad7ba72f1
+
+Upstream-Status: Backport [https://github.com/iovisor/bcc/commit/dad0db93fd0f]
+
+Signed-off-by: Viktor Malik <viktor.malik@gmail.com>
+Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
+---
+ src/cc/bcc_debug.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/cc/bcc_debug.cc b/src/cc/bcc_debug.cc
+index 2e53c44d4778..0812c4abc788 100644
+--- a/src/cc/bcc_debug.cc
++++ b/src/cc/bcc_debug.cc
+@@ -148,7 +148,11 @@ void SourceDebugger::dump() {
+       T->createMCSubtargetInfo(TripleArg, "", ""));
+   MCObjectFileInfo MOFI;
+ #if LLVM_VERSION_MAJOR >= 13
++#if LLVM_VERSION_MAJOR >= 23
++  MCContext Ctx(TheTriple, *MAI, *MRI, *STI, nullptr);
++#else
+   MCContext Ctx(TheTriple, MAI.get(), MRI.get(), STI.get(), nullptr);
++#endif
+   Ctx.setObjectFileInfo(&MOFI);
+   MOFI.initMCObjectFileInfo(Ctx, false, false);
+ #else
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.37.0.bb b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.37.0.bb
index 9315a6e603..2d44abebb4 100644
--- a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.37.0.bb
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.37.0.bb
@@ -23,6 +23,7 @@ SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https;lfs=0;tag
            file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \
            file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \
            file://0001-tests-cc-Allow-overriding-the-runtime-location-of-te.patch \
+           file://0001-src-cc-Fix-MCContext-constructor-for-LLVM-23.patch \
            file://run-ptest \
            file://ptest_wrapper.sh \
            "
-- 
2.43.0



      parent reply	other threads:[~2026-08-29  6:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-29  6:05 [meta-oe][PATCH 0/2] Fix bcc and castxml builds with LLVM 23 sunilkumar.dora
2026-08-29  6:05 ` [meta-oe][PATCH 1/2] castxml: Fix build " sunilkumar.dora
2026-08-29  6:05 ` sunilkumar.dora [this message]

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=20260829060520.2905173-3-sunilkumar.dora@windriver.com \
    --to=sunilkumar.dora@windriver.com \
    --cc=deepesh.varatharajan@windriver.com \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=raj.khem@gmail.com \
    --cc=sundeep.kokkonda@windriver.com \
    /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