Re: [PATCH bpf-next v2 1/6] libbpf: Separate interfaces shared with in-tree tools

From: Quentin Monnet

Date: Mon Nov 23 2026 - 09:58:33 EST


2026-11-20 17:33 UTC-0700 ~ Ihor Solodrai <ihor.solodrai@xxxxxxxxx>
> resolve_btfids links libbpf statically and uses its BTF header
> accessor, field iterator and SHA-256 helper. libbpf_internal.h
> also defines logging macros and poisons kernel integer typedefs,
> so resolve_btfids wraps the hash helper in a separate source file.
>
> Move the shared declarations to libbpf_tools.h and use them
> directly in resolve_btfids. The header is for in-tree tools and
> stays uninstalled. No shared-library symbols change.


Hi Ihor, the change in bpftool's Makefile looks OK and I understand the
motivation for libbpf_tools.h for resolve_btfids. But I find it a bit
confusing to move away from libbpf_internal.h only partially for
bpftool, and to have a split dependency on both libbpf_internal.h and
libbpf_tools.h. Have you considered moving the other objects that
bpftool requires from libbpf_internal.h to libbpf_tools.h as well?

Thanks,
Quentin