Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tools: Support static linking with libdw

The Fedora 22 version of libdw requires a couple of extra libraries to
link. With a dynamic link the dependencies are pulled in automatically,
but this doesn't work for static linking. Add the needed libraries
explicitely to the feature probe and the Makefile.

v2: Explicitly check for static linking and only add the dependencies
when -static is set. This is to avoid regressions on Arnaldo's system.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/1439419717-20601-1-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Andi Kleen and committed by
Arnaldo Carvalho de Melo
7aec51cb a897b5f0

+11 -2
+6 -1
tools/build/feature/Makefile
··· 70 70 test-glibc.bin: 71 71 $(BUILD) 72 72 73 + DWARFLIBS := -ldw 74 + ifeq ($(findstring -static,${LDFLAGS}),-static) 75 + DWARFLIBS += -lelf -lebl -lz -llzma -lbz2 76 + endif 77 + 73 78 test-dwarf.bin: 74 - $(BUILD) -ldw 79 + $(BUILD) $(DWARFLIBS) 75 80 76 81 test-libelf-mmap.bin: 77 82 $(BUILD) -lelf
+5 -1
tools/perf/config/Makefile
··· 297 297 else 298 298 CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS) 299 299 LDFLAGS += $(LIBDW_LDFLAGS) 300 - EXTLIBS += -ldw 300 + DWARFLIBS := -ldw 301 + ifeq ($(findstring -static,${LDFLAGS}),-static) 302 + DWARFLIBS += -lelf -lebl -lz -llzma -lbz2 303 + endif 304 + EXTLIBS += ${DWARFLIBS} 301 305 $(call detected,CONFIG_DWARF) 302 306 endif # PERF_HAVE_DWARF_REGS 303 307 endif # NO_DWARF