]> git.ipfire.org Git - thirdparty/linux.git/commit
bpftool: Allow explicitly skip llvm, libbfd and libcrypto dependencies
authorMykyta Yatsenko <yatsenko@meta.com>
Fri, 13 Mar 2026 00:03:27 +0000 (17:03 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 16 Mar 2026 21:14:14 +0000 (14:14 -0700)
commitc73a24436698ade1b6a0742e8bcfa04c9ef8fad9
treeff1b67984ec8a09311f8086635073ab4257934fc
parent6c8e1a9eee0fec802b542dadf768c30c2a183b3c
bpftool: Allow explicitly skip llvm, libbfd and libcrypto dependencies

Introduce SKIP_LLVM, SKIP_LIBBFD, and SKIP_CRYPTO build flags that let
users build bpftool without these optional dependencies.

SKIP_LLVM=1 skips LLVM even when detected. SKIP_LIBBFD=1 prevents the
libbfd JIT disassembly fallback when LLVM is absent. Together, they
produce a bpftool with no disassembly support.

SKIP_CRYPTO=1 excludes sign.c and removes the -lcrypto link dependency.
Inline stubs in main.h return errors with a clear message if signing
functions are called at runtime.

Use BPFTOOL_WITHOUT_CRYPTO (not HAVE_LIBCRYPTO_SUPPORT) as the C
define, following the BPFTOOL_WITHOUT_SKELETONS naming convention for
bpftool-internal build config, leaving HAVE_LIBCRYPTO_SUPPORT free for
proper feature detection in the future.

All three flags are propagated through the selftests Makefile to bpftool
sub-builds.

Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20260312-b4-bpftool_build-v2-1-4c9d57133644@meta.com
tools/bpf/bpftool/Makefile
tools/bpf/bpftool/main.c
tools/bpf/bpftool/main.h
tools/testing/selftests/bpf/Makefile