aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/config/Makefile4
-rw-r--r--tools/perf/config/feature-checks/Makefile4
-rw-r--r--tools/perf/config/feature-checks/test-libelf.c7
3 files changed, 13 insertions, 2 deletions
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index a2e0e1b200c3..68654281b973 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -108,6 +108,7 @@ FEATURE_TESTS = \
108 volatile-register-var \ 108 volatile-register-var \
109 fortify-source \ 109 fortify-source \
110 bionic \ 110 bionic \
111 libelf \
111 libnuma 112 libnuma
112 113
113$(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test))) 114$(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test)))
@@ -164,8 +165,7 @@ ifdef NO_LIBELF
164 NO_DEMANGLE := 1 165 NO_DEMANGLE := 1
165 NO_LIBUNWIND := 1 166 NO_LIBUNWIND := 1
166else 167else
167 FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) 168 ifeq ($(feature-libelf), 0)
168 ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
169 FLAGS_GLIBC=$(CFLAGS) $(LDFLAGS) 169 FLAGS_GLIBC=$(CFLAGS) $(LDFLAGS)
170 ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y) 170 ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y)
171 LIBC_SUPPORT := 1 171 LIBC_SUPPORT := 1
diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile
index 191df97a031d..789a38d21a34 100644
--- a/tools/perf/config/feature-checks/Makefile
+++ b/tools/perf/config/feature-checks/Makefile
@@ -6,6 +6,7 @@ FILES= \
6 test-volatile-register-var \ 6 test-volatile-register-var \
7 test-fortify-source \ 7 test-fortify-source \
8 test-bionic \ 8 test-bionic \
9 test-libelf \
9 test-libnuma 10 test-libnuma
10 11
11CC := $(CC) -MD 12CC := $(CC) -MD
@@ -34,6 +35,9 @@ test-fortify-source:
34test-bionic: 35test-bionic:
35 $(BUILD) 36 $(BUILD)
36 37
38test-libelf:
39 $(BUILD) -lelf
40
37test-libnuma: 41test-libnuma:
38 $(BUILD) -lnuma 42 $(BUILD) -lnuma
39 43
diff --git a/tools/perf/config/feature-checks/test-libelf.c b/tools/perf/config/feature-checks/test-libelf.c
new file mode 100644
index 000000000000..1a08f9717344
--- /dev/null
+++ b/tools/perf/config/feature-checks/test-libelf.c
@@ -0,0 +1,7 @@
1#include <libelf.h>
2
3int main(void)
4{
5 Elf *elf = elf_begin(0, ELF_C_READ, 0);
6 return (long)elf;
7}