[PATCH 0/6] tools build: bpf: Append EXTRA_CFLAGS and HOST_EXTRACFLAGS

Leo Yan posted 6 patches 2 hours ago
tools/bpf/Makefile                                    |  1 +
tools/bpf/bpftool/Makefile                            |  9 +++++++--
tools/lib/bpf/Makefile                                | 17 +++++++++--------
tools/testing/selftests/bpf/Makefile                  | 10 ++++++++--
tools/testing/selftests/bpf/prog_tests/verifier_log.c |  1 +
5 files changed, 26 insertions(+), 12 deletions(-)
[PATCH 0/6] tools build: bpf: Append EXTRA_CFLAGS and HOST_EXTRACFLAGS
Posted by Leo Yan 2 hours ago
Append EXTRA_CFLAGS and HOST_EXTRACFLAGS to the BPF build.

This mitigates an issue introduced in GCC 15, where a {0} initializer
does not guarantee zeroing the entire union [1].

The common changes under tools to support EXTRA_CFLAGS and
HOST_EXTRACFLAGS are sent separately [2].  As suggested, BPF patches
would be picked up via the bpf tree, so this series only includes BPF
related changes.

Verification (bpf-ci):

Test 1: With full tools changes applied
  https://github.com/kernel-patches/bpf/actions/runs/23439834394

Test 2: Only BPF changes
  https://github.com/kernel-patches/bpf/actions/runs/23440507945

[1] https://gcc.gnu.org/gcc-15/changes.html
[2] https://lore.kernel.org/linux-perf-users/20260323-tools_build_fix_zero_init-v6-0-235858c51af9@arm.com/T/#t

Signed-off-by: Leo Yan <leo.yan@arm.com>
---
Leo Yan (6):
      bpftool: Avoid adding EXTRA_CFLAGS to HOST_CFLAGS
      bpftool: Append extra host flags
      libbpf: Initialize CFLAGS before including Makefile.include
      tools/bpf: build: Append extra cflags
      selftests/bpf: Initialize operation name before use
      selftests/bpf: Append extra cflags

 tools/bpf/Makefile                                    |  1 +
 tools/bpf/bpftool/Makefile                            |  9 +++++++--
 tools/lib/bpf/Makefile                                | 17 +++++++++--------
 tools/testing/selftests/bpf/Makefile                  | 10 ++++++++--
 tools/testing/selftests/bpf/prog_tests/verifier_log.c |  1 +
 5 files changed, 26 insertions(+), 12 deletions(-)
---
base-commit: bfec8e88ff6022b056615ec71506703e7e54de82
change-id: 20260323-tools_build_fix_zero_init_bpf_only-52232f62fb7f

Best regards,
-- 
Leo Yan <leo.yan@arm.com>