linux-stable/tools/bpf/bpftool
Quentin Monnet e41ac2020b bpftool: Install libbpf headers for the bootstrap version, too
We recently changed bpftool's Makefile to make it install libbpf's
headers locally instead of pulling them from the source directory of the
library. Although bpftool needs two versions of libbpf, a "regular" one
and a "bootstrap" version, we would only install headers for the regular
libbpf build. Given that this build always occurs before the bootstrap
build when building bpftool, this is enough to ensure that the bootstrap
bpftool will have access to the headers exported through the regular
libbpf build.

However, this did not account for the case when we only want the
bootstrap version of bpftool, through the "bootstrap" target. For
example, perf needs the bootstrap version only, to generate BPF
skeletons. In that case, when are the headers installed? For some time,
the issue has been masked, because we had a step (the installation of
headers internal to libbpf) which would depend on the regular build of
libbpf and hence trigger the export of the headers, just for the sake of
creating a directory. But this changed with commit 8b6c46241c
("bpftool: Remove Makefile dep. on $(LIBBPF) for
$(LIBBPF_INTERNAL_HDRS)"), where we cleaned up that stage and removed
the dependency on the regular libbpf build. As a result, when we only
want the bootstrap bpftool version, the regular libbpf is no longer
built. The bootstrap libbpf version is built, but headers are not
exported, and the bootstrap bpftool build fails because of the missing
headers.

To fix this, we also install the library headers for the bootstrap
version of libbpf, to use them for the bootstrap bpftool and for
generating the skeletons.

Fixes: f012ade10b ("bpftool: Install libbpf headers instead of including the dir")
Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: https://lore.kernel.org/bpf/20211105015813.6171-1-quentin@isovalent.com
2021-11-05 16:19:48 +01:00
..
Documentation tools: bpftool: Complete metrics list in "bpftool prog profile" doc 2021-07-30 15:40:28 -07:00
bash-completion tools: bpftool: Complete metrics list in "bpftool prog profile" doc 2021-07-30 15:40:28 -07:00
skeleton tools, bpftool: Remove two unused variables. 2020-10-29 15:23:18 +01:00
.gitignore tools/bpf: Remove bpf-helpers from bpftool docs 2021-03-04 18:39:45 -08:00
Makefile bpftool: Install libbpf headers for the bootstrap version, too 2021-11-05 16:19:48 +01:00
btf.c bpftool: Switch to libbpf's hashmap for PIDs/names references 2021-10-25 17:31:39 -07:00
btf_dumper.c tools: Replace btf__get_from_id() with btf__load_from_kernel_by_id() 2021-07-29 17:23:52 -07:00
cfg.c tools, bpftool: Poison and replace kernel integer typedefs 2020-05-11 21:20:46 +02:00
cfg.h tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00
cgroup.c tools: bpftool: Document and add bash completion for -L, -B options 2021-07-30 15:40:28 -07:00
common.c bpftool: Switch to libbpf's hashmap for pinned paths of BPF objects 2021-10-25 17:31:38 -07:00
feature.c bpftool: Only probe trace_vprintk feature in 'full' mode 2021-09-17 14:02:05 -07:00
gen.c bpftool: Switch to new btf__type_cnt API 2021-10-22 16:09:14 -07:00
iter.c selftests/bpf: Switch to new bpf_object__next_{map,program} APIs 2021-10-06 12:34:02 -07:00
jit_disasm.c bpftool: Properly close va_list 'ap' by va_end() on error 2021-07-06 09:19:23 +02:00
json_writer.c bpftool: Support dumping metadata 2020-09-15 18:28:27 -07:00
json_writer.h bpftool: Support dumping metadata 2020-09-15 18:28:27 -07:00
link.c bpftool: Switch to libbpf's hashmap for PIDs/names references 2021-10-25 17:31:39 -07:00
main.c bpftool: Switch to libbpf's hashmap for PIDs/names references 2021-10-25 17:31:39 -07:00
main.h bpftool: Switch to libbpf's hashmap for PIDs/names references 2021-10-25 17:31:39 -07:00
map.c bpftool: Switch to libbpf's hashmap for PIDs/names references 2021-10-25 17:31:39 -07:00
map_perf_ring.c bpftool: Remove useless #include to <perf-sys.h> from map_perf_ring.c 2021-10-20 10:47:39 -07:00
net.c tools: bpftool: Update and synchronise option list in doc and help msg 2021-07-30 15:40:27 -07:00
netlink_dumper.c bpftool: Use consistent include paths for libbpf 2020-01-20 16:37:45 -08:00
netlink_dumper.h tools: bpftool: dual license all files 2018-12-13 12:08:44 +01:00
perf.c tools: bpftool: Update and synchronise option list in doc and help msg 2021-07-30 15:40:27 -07:00
pids.c bpftool: Switch to libbpf's hashmap for PIDs/names references 2021-10-25 17:31:39 -07:00
prog.c bpftool: Switch to libbpf's hashmap for PIDs/names references 2021-10-25 17:31:39 -07:00
struct_ops.c tools: bpftool: Update and synchronise option list in doc and help msg 2021-07-30 15:40:27 -07:00
tracelog.c tools: bpftool: add an option to prevent auto-mount of bpffs, tracefs 2018-12-18 14:47:17 +01:00
xlated_dumper.c bpftool: Use syscall/loader program in "prog load" and "gen skeleton" command. 2021-05-19 00:41:31 +02:00
xlated_dumper.h tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00