Re: [PATCH bpf-next v5 3/3] bpftool: Make the LLVM disassembler an optional runtime dependency
From: Quentin Monnet
Date: Tue Nov 03 2026 - 17:20:00 EST
2026-11-03 18:59 UTC+0500 ~ Mark Korenberg via B4 Relay
<devnull+socketpair.gmail.com@xxxxxxxxxx>
> From: Mark Korenberg <socketpair@xxxxxxxxx>
>
> libLLVM is only needed for "bpftool prog dump jited", yet it is a hard
> dependency of bpftool: on Fedora 43, installing the ~730 KiB bpftool pulls
> in ~140 MiB of llvm20-libs.
>
> When libLLVM is a shared library, don't link bpftool with it. Instead,
> disasm_init() loads it with dlopen(), under its soname read at build
> time, and resolves the few llvm-c functions bpftool uses with dlsym(),
> like perf does for libcapstone. Distributions can then make LLVM an
> optional dependency of bpftool.
>
> "bpftool version" still reports "llvm" as a build time feature. Static
> LLVM, and LLVM built with one library per component, are linked as before.
>
> Link: https://github.com/libbpf/bpftool/issues/262
> Suggested-by: Alexei Starovoitov <ast@xxxxxxxxxx>
> Signed-off-by: Mark Korenberg <socketpair@xxxxxxxxx>
Tested-by: Quentin Monnet <qmo@xxxxxxxxxx>
Acked-by: Quentin Monnet <qmo@xxxxxxxxxx>
Thanks a lot for this work.