]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bpftool: Pass host flags to bootstrap libbpf
authorLeo Yan <leo.yan@arm.com>
Tue, 2 Jun 2026 14:47:10 +0000 (15:47 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 15 Jun 2026 00:32:53 +0000 (17:32 -0700)
commit9080b97689dbf8d2c338a9af97cd2b4a714f25bf
tree4ec58b96d47094c01b8bb049564c9c7d27d4f3d4
parent1f24de6b2c81f71f90a7c02be516da99f00d11c7
bpftool: Pass host flags to bootstrap libbpf

bpftool builds a bootstrap libbpf with HOSTCC, but the libbpf submake can
still inherit target build flags through CFLAGS. This can break cross
builds when host objects are compiled with target-only options.

Since HOST_CFLAGS contains warning options that are not suitable for
building libbpf, use LIBBPF_BOOTSTRAP_CFLAGS with the warning options
removed to build the bootstrap libbpf. Clear EXTRA_CFLAGS so target
extra flags are not mixed into the host bootstrap libbpf build.

Signed-off-by: Leo Yan <leo.yan@arm.com>
Acked-by: Quentin Monnet <qmo@kernel.org>
Link: https://lore.kernel.org/r/20260602-tools_build_fix_zero_init_bpf_only-v2-1-c76e5250ea1c@arm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/bpf/bpftool/Makefile