From: Daniel Kiper <daniel.kiper@oracle.com>
To: xen-devel@lists.xenproject.org
Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com,
ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com
Subject: [PATCH v2] tools: link executables with libtinfo explicitly
Date: Tue, 2 Jun 2015 15:33:26 +0200 [thread overview]
Message-ID: <1433252006-1779-1-git-send-email-daniel.kiper@oracle.com> (raw)
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!
Please run autoconf in tools directory.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
v2 - suggestions/fixes:
- do not include tools/configure changes in this patch
(suggested by Wei Liu).
---
config/Tools.mk.in | 1 +
tools/configure.ac | 4 ++++
tools/misc/Makefile | 2 +-
tools/xenstat/xentop/Makefile | 2 +-
4 files changed, 7 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])
+])
+AC_SUBST(TINFO_LIBS)
dnl The following are only required when upstream QEMU is built
AS_IF([test "x$qemu_xen" = "xy"], [
diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index 3817317..82c361f 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -100,7 +100,7 @@ xen-lowmemd: xen-lowmemd.o
$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(APPEND_LDFLAGS)
gtraceview: gtraceview.o
- $(CC) $(LDFLAGS) -o $@ $< $(CURSES_LIBS) $(APPEND_LDFLAGS)
+ $(CC) $(LDFLAGS) -o $@ $< $(CURSES_LIBS) $(TINFO_LIBS) $(APPEND_LDFLAGS)
xencov: xencov.o
$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
diff --git a/tools/xenstat/xentop/Makefile b/tools/xenstat/xentop/Makefile
index 2652c9d..97950b9 100644
--- a/tools/xenstat/xentop/Makefile
+++ b/tools/xenstat/xentop/Makefile
@@ -19,7 +19,7 @@ all install xentop:
else
CFLAGS += -DGCC_PRINTF -Werror $(CFLAGS_libxenstat)
-LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(SOCKET_LIBS) -lm -lyajl
+LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(TINFO_LIBS) $(SOCKET_LIBS) -lm -lyajl
CFLAGS += -DHOST_$(XEN_OS)
# Include configure output (config.h) to headers search path
--
1.7.10.4
next reply other threads:[~2015-06-02 13:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-02 13:33 Daniel Kiper [this message]
2015-06-02 16:58 ` [PATCH v2] tools: link executables with libtinfo explicitly Wei Liu
2015-06-03 10:35 ` Ian Campbell
2015-06-03 11:08 ` Daniel Kiper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1433252006-1779-1-git-send-email-daniel.kiper@oracle.com \
--to=daniel.kiper@oracle.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).