* [PATCH 2/2] perf build: Add -Wno-missing-declarations for GEN_VMLINUX_H=1
[not found] <20260408055259.374744-1-namhyung@kernel.org>
@ 2026-04-08 5:52 ` Namhyung Kim
0 siblings, 0 replies; only message in thread
From: Namhyung Kim @ 2026-04-08 5:52 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers, James Clark
Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
linux-perf-users, bpf
On my system, `make GEN_VMLINUX_H=1` fails with a lot of error messages
like below:
./util/bpf_skel/vmlinux.h:134488:4: error: declaration does not declare anything [-Werror,-Wmissing-declarations]
134488 | struct freelist_counters;
| ^~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile.perf:1249: linux/tools/perf/util/bpf_skel/.tmp/lock_contention.bpf.o] Error 1
It seems clang doesn't like forward declarations in the current setting.
Let's suppress the warning by adding the no warning flags.
Cc: bpf@vger.kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/Makefile.perf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index cee19c923c0607d2..a41e0dd34d8df660 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -1249,7 +1249,7 @@ $(SKEL_TMP_OUT)/%.bpf.o: util/bpf_skel/%.bpf.c $(LIBBPF) $(SKEL_OUT)/vmlinux.h
$(QUIET_CLANG)$(CLANG) -g -O2 -fno-stack-protector --target=bpf \
$(CLANG_OPTIONS) $(EXTRA_BPF_FLAGS) $(BPF_INCLUDE) $(TOOLS_UAPI_INCLUDE) \
-include $(OUTPUT)PERF-VERSION-FILE -include util/bpf_skel/perf_version.h \
- -c $(filter util/bpf_skel/%.bpf.c,$^) -o $@
+ -Wno-missing-declarations -c $(filter util/bpf_skel/%.bpf.c,$^) -o $@
$(SKEL_OUT)/%.skel.h: $(SKEL_TMP_OUT)/%.bpf.o | $(BPFTOOL)
$(QUIET_GENSKEL)$(BPFTOOL) gen skeleton $< > $@
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread