aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/Makefile24
-rw-r--r--tools/perf/config/Makefile27
2 files changed, 27 insertions, 24 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 51fac31b9c6b..7dc6615219f2 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -473,26 +473,6 @@ ifneq ($(MAKECMDGOALS),tags)
473# because maintaining the nesting to match is a pain. If 473# because maintaining the nesting to match is a pain. If
474# we had "elif" things would have been much nicer... 474# we had "elif" things would have been much nicer...
475 475
476# There's only x86 (both 32 and 64) support for CFI unwind so far
477ifneq ($(ARCH),x86)
478 NO_LIBUNWIND := 1
479endif
480
481ifndef NO_LIBUNWIND
482# for linking with debug library, run like:
483# make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
484ifdef LIBUNWIND_DIR
485 LIBUNWIND_CFLAGS := -I$(LIBUNWIND_DIR)/include
486 LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib
487endif
488
489FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(ALL_CFLAGS) $(LIBUNWIND_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS)
490ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y)
491 msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99);
492 NO_LIBUNWIND := 1
493endif # Libunwind support
494endif # NO_LIBUNWIND
495
496-include arch/$(ARCH)/Makefile 476-include arch/$(ARCH)/Makefile
497 477
498ifneq ($(OUTPUT),) 478ifneq ($(OUTPUT),)
@@ -521,10 +501,6 @@ endif # NO_DWARF
521endif # NO_LIBELF 501endif # NO_LIBELF
522 502
523ifndef NO_LIBUNWIND 503ifndef NO_LIBUNWIND
524 BASIC_CFLAGS += -DLIBUNWIND_SUPPORT
525 EXTLIBS += $(LIBUNWIND_LIBS)
526 BASIC_CFLAGS := $(LIBUNWIND_CFLAGS) $(BASIC_CFLAGS)
527 BASIC_LDFLAGS := $(LIBUNWIND_LDFLAGS) $(BASIC_LDFLAGS)
528 LIB_OBJS += $(OUTPUT)util/unwind.o 504 LIB_OBJS += $(OUTPUT)util/unwind.o
529endif 505endif
530 506
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 71e737c4c4d6..438574bdf4b1 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -170,3 +170,30 @@ endif # PERF_HAVE_DWARF_REGS
170endif # NO_DWARF 170endif # NO_DWARF
171 171
172endif # NO_LIBELF 172endif # NO_LIBELF
173
174# There's only x86 (both 32 and 64) support for CFI unwind so far
175ifneq ($(ARCH),x86)
176 NO_LIBUNWIND := 1
177endif
178
179ifndef NO_LIBUNWIND
180# for linking with debug library, run like:
181# make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
182ifdef LIBUNWIND_DIR
183 LIBUNWIND_CFLAGS := -I$(LIBUNWIND_DIR)/include
184 LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib
185endif
186
187FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(ALL_CFLAGS) $(LIBUNWIND_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS)
188ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y)
189 msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99);
190 NO_LIBUNWIND := 1
191endif # Libunwind support
192endif # NO_LIBUNWIND
193
194ifndef NO_LIBUNWIND
195 BASIC_CFLAGS += -DLIBUNWIND_SUPPORT
196 EXTLIBS += $(LIBUNWIND_LIBS)
197 BASIC_CFLAGS := $(LIBUNWIND_CFLAGS) $(BASIC_CFLAGS)
198 BASIC_LDFLAGS := $(LIBUNWIND_LDFLAGS) $(BASIC_LDFLAGS)
199endif # NO_LIBUNWIND