From patchwork Tue Aug 16 14:49:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 110189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 271D2B6F7C for ; Wed, 17 Aug 2011 00:49:53 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QtKxX-0007GI-Qr; Tue, 16 Aug 2011 14:49:39 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QtKxV-0007FD-HN for kernel-team@lists.ubuntu.com; Tue, 16 Aug 2011 14:49:37 +0000 Received: from p5b2e5698.dip.t-dialin.net ([91.46.86.152] helo=[192.168.2.5]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QtKxV-0000T0-7m; Tue, 16 Aug 2011 14:49:37 +0000 Message-ID: <4E4A837F.7060408@canonical.com> Date: Tue, 16 Aug 2011 16:49:35 +0200 From: Stefan Bader User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11 MIME-Version: 1.0 To: Ben Hutchings Subject: Re: [Oneiric, Natty, Maverick, Lucid SRU] Link libbfd statically References: <1312277892-5468-1-git-send-email-stefan.bader@canonical.com> <1313338609.2591.1319.camel@deadeye> In-Reply-To: <1313338609.2591.1319.camel@deadeye> X-Enigmail-Version: 1.1.2 Cc: kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com On 14.08.2011 18:16, Ben Hutchings wrote: > On Tue, 2011-08-02 at 11:38 +0200, Stefan Bader wrote: >> SRU Justification: >> >> Impact: By dynamically linking libbfd, it is not possible to have >> older versions of the perf tool installed (as there can only be one >> version of this lib). Also, Debian policy actually forbids depending >> on a certain version of the library). >> >> Fix: Change the makefile to statically link libbfd. This is a Ubuntu >> specific change, though. Which unlikely will make it upstream. >> >> Testcase: Check the perf version provided though the builders (it >> seems that building in chroots can cause builds not linking against >> libbfd at all as HAVE_CPLUS_DEMANGLE gets set). The ouput of ldd >> should not show libbfd. >> >> Actually, having said this, maybe the better solution is to modify >> the build dependencies to cause the compile to have >> HAVE_CPLUS_DEMANGLE set. That way we do not need to carry a >> modification to the makefile which likely breaks... > > You *must* set HAVE_CPLUS_DEMANGLE; see Debian bug #606050. > > Ben. > > Ah ok. Well I saw that setting that option preventing any linkage against libbfd. Which was what the proposed patch caused by accidentally breaking all the compile time tests. What I was not sure of was whether using libiberty only instead of libbfd has any functional drawback. But if there are actually license problems involved[1], then there does not seem to be a way around only using libiberty. So the change would be like attached for Oneiric. The milage for other releases will vary. The only thing that makes me wonder whether this correct is that ldd on the resulting binary shows no reference to libiberty. -Stefan [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=606050 From 19c6b33d1b1ff39df7943716d9b8cee30f71adc8 Mon Sep 17 00:00:00 2001 From: Stefan Bader Date: Tue, 16 Aug 2011 16:14:22 +0200 Subject: [PATCH] UBUNTU: (build) Force perf to use libiberty for demangling Because libbfd is GPLv3 only and perf is GPLv2 only. Also this avoids statically linking against libbfd to allow multiple versions of perf being installed in parallel. See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=606050 BugLink: http://bugs.launchpad.net/bugs/783660 Signed-off-by: Stefan Bader --- debian/rules.d/2-binary-arch.mk | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index 29788fc..466c8a4 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -365,7 +365,8 @@ endif $(stampdir)/stamp-build-perarch: prepare-perarch ifeq ($(do_tools),true) - cd $(builddir)/tools/tools/perf && make $(CROSS_COMPILE) + cd $(builddir)/tools/tools/perf && \ + make HAVE_CPLUS_DEMANGLE=1 $(CROSS_COMPILE) if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \ cd $(builddir)/tools/tools/power/x86/x86_energy_perf_policy && make $(CROSS_COMPILE); \ cd $(builddir)/tools/tools/power/x86/turbostat && make $(CROSS_COMPILE); \ -- 1.7.4.1