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

Package:
src:bpfcc
Source:
src:bpfcc
Submitter:
Sylvestre Ledru
Date:
2026-11-15 11:41:05 UTC
Severity:
normal
Tags:
#1154040#5
Date:
2026-11-15 11:02:05 UTC
From:
To:
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