Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tools: Warn about missing libelf

When perf detects no libelf during the build, it'll use internal mini
elf parser instead of libelf. But as it only supports minimal
functionalities, it also disables support to 'probe' builtin command.

Currently it didn't warned to user. Fix it.

$ sudo apt-get remove libelf-dev
$ make
CHK -fstack-protector-all
CHK -Wstack-protector
CHK -Wvolatile-register-var
CHK bionic
CHK libelf
CHK glibc
Makefile:491: No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev
CHK libunwind
CHK libaudit

$ make NO_LIBELF=1
CHK -fstack-protector-all
CHK -Wstack-protector
CHK -Wvolatile-register-var
CHK bionic
CHK libaudit

Reported-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/n/tip-8ww8zc4hhpxabfskxs3u5ede@git.kernel.org
[ committer note: The package needed is elfutils-libelf-devel, not elfutils-devel ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
d30ff295 95d18aa2

+2
+2
tools/perf/Makefile
··· 490 490 LIBC_SUPPORT := 1 491 491 endif 492 492 ifeq ($(LIBC_SUPPORT),1) 493 + msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev); 494 + 493 495 NO_LIBELF := 1 494 496 NO_DWARF := 1 495 497 NO_DEMANGLE := 1