From: Daniel Kiper Subject: Re: [PATCH] tools: link executables with libtinfo explicitly Date: Mon, 1 Jun 2015 15:26:58 +0200 Message-ID: <20150601132658.GR3787@olila.local.net-space.pl> References: <1432937248-24644-1-git-send-email-daniel.kiper@oracle.com> <20150601130644.GE19403@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YzPkG-00031W-QO for xen-devel@lists.xenproject.org; Mon, 01 Jun 2015 13:27:12 +0000 Content-Disposition: inline In-Reply-To: <20150601130644.GE19403@zion.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu Cc: xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Mon, Jun 01, 2015 at 02:06:44PM +0100, Wei Liu wrote: > On Sat, May 30, 2015 at 12:07:28AM +0200, Daniel Kiper wrote: > > binutils 2.22 changed ld default from --copy-dt-needed-entries > > to -no-copy-dt-needed-entries. This revealed that some objects > > are linked implicitly with libtinfo and newer ld fails to build > > relevant executables. > > > > Below is short explanation why we should not do that... > > > > http://fedoraproject.org/wiki/UnderstandingDSOLinkChange says: > > > > The default behaviour for ld (my note: before version 2.22) allows > > users to 'indirectly' link to required objects/libraries through > > intermediate objects/libraries. While this is convenient, it can > > also be dangerous because it makes your program's dependencies tied > > to the dependencies of other objects. If those objects ever change > > their linkages, they can break your program without any changes > > to your own code! > > > > Signed-off-by: Daniel Kiper > > --- > > config/Tools.mk.in | 1 + > > tools/configure | 46 +++++++++++++++++++++++++++++++++++++++++ > > Since your autoconf version might be different from the one used by > committers, it might be better you don't include the changes to > configure in your patch and add a line to prompt committer to rerun > autogen.sh. OK. > > tools/configure.ac | 4 ++++ > > tools/misc/Makefile | 2 +- > > tools/xenstat/xentop/Makefile | 2 +- > > 5 files changed, 53 insertions(+), 2 deletions(-) > > > > diff --git a/config/Tools.mk.in b/config/Tools.mk.in > > index d67352e..aef9ed6 100644 > > --- a/config/Tools.mk.in > > +++ b/config/Tools.mk.in > > @@ -77,5 +77,6 @@ CONFIG_LIBICONV := @libiconv@ > > CONFIG_GCRYPT := @libgcrypt@ > > EXTFS_LIBS := @EXTFS_LIBS@ > > CURSES_LIBS := @CURSES_LIBS@ > > +TINFO_LIBS := @TINFO_LIBS@ > > > > FILE_OFFSET_BITS := @FILE_OFFSET_BITS@ > [...] > > > > > > diff --git a/tools/configure.ac b/tools/configure.ac > > index 9bf6450..1a06ddf 100644 > > --- a/tools/configure.ac > > +++ b/tools/configure.ac > > @@ -318,6 +318,10 @@ i[[3456]]86|x86_64) > > esac > > AX_CHECK_UUID > > AX_CHECK_CURSES > > +AS_IF([test "$ncurses" = "y"], [ > > +AC_CHECK_LIB([tinfo], [define_key], [TINFO_LIBS=-ltinfo]) > > "define_key"? Why not? It is used by gtraceview. If you wish we could test for halfdelay() which is used by xentop. > > +]) > > +AC_SUBST(TINFO_LIBS) > > > > This doesn't look right. Tinfo is needed by libxenstat. It should not > depend on presence of curses library. libtinfo is a part of ncurses. Daniel