tools/perf/build: Split out feature check: 'dwarf'
Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Namhyung Kim <namhyung@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/n/tip-dsx0fn9mjwfprizboANvtuup@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
e12762cfd9
commit
8295d4e272
3 changed files with 15 additions and 2 deletions
|
@ -110,6 +110,7 @@ FEATURE_TESTS = \
|
||||||
bionic \
|
bionic \
|
||||||
libelf \
|
libelf \
|
||||||
glibc \
|
glibc \
|
||||||
|
dwarf \
|
||||||
libnuma
|
libnuma
|
||||||
|
|
||||||
$(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test)))
|
$(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test)))
|
||||||
|
@ -190,8 +191,7 @@ else
|
||||||
LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
|
LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
FLAGS_DWARF=$(CFLAGS) $(LIBDW_CFLAGS) -ldw -lz -lelf $(LIBDW_LDFLAGS) $(LDFLAGS) $(EXTLIBS)
|
ifneq ($(feature-dwarf), 1)
|
||||||
ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y)
|
|
||||||
msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
|
msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
|
||||||
NO_DWARF := 1
|
NO_DWARF := 1
|
||||||
endif # Dwarf support
|
endif # Dwarf support
|
||||||
|
|
|
@ -8,6 +8,7 @@ FILES= \
|
||||||
test-bionic \
|
test-bionic \
|
||||||
test-libelf \
|
test-libelf \
|
||||||
test-glibc \
|
test-glibc \
|
||||||
|
test-dwarf \
|
||||||
test-libnuma
|
test-libnuma
|
||||||
|
|
||||||
CC := $(CC) -MD
|
CC := $(CC) -MD
|
||||||
|
@ -42,6 +43,9 @@ test-libelf:
|
||||||
test-glibc:
|
test-glibc:
|
||||||
$(BUILD)
|
$(BUILD)
|
||||||
|
|
||||||
|
test-dwarf:
|
||||||
|
$(BUILD) -ldw
|
||||||
|
|
||||||
test-libnuma:
|
test-libnuma:
|
||||||
$(BUILD) -lnuma
|
$(BUILD) -lnuma
|
||||||
|
|
||||||
|
|
9
tools/perf/config/feature-checks/test-dwarf.c
Normal file
9
tools/perf/config/feature-checks/test-dwarf.c
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#include <dwarf.h>
|
||||||
|
#include <elfutils/libdw.h>
|
||||||
|
#include <elfutils/version.h>
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
Dwarf *dbg = dwarf_begin(0, DWARF_C_READ);
|
||||||
|
return (long)dbg;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue