diff options
-rw-r--r-- | tools/perf/Makefile | 25 | ||||
-rw-r--r-- | tools/perf/config/feature-tests.mak | 9 |
2 files changed, 28 insertions, 6 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index a7d8745e0ab2..318bec8e14e4 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -155,15 +155,15 @@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ | |||
155 | 155 | ||
156 | -include config/feature-tests.mak | 156 | -include config/feature-tests.mak |
157 | 157 | ||
158 | ifeq ($(call try-cc,$(SOURCE_HELLO),-Werror -fstack-protector-all),y) | 158 | ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all),y) |
159 | CFLAGS := $(CFLAGS) -fstack-protector-all | 159 | CFLAGS := $(CFLAGS) -fstack-protector-all |
160 | endif | 160 | endif |
161 | 161 | ||
162 | ifeq ($(call try-cc,$(SOURCE_HELLO),-Werror -Wstack-protector),y) | 162 | ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wstack-protector),y) |
163 | CFLAGS := $(CFLAGS) -Wstack-protector | 163 | CFLAGS := $(CFLAGS) -Wstack-protector |
164 | endif | 164 | endif |
165 | 165 | ||
166 | ifeq ($(call try-cc,$(SOURCE_HELLO),-Werror -Wvolatile-register-var),y) | 166 | ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wvolatile-register-var),y) |
167 | CFLAGS := $(CFLAGS) -Wvolatile-register-var | 167 | CFLAGS := $(CFLAGS) -Wvolatile-register-var |
168 | endif | 168 | endif |
169 | 169 | ||
@@ -172,6 +172,13 @@ endif | |||
172 | BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)util -I$(TRACE_EVENT_DIR) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE | 172 | BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)util -I$(TRACE_EVENT_DIR) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE |
173 | BASIC_LDFLAGS = | 173 | BASIC_LDFLAGS = |
174 | 174 | ||
175 | ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS)),y) | ||
176 | BIONIC := 1 | ||
177 | EXTLIBS := $(filter-out -lrt,$(EXTLIBS)) | ||
178 | EXTLIBS := $(filter-out -lpthread,$(EXTLIBS)) | ||
179 | BASIC_CFLAGS += -I. | ||
180 | endif | ||
181 | |||
175 | # Guard against environment variables | 182 | # Guard against environment variables |
176 | BUILTIN_OBJS = | 183 | BUILTIN_OBJS = |
177 | LIB_H = | 184 | LIB_H = |
@@ -469,12 +476,18 @@ else | |||
469 | FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) | 476 | FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) |
470 | ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF)),y) | 477 | ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF)),y) |
471 | FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS) | 478 | FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS) |
472 | ifneq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC)),y) | 479 | ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC)),y) |
473 | msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); | 480 | LIBC_SUPPORT := 1 |
474 | else | 481 | endif |
482 | ifeq ($(BIONIC),1) | ||
483 | LIBC_SUPPORT := 1 | ||
484 | endif | ||
485 | ifeq ($(LIBC_SUPPORT),1) | ||
475 | NO_LIBELF := 1 | 486 | NO_LIBELF := 1 |
476 | NO_DWARF := 1 | 487 | NO_DWARF := 1 |
477 | NO_DEMANGLE := 1 | 488 | NO_DEMANGLE := 1 |
489 | else | ||
490 | msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); | ||
478 | endif | 491 | endif |
479 | else | 492 | else |
480 | FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS) | 493 | FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS) |
diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak index eaeb0fd6f395..3ef5ec9cdff8 100644 --- a/tools/perf/config/feature-tests.mak +++ b/tools/perf/config/feature-tests.mak | |||
@@ -43,6 +43,15 @@ int main(void) | |||
43 | } | 43 | } |
44 | endef | 44 | endef |
45 | 45 | ||
46 | define SOURCE_BIONIC | ||
47 | #include <android/api-level.h> | ||
48 | |||
49 | int main(void) | ||
50 | { | ||
51 | return __ANDROID_API__; | ||
52 | } | ||
53 | endef | ||
54 | |||
46 | define SOURCE_ELF_MMAP | 55 | define SOURCE_ELF_MMAP |
47 | #include <libelf.h> | 56 | #include <libelf.h> |
48 | int main(void) | 57 | int main(void) |