From 8d98ca5c02df13c1f750953bca2e308a41df08a9 Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Fri, 10 Mar 2023 22:57:44 -0800 Subject: perf build: Error if no libelf and NO_LIBELF isn't set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Building without libelf support is going disable a lot of functionality. Require that the NO_LIBELF=1 build option is passed if this is intentional. Committer notes: Add NO_LIBELF=1 to the 'make_static' target in tools/perf/tests/make so that 'make -C tools/perf build-test' works. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andres Freund Cc: Ingo Molnar Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Martin Liška Cc: Namhyung Kim Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Pavithra Gurushankar Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Roberto Sassu Cc: Stephane Eranian Cc: Tiezhu Yang Cc: Tom Rix Cc: Yang Jihong Cc: llvm@lists.linux.dev Link: https://lore.kernel.org/r/20230311065753.3012826-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Makefile.config | 10 +--------- tools/perf/tests/make | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'tools') diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 0959714a89ed..3066d0c318c3 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -426,15 +426,7 @@ else LIBC_SUPPORT := 1 endif ifeq ($(LIBC_SUPPORT),1) - msg := $(warning No libelf found. Disables 'probe' tool, jvmti and BPF support in 'perf record'. Please install libelf-dev, libelf-devel or elfutils-libelf-devel); - - NO_LIBELF := 1 - NO_DWARF := 1 - NO_DEMANGLE := 1 - NO_LIBUNWIND := 1 - NO_LIBDW_DWARF_UNWIND := 1 - NO_LIBBPF := 1 - NO_JVMTI := 1 + msg := $(error ERROR: No libelf found. Disables 'probe' tool, jvmti and BPF support. Please install libelf-dev, libelf-devel, elfutils-libelf-devel or build with NO_LIBELF=1.) else ifneq ($(filter s% -fsanitize=address%,$(EXTRA_CFLAGS),),) ifneq ($(shell ldconfig -p | grep libasan >/dev/null 2>&1; echo $$?), 0) diff --git a/tools/perf/tests/make b/tools/perf/tests/make index 0b92fa1863f6..96896d498641 100644 --- a/tools/perf/tests/make +++ b/tools/perf/tests/make @@ -111,7 +111,7 @@ make_install_info := install-info make_install_pdf := install-pdf make_install_prefix := install prefix=/tmp/krava make_install_prefix_slash := install prefix=/tmp/krava/ -make_static := LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 NO_LIBTRACEEVENT=1 +make_static := LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 NO_LIBTRACEEVENT=1 NO_LIBELF=1 # all the NO_* variable combined make_minimal := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_GTK2=1 -- cgit v1.2.3