linux/tools/testing
Ihor Solodrai b0dcdcb9ae resolve_btfids: Fix linker flags detection
The "|| echo -lzstd" default makes zstd an unconditional link
dependency of resolve_btfids. On systems where libzstd-dev is not
installed and pkg-config fails, the linker fails:

  ld: cannot find -lzstd: No such file or directory

libzstd is a transitive dependency of libelf, so the -lzstd flag is
strictly necessary only for static builds [1].

Remove ZSTD_LIBS variable, and instead set LIBELF_LIBS depending on
whether the build is static or not. Use $(HOSTPKG_CONFIG) as primary
source of the flags list.

Also add a default value for HOSTPKG_CONFIG in case it's not built via
the toplevel Makefile. Pass it from selftests/bpf too.

[1] https://lore.kernel.org/bpf/4ff82800-2daa-4b9f-95a9-6f512859ee70@linux.dev/

Reported-by: BPF CI Bot (Claude Opus 4.6) <bot+bpf-ci@kernel.org>
Reported-by: Vitaly Chikunov <vt@altlinux.org>
Closes: https://lore.kernel.org/bpf/aaWqMcK-2AQw5dx8@altlinux.org/
Fixes: 4021848a90 ("selftests/bpf: Pass through build flags to bpftool and resolve_btfids")
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Reviewed-by: Paul Chaignon <paul.chaignon@gmail.com>
Link: https://lore.kernel.org/r/20260305014730.3123382-1-ihor.solodrai@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-03-07 08:51:51 -08:00
..
crypto/chacha20-s390
cxl cxl changes for v7.0 2026-02-12 16:33:05 -08:00
fault-injection
ktest ktest.pl: Fix uninitialized var in config-bisect.pl 2025-12-03 18:25:18 -05:00
kunit kunit: add bash completion 2026-01-20 11:17:52 -07:00
memblock memblock: drop redundant 'struct page *' argument from memblock_free_pages() 2026-01-09 11:53:51 +02:00
nvdimm tools/testing/nvdimm: Use per-DIMM device handle 2025-11-03 16:47:13 -06:00
radix-tree idr: fix idr_alloc() returning an ID out of range 2025-12-23 11:23:11 -08:00
rbtree
scatterlist
selftests resolve_btfids: Fix linker flags detection 2026-03-07 08:51:51 -08:00
shared tools: Update context analysis macros in compiler_types.h 2026-01-28 09:25:45 +01:00
vma tools/testing/vma: add VMA userland tests for VMA flag functions 2026-02-12 15:42:59 -08:00
vsock vsock/test: add stream TX credit bounds test 2026-01-22 15:41:33 +01:00