Re: [PATCH 3/3] bpftool: Allow to link libbpf dynamically
From: Alexei Starovoitov <hidden>
Date: 2019-11-27 16:41:53
Also in:
bpf, lkml
From: Alexei Starovoitov <hidden>
Date: 2019-11-27 16:41:53
Also in:
bpf, lkml
On Wed, Nov 27, 2019 at 1:49 AM Jiri Olsa [off-list ref] wrote:
diff --git a/tools/build/feature/test-libbpf.c b/tools/build/feature/test-libbpf.c index a508756cf4cc..93566d105a64 100644 --- a/tools/build/feature/test-libbpf.c +++ b/tools/build/feature/test-libbpf.c@@ -3,5 +3,14 @@ int main(void) { +#ifdef BPFTOOL + /* + * libbpf_netlink_open (LIBBPF_0.0.6) is the latest + * we need for bpftool at the moment + */ + libbpf_netlink_open(NULL); + return 0; +#else return bpf_object__open("test") ? 0 : -1; +#endif
Such hack should be a clear sign that it's not appropriate for libbpf to be public netlink api library. Few functions that it already has are for libbpf and bpftool internal usage only.