From: Wei Liu Subject: Re: [PATCH] tools: link executables with libtinfo explicitly Date: Mon, 1 Jun 2015 14:06:44 +0100 Message-ID: <20150601130644.GE19403@zion.uk.xensource.com> References: <1432937248-24644-1-git-send-email-daniel.kiper@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YzPQZ-0000zv-IG for xen-devel@lists.xenproject.org; Mon, 01 Jun 2015 13:06:51 +0000 Content-Disposition: inline In-Reply-To: <1432937248-24644-1-git-send-email-daniel.kiper@oracle.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: Daniel Kiper Cc: xen-devel@lists.xenproject.org, wei.liu2@citrix.com, ian.jackson@eu.citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org 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. > 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"? > +]) > +AC_SUBST(TINFO_LIBS) > This doesn't look right. Tinfo is needed by libxenstat. It should not depend on presence of curses library. Wei.