mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tools/perf: fix static linking with libdw from elfutils
@ 2017-08-20 11:39 Konstantin Khlebnikov
  2017-08-24  8:24 ` [tip:perf/core] perf tools: Fix " tip-bot for Konstantin Khlebnikov
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Khlebnikov @ 2017-08-20 11:39 UTC (permalink / raw)
  To: Peter Zijlstra, Alexander Shishkin, Ingo Molnar, linux-kernel,
	Arnaldo Carvalho de Melo

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: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
---
 tools/perf/Makefile.config |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index bdf0e87f9b29..b7ac6dce199b 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -103,8 +103,12 @@ ifdef LIBDW_DIR
   LIBDW_CFLAGS  := -I$(LIBDW_DIR)/include
   LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
 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_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) -ldw
+FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) $(DWARFLIBS)
 
 # for linking with debug library, run like:
 # make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
@@ -360,10 +364,6 @@ ifndef NO_LIBELF
     else
       CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS)
       LDFLAGS += $(LIBDW_LDFLAGS)
-      DWARFLIBS := -ldw
-      ifeq ($(findstring -static,${LDFLAGS}),-static)
-	DWARFLIBS += -lelf -lebl -lz -llzma -lbz2
-      endif
       EXTLIBS += ${DWARFLIBS}
       $(call detected,CONFIG_DWARF)
     endif # PERF_HAVE_DWARF_REGS

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip:perf/core] perf tools: Fix static linking with libdw from elfutils
  2017-08-20 11:39 [PATCH] tools/perf: fix static linking with libdw from elfutils Konstantin Khlebnikov
@ 2017-08-24  8:24 ` tip-bot for Konstantin Khlebnikov
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Konstantin Khlebnikov @ 2017-08-24  8:24 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, alexander.shishkin, peterz, mingo, hpa, linux-kernel, tglx,
	khlebnikov

Commit-ID:  ba335df4ea2a5011002c5cde53bab6d7f5d714d8
Gitweb:     http://git.kernel.org/tip/ba335df4ea2a5011002c5cde53bab6d7f5d714d8
Author:     Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
AuthorDate: Sun, 20 Aug 2017 14:39:27 +0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 22 Aug 2017 13:24:54 -0300

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: Konstantin 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@buzz
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile.config | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 37d203c..bb4735b 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -103,8 +103,12 @@ ifdef LIBDW_DIR
   LIBDW_CFLAGS  := -I$(LIBDW_DIR)/include
   LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
 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_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) -ldw
+FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) $(DWARFLIBS)
 
 # for linking with debug library, run like:
 # make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
@@ -365,10 +369,6 @@ ifndef NO_LIBELF
     else
       CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS)
       LDFLAGS += $(LIBDW_LDFLAGS)
-      DWARFLIBS := -ldw
-      ifeq ($(findstring -static,${LDFLAGS}),-static)
-	DWARFLIBS += -lelf -lebl -lz -llzma -lbz2
-      endif
       EXTLIBS += ${DWARFLIBS}
       $(call detected,CONFIG_DWARF)
     endif # PERF_HAVE_DWARF_REGS

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-24  8:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-20 11:39 [PATCH] tools/perf: fix static linking with libdw from elfutils Konstantin Khlebnikov
2017-08-24  8:24 ` [tip:perf/core] perf tools: Fix " tip-bot for Konstantin Khlebnikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome