linux/tools/bpf/bpftool
Ihor Solodrai a048eb4e37 bpftool: Fix dependencies for static build
[ Upstream commit 08a7491843 ]

When building selftests/bpf with EXTRA_LDFLAGS=-static the follwoing
error happens:

  LINK    /ws/linux/tools/testing/selftests/bpf/tools/build/bpftool/bootstrap/bpftool
/usr/bin/x86_64-linux-gnu-ld.bfd: /usr/lib/gcc/x86_64-linux-gnu/15/../../../x86_64-linux-gnu/libcrypto.a(libcrypto-lib-dso_dlfcn.o): in function `dlfcn_globallookup':
   [...]
/usr/bin/x86_64-linux-gnu-ld.bfd: /usr/lib/gcc/x86_64-linux-gnu/15/../../../x86_64-linux-gnu/libcrypto.a(libcrypto-lib-c_zlib.o): in function `zlib_oneshot_expand_block':
(.text+0xc64): undefined reference to `uncompress'
/usr/bin/x86_64-linux-gnu-ld.bfd: /usr/lib/gcc/x86_64-linux-gnu/15/../../../x86_64-linux-gnu/libcrypto.a(libcrypto-lib-c_zlib.o): in function `zlib_oneshot_compress_block':
(.text+0xce4): undefined reference to `compress'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:252: /ws/linux/tools/testing/selftests/bpf/tools/build/bpftool/bootstrap/bpftool] Error 1
make: *** [Makefile:327: /ws/linux/tools/testing/selftests/bpf/tools/sbin/bpftool] Error 2
make: *** Waiting for unfinished jobs....

This is caused by wrong order of dependencies in the Makefile. Fix it.

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20260128211255.376933-1-ihor.solodrai@linux.dev
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-03-04 07:19:42 -05:00
..
bash-completion bpftool: Add bash completion for program signing options 2025-09-23 12:28:33 -07:00
Documentation bpf: add _impl suffix for bpf_stream_vprintk() kfunc 2025-11-04 17:50:25 -08:00
skeleton bpftool: Fix typo in MAX_NUM_METRICS macro name 2024-06-03 16:58:27 +02:00
.gitignore bpftool: Fix SPDX tag for Makefiles and .gitignore 2021-11-10 09:00:52 -08:00
btf.c bpftool: Use appropriate permissions for map access 2025-06-20 11:13:03 -07:00
btf_dumper.c bpftool: Fix -Wuninitialized-const-pointer warnings with clang >= 21 2025-09-19 15:42:42 -07:00
cfg.c bpftool: Fix control flow graph segfault during edge creation 2025-01-10 14:16:13 -08:00
cfg.h bpftool: Support printing opcodes and source file references in CFG 2023-04-05 21:27:27 -07:00
cgroup.c bpftool: Add support for signing BPF programs 2025-09-22 19:17:55 -07:00
common.c bpftool: Refactor kernel config reading into common helper 2025-09-02 17:20:54 +02:00
feature.c bpftool: Refactor kernel config reading into common helper 2025-09-02 17:20:54 +02:00
gen.c bpftool: Add support for signing BPF programs 2025-09-22 19:17:55 -07:00
iter.c bpftool: Use appropriate permissions for map access 2025-06-20 11:13:03 -07:00
jit_disasm.c bpftool: Using the right format specifiers 2025-03-17 13:50:56 -07:00
json_writer.c tools: bpftool: json: Fix backslash escape typo in jsonw_puts 2023-03-29 09:48:45 -07:00
json_writer.h tools: bpftool: json: Fix backslash escape typo in jsonw_puts 2023-03-29 09:48:45 -07:00
link.c bpftool: Add CET-aware symbol matching for x86_64 architectures 2025-09-02 17:20:54 +02:00
main.c bpftool: Add support for signing BPF programs 2025-09-22 19:17:55 -07:00
main.h bpftool: Add support for signing BPF programs 2025-09-22 19:17:55 -07:00
Makefile bpftool: Fix dependencies for static build 2026-03-04 07:19:42 -05:00
map.c bpftool: Use appropriate permissions for map access 2025-06-20 11:13:03 -07:00
map_perf_ring.c bpftool: Use appropriate permissions for map access 2025-06-20 11:13:03 -07:00
net.c bpftool: Fix truncated netlink dumps 2026-02-26 14:59:39 -08:00
netlink_dumper.c bpftool: Using the right format specifiers 2025-03-17 13:50:56 -07:00
netlink_dumper.h bpftool: Extend net dump with tcx progs 2023-07-19 10:07:28 -07:00
perf.c bpftool: fix perf help message 2023-08-11 20:54:29 -07:00
pids.c bpftool: ensure task comm is always NUL-terminated 2024-11-05 17:12:29 -08:00
prog.c bpftool: Add support for signing BPF programs 2025-09-22 19:17:55 -07:00
sign.c bpftool: Allow bpftool to build with openssl < 3 2025-12-18 14:03:16 +01:00
struct_ops.c bpftool: Mount bpffs on provided dir instead of parent dir 2024-04-04 15:37:12 -07:00
token.c bpftool: Fix UAF in get_delegate_value 2025-09-19 15:37:30 -07:00
tracelog.c bpftool: Search for tracefs at /sys/kernel/tracing first 2025-09-15 10:10:28 -07:00
xlated_dumper.c bpftool: Using the right format specifiers 2025-03-17 13:50:56 -07:00
xlated_dumper.h bpftool: Dump the kernel symbol's module name 2023-07-11 20:07:50 -07:00