]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: Pass through build flags to bpftool and resolve_btfids
authorIhor Solodrai <ihor.solodrai@linux.dev>
Mon, 23 Feb 2026 19:07:22 +0000 (11:07 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 24 Feb 2026 16:19:49 +0000 (08:19 -0800)
commit4021848a903e65f74cf88997c12b96d6bc2453e6
tree075e49e4a10752522190060909b31ad936d78635
parent9d8685239e85ba5a4899b5b3534c732e3ae5f2aa
selftests/bpf: Pass through build flags to bpftool and resolve_btfids

EXTRA_* and SAN_* build flags were not correctly propagated to bpftool
and resolve_btids when building selftests/bpf. This led to various
build errors on attempt to build with SAN_CFLAGS="-fsanitize=address",
for example.

Fix the makefiles to address this:
  - Pass SAN_CFLAGS/SAN_LDFLAGS to bpftool and resolve_btfids build
  - Propagate EXTRA_LDFLAGS to resolve_btfids link command
  - Use pkg-config to detect zlib and zstd for resolve_btfids, similar
    libelf handling

Also check for ASAN flag in selftests/bpf/Makefile for convenience.

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Link: https://lore.kernel.org/r/20260223190736.649171-7-ihor.solodrai@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/bpf/resolve_btfids/Makefile
tools/testing/selftests/bpf/Makefile