From 508c9fbce0d30da3cdfe699ae5530aed82a09399 Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Fri, 20 May 2022 14:18:26 -0700 Subject: perf build: Error for BPF skeletons without LIBBPF LIBBPF requires LIBELF so doing "make BUILD_BPF_SKEL=1 NO_LIBELF=1" fails with compiler errors about missing declarations. Similar could happen if libbpf feature detection fails. Prefer to error when BUILD_BPF_SKEL is enabled but LIBBPF isn't. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Ingo Molnar Cc: John Fastabend Cc: KP Singh Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: https://lore.kernel.org/r/20220520211826.1828180-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Makefile.config | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tools/perf/Makefile.config') diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index c38423807d01..e0304e70f182 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -671,6 +671,9 @@ ifdef BUILD_BPF_SKEL ifeq ($(feature-clang-bpf-co-re), 0) dummy := $(error Error: clang too old/not installed. Please install recent clang to build with BUILD_BPF_SKEL) endif + ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),) + dummy := $(error Error: BPF skeleton support requires libbpf) + endif $(call detected,CONFIG_PERF_BPF_SKEL) CFLAGS += -DHAVE_BPF_SKEL endif -- cgit v1.2.3