🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #4567

Bug#1154040: bpfcc: FTBFS with LLVM 23 as default: llvm::MCContext API change

#4567
From: Sylvestre Ledru
Date: Sun, 15 Nov 2026 11:50
102 lines
5136 bytes
--1804289383-1794740525=:2281436
Content-Type: text/plain; charset=UTF-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Content-ID: <20261115120205.2281436@pulau.ecranbleu.org>

Source: bpfcc
Version: 0.37.0+ds-9
Severity: important
Tags: ftbfs patch
User: pkg-llvm-team@lists.alioth.debian.org
Usertags: llvm-23-default
Control: affects -1 + src:llvm-defaults
Control: block 1154024 by -1

Hello,

We are going to switch the default LLVM version to 23 (transition bug
#1154024). llvm-defaults 0.75~exp1, in experimental, already points to
23.

bpfcc fails to build in unstable with it, and builds without it:

src/cc/bcc_debug.cc:151:68: error: no matching function for call to
'llvm::MCContext::MCContext(llvm::Triple&,
 std::unique_ptr<llvm::MCAsmInfo>::pointer, [...])'

In LLVM 23, the MCContext constructor takes references instead of
pointers:

  MCContext(const Triple &TheTriple, const MCAsmInfo &MAI,
            const MCRegisterInfo &MRI, const MCSubtargetInfo &MSTI, ...)

so src/cc/bcc_debug.cc:151 should pass *MAI, *MRI, *STI for
LLVM_VERSION_MAJOR >= 23.

The attached debdiff adds an LLVM >= 23 branch. bpfcc builds with it.

To reproduce, with sbuild:

  sbuild -d unstable \
    --extra-repository='deb http://deb.debian.org/debian experimental main' \
    --build-dep-resolver=aptitude \
    --add-depends='clang (>= 1:23~), llvm-dev (>= 1:23~), libclang-dev (>= 1:23~)' \
    <package>

The --add-depends forces the llvm-defaults packages from experimental
(the default apt resolver won't pick them, aptitude does), everything
else comes from unstable.

The severity will be raised to serious once llvm-defaults 23 is in
unstable.

Cheers,
Sylvestre

--1804289383-1794740525=:2281436
Content-Type: text/x-diff; charset=UTF-8; name="bpfcc.debdiff"
Content-Disposition: attachment; filename="bpfcc.debdiff"
Content-Transfer-Encoding: 8bit
Content-ID: <20261115120205.2281436.1@pulau.ecranbleu.org>

diff --git a/debian/patches/llvm-23-mccontext.patch b/debian/patches/llvm-23-mccontext.patch
new file mode 100644
index 0000000..6a9a375
--- /dev/null
+++ b/debian/patches/llvm-23-mccontext.patch
@@ -0,0 +1,23 @@
+Description: Fix the build with LLVM 23
+ MCContext takes references instead of pointers since LLVM 23.
+Author: Sylvestre Ledru <sylvestre@debian.org>
+Forwarded: no
+Last-Update: 2026-11-15
+---
+Index: bpfcc-0.37.0+ds/src/cc/bcc_debug.cc
+===================================================================
+--- bpfcc-0.37.0+ds.orig/src/cc/bcc_debug.cc
++++ bpfcc-0.37.0+ds/src/cc/bcc_debug.cc
+@@ -147,7 +147,11 @@ void SourceDebugger::dump() {
+   std::unique_ptr<MCSubtargetInfo> STI(
+       T->createMCSubtargetInfo(TripleArg, "", ""));
+   MCObjectFileInfo MOFI;
+-#if LLVM_VERSION_MAJOR >= 13
++#if LLVM_VERSION_MAJOR >= 23
++  MCContext Ctx(TheTriple, *MAI, *MRI, *STI, nullptr);
++  Ctx.setObjectFileInfo(&MOFI);
++  MOFI.initMCObjectFileInfo(Ctx, false, false);
++#elif LLVM_VERSION_MAJOR >= 13
+   MCContext Ctx(TheTriple, MAI.get(), MRI.get(), STI.get(), nullptr);
+   Ctx.setObjectFileInfo(&MOFI);
+   MOFI.initMCObjectFileInfo(Ctx, false, false);
diff --git a/debian/patches/series b/debian/patches/series
index 6ba28e4..105e5ec 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ fix-install-path.patch
 2003-libbpf-tools-debian.patch
 0001-Cleanup-existing-temporary-kernel-headers-path.patch
 2004-fix-u64-format-strings.patch
+llvm-23-mccontext.patch

--1804289383-1794740525=:2281436--
Technical Details
Message-ID: <NZGU9-c1Wg-13@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!bofh.it!news.nic.it!robomod
From: Sylvestre Ledru <sylvestre@debian.org>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1154040: bpfcc: FTBFS with LLVM 23 as default: llvm::MCContext API change
Date: Sun, 15 Nov 2026 12:50:01 +0100
Message-ID: <NZGU9-c1Wg-13@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Sun Nov 15 11:41:16 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.9
Reply-To: Sylvestre Ledru <sylvestre@debian.org>, 1154040@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: rrs@debian.org
X-Debian-Pr-Message: report 1154040
X-Debian-Pr-Package: src:bpfcc
X-Debian-Pr-Keywords: ftbfs patch
X-Debian-Pr-Source: bpfcc
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="1804289383-1794740525=:2281436"
User-Agent: mail (GNU Mailutils 3.21)
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2002711
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 102
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Sun, 15 Nov 2026 12:02:05 +0100
X-Original-Message-ID: <20261115110205.8749119CDACB@pulau.ecranbleu.org>