* [PATCH v1] bpftool build: Restrict feature tests during bootstrap compilation
@ 2026-05-31 1:07 Ian Rogers
2026-06-01 8:20 ` Quentin Monnet
2026-06-05 21:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Ian Rogers @ 2026-05-31 1:07 UTC (permalink / raw)
To: Quentin Monnet, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman,
Kumar Kartikeya Dwivedi, Song Liu, Yonghong Song, Jiri Olsa,
Nick Terrell, David Sterba, Nathan Chancellor, Nick Desaulniers,
Bill Wendling, Justin Stitt, bpf, linux-kernel, llvm
Cc: linux-perf-users, Ian Rogers, James Clark
When the perf build executes 'make -C ../bpf/bpftool bootstrap', bpftool's
Makefile unconditionally evaluated feature checks for llvm, libcap, libbfd,
and disassembler libraries because the bootstrap target was not exempted.
Since the bootstrap bpftool strictly compiles minimal AST parsing and C
code generation logic without linking LLVM or disassembler libraries, these
feature check sub-makes are completely redundant.
Exempt the bootstrap target from non-essential feature tests to eliminate
unneeded sub-make fork overhead during Kbuild startup.
Tested-by: James Clark <james.clark@linaro.org>
Assisted-by: Gemini:gemini-3.1-pro-preview
Signed-off-by: Ian Rogers <irogers@google.com>
---
This patch originally appeared in the now merged perf patch series:
https://lore.kernel.org/linux-perf-users/20260514163409.927816-1-irogers@google.com/
---
tools/bpf/bpftool/Makefile | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index 0febf60e1b64..8f50bc163bb2 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -106,6 +106,10 @@ ifneq ($(SKIP_CRYPTO),1)
CRYPTO_LIBS := -lcrypto
endif
+ifeq ($(MAKECMDGOALS),bootstrap)
+FEATURE_TESTS := libelf-zstd
+FEATURE_DISPLAY :=
+else
FEATURE_TESTS := clang-bpf-co-re
FEATURE_TESTS += llvm
FEATURE_TESTS += libcap
@@ -122,6 +126,7 @@ FEATURE_DISPLAY += libcap
FEATURE_DISPLAY += libbfd
FEATURE_DISPLAY += libbfd-liberty
FEATURE_DISPLAY += libbfd-liberty-z
+endif
check_feat := 1
NON_CHECK_FEAT_TARGETS := clean uninstall doc doc-clean doc-install doc-uninstall
--
2.54.0.823.g6e5bcc1fc9-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] bpftool build: Restrict feature tests during bootstrap compilation
2026-05-31 1:07 [PATCH v1] bpftool build: Restrict feature tests during bootstrap compilation Ian Rogers
@ 2026-06-01 8:20 ` Quentin Monnet
2026-06-05 21:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Quentin Monnet @ 2026-06-01 8:20 UTC (permalink / raw)
To: Ian Rogers, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Eduard Zingerman, Kumar Kartikeya Dwivedi,
Song Liu, Yonghong Song, Jiri Olsa, Nick Terrell, David Sterba,
Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
bpf, linux-kernel, llvm
Cc: linux-perf-users, James Clark
2026-05-30 18:07 UTC-0700 ~ Ian Rogers <irogers@google.com>
> When the perf build executes 'make -C ../bpf/bpftool bootstrap', bpftool's
> Makefile unconditionally evaluated feature checks for llvm, libcap, libbfd,
> and disassembler libraries because the bootstrap target was not exempted.
>
> Since the bootstrap bpftool strictly compiles minimal AST parsing and C
> code generation logic without linking LLVM or disassembler libraries, these
> feature check sub-makes are completely redundant.
>
> Exempt the bootstrap target from non-essential feature tests to eliminate
> unneeded sub-make fork overhead during Kbuild startup.
>
> Tested-by: James Clark <james.clark@linaro.org>
> Assisted-by: Gemini:gemini-3.1-pro-preview
> Signed-off-by: Ian Rogers <irogers@google.com>
Makes sense, thank you Ian!
Acked-by: Quentin Monnet <qmo@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] bpftool build: Restrict feature tests during bootstrap compilation
2026-05-31 1:07 [PATCH v1] bpftool build: Restrict feature tests during bootstrap compilation Ian Rogers
2026-06-01 8:20 ` Quentin Monnet
@ 2026-06-05 21:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-06-05 21:20 UTC (permalink / raw)
To: Ian Rogers
Cc: qmo, ast, daniel, andrii, martin.lau, eddyz87, memxor, song,
yonghong.song, jolsa, terrelln, dsterba, nathan,
nick.desaulniers+lkml, morbo, justinstitt, bpf, linux-kernel,
llvm, linux-perf-users, james.clark
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:
On Sat, 30 May 2026 18:07:50 -0700 you wrote:
> When the perf build executes 'make -C ../bpf/bpftool bootstrap', bpftool's
> Makefile unconditionally evaluated feature checks for llvm, libcap, libbfd,
> and disassembler libraries because the bootstrap target was not exempted.
>
> Since the bootstrap bpftool strictly compiles minimal AST parsing and C
> code generation logic without linking LLVM or disassembler libraries, these
> feature check sub-makes are completely redundant.
>
> [...]
Here is the summary with links:
- [v1] bpftool build: Restrict feature tests during bootstrap compilation
https://git.kernel.org/bpf/bpf-next/c/231fc9bc27fd
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-06-05 21:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-31 1:07 [PATCH v1] bpftool build: Restrict feature tests during bootstrap compilation Ian Rogers
2026-06-01 8:20 ` Quentin Monnet
2026-06-05 21:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox