[PATCH v4 2/5] perf build: Sync bpf_skel.mak get_sys_includes with selftests/bpf
From: Ian Rogers
Date: Wed Nov 11 2026 - 20:20:57 EST
Forward __loongarch_grlen as -D__BITS_PER_LONG and the MIPS ABI, size,
and endianness macros in bpf_skel.mak's get_sys_includes, matching
tools/testing/selftests/bpf/Makefile so system headers receive the
expected architecture macros when compiling BPF skeletons.
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/bpf_skel.mak | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/bpf_skel.mak b/tools/perf/bpf_skel.mak
index f2559de39f96..60d104ec573d 100644
--- a/tools/perf/bpf_skel.mak
+++ b/tools/perf/bpf_skel.mak
@@ -22,7 +22,9 @@ bpf-skel-prepare: $(BPFTOOL) $(VMLINUX_H)
define get_sys_includes
$(shell $(1) $(2) -v -E - </dev/null 2>&1 \
| sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') \
-$(shell $(1) $(2) -dM -E - </dev/null | grep '__riscv_xlen ' | awk '{printf("-D__riscv_xlen=%d -D__BITS_PER_LONG=%d", $$3, $$3)}')
+$(shell $(1) $(2) -dM -E - </dev/null | grep '__riscv_xlen ' | awk '{printf("-D__riscv_xlen=%d -D__BITS_PER_LONG=%d", $$3, $$3)}') \
+$(shell $(1) $(2) -dM -E - </dev/null | grep '__loongarch_grlen ' | awk '{printf("-D__BITS_PER_LONG=%d", $$3)}') \
+$(shell $(1) $(2) -dM -E - </dev/null | grep -E 'MIPS(EL|EB)|_MIPS_SZ(PTR|LONG) |_MIPS_SIM |_ABI(O32|N32|64) ' | awk '{printf("-D%s=%s ", $$2, $$3)}')
endef
ifneq ($(CROSS_COMPILE),)
--
2.56.0.567.gdb80ae8cd5-goog