From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751622AbdHXI3S (ORCPT ); Thu, 24 Aug 2017 04:29:18 -0400 Received: from terminus.zytor.com ([65.50.211.136]:60329 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751343AbdHXI1h (ORCPT ); Thu, 24 Aug 2017 04:27:37 -0400 Date: Thu, 24 Aug 2017 01:25:03 -0700 From: tip-bot for Konstantin Khlebnikov Message-ID: Cc: acme@redhat.com, tglx@linutronix.de, khlebnikov@yandex-team.ru, alexander.shishkin@linux.intel.com, peterz@infradead.org, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org Reply-To: mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, peterz@infradead.org, alexander.shishkin@linux.intel.com, khlebnikov@yandex-team.ru, tglx@linutronix.de, acme@redhat.com In-Reply-To: <150322917247.129799.14247751517961953155.stgit@buzz> References: <150322917247.129799.14247751517961953155.stgit@buzz> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Fix static linking with libunwind Git-Commit-ID: 60913e005c8d19ec5187a638eafdd088509dfb9e 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: 60913e005c8d19ec5187a638eafdd088509dfb9e Gitweb: http://git.kernel.org/tip/60913e005c8d19ec5187a638eafdd088509dfb9e Author: Konstantin Khlebnikov AuthorDate: Sun, 20 Aug 2017 14:39:32 +0300 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 22 Aug 2017 13:24:55 -0300 perf tools: Fix static linking with libunwind * libunwind-x86_64 must be linked before libunwind * libunwind requires liblzma * static libunwind conflicts with static libgcc_eh Signed-off-by: Konstantin Khlebnikov Cc: Alexander Shishkin Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/150322917247.129799.14247751517961953155.stgit@buzz Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Makefile.config | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index bb4735b..6a64c6b 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -35,7 +35,7 @@ ifeq ($(SRCARCH),x86) ifeq (${IS_64_BIT}, 1) CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT -DHAVE_SYSCALL_TABLE -I$(OUTPUT)arch/x86/include/generated ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S - LIBUNWIND_LIBS = -lunwind -lunwind-x86_64 + LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma $(call detected,CONFIG_X86_64) else LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind @@ -505,6 +505,10 @@ ifndef NO_LOCAL_LIBUNWIND EXTLIBS += $(LIBUNWIND_LIBS) LDFLAGS += $(LIBUNWIND_LIBS) endif +ifeq ($(findstring -static,${LDFLAGS}),-static) + # gcc -static links libgcc_eh which contans piece of libunwind + LIBUNWIND_LDFLAGS += -Wl,--allow-multiple-definition +endif ifndef NO_LIBUNWIND CFLAGS += -DHAVE_LIBUNWIND_SUPPORT