🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
1 messages
1 total messages Started by Sylvestre Ledru Sun, 15 Nov 2026 11:50
Bug#1154040: bpfcc: FTBFS with LLVM 23 as default: llvm::MCContext API change
#4567
Author: 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--
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads