From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752203AbbHTJzC (ORCPT ); Thu, 20 Aug 2015 05:55:02 -0400 Received: from terminus.zytor.com ([198.137.202.10]:35020 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752160AbbHTJy6 (ORCPT ); Thu, 20 Aug 2015 05:54:58 -0400 Date: Thu, 20 Aug 2015 02:54:43 -0700 From: tip-bot for Andi Kleen Message-ID: Cc: acme@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, ak@linux.intel.com, mingo@kernel.org, jolsa@kernel.org Reply-To: jolsa@kernel.org, mingo@kernel.org, ak@linux.intel.com, linux-kernel@vger.kernel.org, acme@redhat.com, hpa@zytor.com, tglx@linutronix.de In-Reply-To: <1439419717-20601-1-git-send-email-andi@firstfloor.org> References: <1439419717-20601-1-git-send-email-andi@firstfloor.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Support static linking with libdw Git-Commit-ID: 7aec51cbf0646cc15d719b08caea931576dc7f2a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 7aec51cbf0646cc15d719b08caea931576dc7f2a Gitweb: http://git.kernel.org/tip/7aec51cbf0646cc15d719b08caea931576dc7f2a Author: Andi Kleen AuthorDate: Wed, 12 Aug 2015 15:48:37 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 13 Aug 2015 14:49:11 -0300 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 Cc: Jiri Olsa Link: http://lkml.kernel.org/r/1439419717-20601-1-git-send-email-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/build/feature/Makefile | 7 ++++++- tools/perf/config/Makefile | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index 1c0d69f..74ca420 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -70,8 +70,13 @@ test-libelf.bin: test-glibc.bin: $(BUILD) +DWARFLIBS := -ldw +ifeq ($(findstring -static,${LDFLAGS}),-static) +DWARFLIBS += -lelf -lebl -lz -llzma -lbz2 +endif + test-dwarf.bin: - $(BUILD) -ldw + $(BUILD) $(DWARFLIBS) test-libelf-mmap.bin: $(BUILD) -lelf diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 823195a..827557f 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile @@ -297,7 +297,11 @@ ifndef NO_LIBELF else CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS) LDFLAGS += $(LIBDW_LDFLAGS) - EXTLIBS += -ldw + 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 endif # NO_DWARF