Em Wed, Oct 20, 2021 at 02:27:37PM -0700, Andrii Nakryiko escreveu: > On Wed, Oct 20, 2021 at 2:23 PM Ian Rogers <irogers@xxxxxxxxxx> wrote: > > On Wed, Oct 20, 2021 at 2:12 PM Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> wrote: > > > On Thu, Oct 14, 2021 at 2:20 PM Ian Rogers <irogers@xxxxxxxxxx> wrote: > > > > @@ -648,6 +650,7 @@ static int32_t btf_encoder__add_datasec(struct btf_encoder *encoder, const char > > > > static int32_t btf_encoder__add_tag(struct btf_encoder *encoder, const char *value, uint32_t type, > > > > int component_idx) > > > > { > > > > +#ifdef BTF_KIND_TAG /* Proxy for libbtf 6.0 */ > > > How will this work when libbpf is loaded dynamically? I believe pahole > > > has this mode as well. > > Well it won't have a compilation error because BTF_KIND_TAG isn't > Great, you traded compile-time error for runtime linking error, I hope > that trade off makes sense to Arnaldo. This situation is tricky to handle, yeah :-\ > > undefined :-) Tbh, I'm not sure but it seems that you'd be limited to > > features in the version of libbpf you compiled against. > I've been consistently advocating for statically linking against > libbpf exactly to control what APIs and features are supported. But > people stubbornly want dynamic linking. I hope added complexity and > feature detection makes sense in practice for pahole. It is a pain, but fedora also have this policy. > > > Also, note that libbpf now provides LIBBPF_MAJOR_VERSION and > > > LIBBPF_MINOR_VERSION macros, starting from 0.5, so no need for > > > guessing the version > > > > This was moved to a header file in: > > https://lore.kernel.org/bpf/CAADnVQJ2qd095mvj3z9u9BXQYCe2OTDn4=Gsu9nv1tjFHc2yqQ@xxxxxxxxxxxxxx/T/ > > > > But that header doesn't appear any more: > > https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/tree/tools/lib/bpf > > > > Is that a bug? > > You should be checking here: > > https://github.com/libbpf/libbpf/blob/master/src/libbpf_version.h Ian, would be so kind as to follow up on this so that we get this situation improved? - Arnaldo