Commit ba335df4 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Arnaldo Carvalho de Melo

perf tools: Fix static linking with libdw from elfutils

Fix feature test for static libdw: link required dependencies.  Backends
of libebl are not statically linked thus libdl is required.

In Debian/Ubuntu libdw-dev includes libebl.a starting from 0.166-1.
Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/150322916720.129772.7959925864494283854.stgit@buzzSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent ac0bb6b7
...@@ -103,8 +103,12 @@ ifdef LIBDW_DIR ...@@ -103,8 +103,12 @@ ifdef LIBDW_DIR
LIBDW_CFLAGS := -I$(LIBDW_DIR)/include LIBDW_CFLAGS := -I$(LIBDW_DIR)/include
LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
endif endif
DWARFLIBS := -ldw
ifeq ($(findstring -static,${LDFLAGS}),-static)
DWARFLIBS += -lelf -lebl -ldl -lz -llzma -lbz2
endif
FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS) FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS)
FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) -ldw FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) $(DWARFLIBS)
# for linking with debug library, run like: # for linking with debug library, run like:
# make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/ # make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
...@@ -365,10 +369,6 @@ ifndef NO_LIBELF ...@@ -365,10 +369,6 @@ ifndef NO_LIBELF
else else
CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS) CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS)
LDFLAGS += $(LIBDW_LDFLAGS) LDFLAGS += $(LIBDW_LDFLAGS)
DWARFLIBS := -ldw
ifeq ($(findstring -static,${LDFLAGS}),-static)
DWARFLIBS += -lelf -lebl -lz -llzma -lbz2
endif
EXTLIBS += ${DWARFLIBS} EXTLIBS += ${DWARFLIBS}
$(call detected,CONFIG_DWARF) $(call detected,CONFIG_DWARF)
endif # PERF_HAVE_DWARF_REGS endif # PERF_HAVE_DWARF_REGS
......
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