Commit 8f7f8005 authored by Ingo Molnar's avatar Ingo Molnar

tools/perf/build: Split out feature check: 'libelf'

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-qznhihaasbysfqO7ffvRsf9q@git.kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 50eed7a7
...@@ -108,6 +108,7 @@ FEATURE_TESTS = \ ...@@ -108,6 +108,7 @@ FEATURE_TESTS = \
volatile-register-var \ volatile-register-var \
fortify-source \ fortify-source \
bionic \ bionic \
libelf \
libnuma libnuma
$(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test))) $(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test)))
...@@ -164,8 +165,7 @@ ifdef NO_LIBELF ...@@ -164,8 +165,7 @@ ifdef NO_LIBELF
NO_DEMANGLE := 1 NO_DEMANGLE := 1
NO_LIBUNWIND := 1 NO_LIBUNWIND := 1
else else
FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) ifeq ($(feature-libelf), 0)
ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
FLAGS_GLIBC=$(CFLAGS) $(LDFLAGS) FLAGS_GLIBC=$(CFLAGS) $(LDFLAGS)
ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y) ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y)
LIBC_SUPPORT := 1 LIBC_SUPPORT := 1
......
...@@ -6,6 +6,7 @@ FILES= \ ...@@ -6,6 +6,7 @@ FILES= \
test-volatile-register-var \ test-volatile-register-var \
test-fortify-source \ test-fortify-source \
test-bionic \ test-bionic \
test-libelf \
test-libnuma test-libnuma
CC := $(CC) -MD CC := $(CC) -MD
...@@ -34,6 +35,9 @@ test-fortify-source: ...@@ -34,6 +35,9 @@ test-fortify-source:
test-bionic: test-bionic:
$(BUILD) $(BUILD)
test-libelf:
$(BUILD) -lelf
test-libnuma: test-libnuma:
$(BUILD) -lnuma $(BUILD) -lnuma
......
#include <libelf.h>
int main(void)
{
Elf *elf = elf_begin(0, ELF_C_READ, 0);
return (long)elf;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment