All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: xen-devel@lists.xensource.com
Subject: [PATCH] xenpaging: correct order of linker options to avoid link errors with recent toolchains
Date: Wed, 28 Jul 2010 17:47:50 +0200	[thread overview]
Message-ID: <20100728154750.GA6899@aepfle.de> (raw)
In-Reply-To: <19536.14440.565355.587038@mariner.uk.xensource.com>



Fix link error in openSuSE 11.2. 
The order of objects and linked libraries is important with recent toolchain
when --as-needed is used.


xc.o: In function `xc_wait_for_event_or_timeout':
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xc.c:80: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xc.c:86: undefined reference to `xc_evtchn_pending'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xc.c:89: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xc.c:93: undefined reference to `xc_evtchn_unmask'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xc.c:96: undefined reference to `xc_report_error'
xc.o: In function `xc_mem_paging_flush_ioemu_cache':
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xc.c:57: undefined reference to `xs_daemon_open'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xc.c:61: undefined reference to `xs_write'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xc.c:63: undefined reference to `xs_daemon_close'
xc.o: In function `get_platform_info':
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/../../tools/libxc/xg_save_restore.h:52: undefined reference to `xc_version'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/../../tools/libxc/xg_save_restore.h:55: undefined reference to `xc_version'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/../../tools/libxc/xg_save_restore.h:58: undefined reference to `xc_memory_op'
xc.o: In function `do_domctl':
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/../../tools/libxc/xc_private.h:148: undefined reference to `hcall_buf_prep'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/../../tools/libxc/xc_private.h:150: undefined reference to `safe_strerror'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/../../tools/libxc/xc_private.h:150: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/../../tools/libxc/xc_private.h:159: undefined reference to `do_xen_hypercall'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/../../tools/libxc/xc_private.h:162: undefined reference to `xc_report'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/../../tools/libxc/xc_private.h:166: undefined reference to `hcall_buf_release'
xenpaging.o: In function `xenpaging_resume_page':
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:393: undefined reference to `xc_mem_paging_resume'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:395: undefined reference to `xc_evtchn_notify'
xenpaging.o: In function `xenpaging_evict_page':
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:342: undefined reference to `xc_map_foreign_pages'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:346: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:355: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:365: undefined reference to `xc_mem_paging_evict'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:369: undefined reference to `xc_report_error'
xenpaging.o: In function `evict_victim':
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:457: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:461: undefined reference to `xc_mem_paging_nominate'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:469: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:475: undefined reference to `xc_report_error'
xenpaging.o: In function `xenpaging_teardown':
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:244: undefined reference to `xc_mem_event_disable'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:247: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:252: undefined reference to `xc_evtchn_unbind'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:255: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:261: undefined reference to `xc_evtchn_close'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:264: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:270: undefined reference to `xc_interface_close'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:273: undefined reference to `xc_report_error'
xenpaging.o: In function `xenpaging_init':
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:76: undefined reference to `xc_interface_open'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:80: undefined reference to `xc_report'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:97: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:105: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:119: undefined reference to `xc_mem_event_enable'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:125: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:127: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:132: undefined reference to `xc_evtchn_open'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:135: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:140: undefined reference to `xc_evtchn_bind_interdomain'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:145: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:155: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:163: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:171: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:175: undefined reference to `xc_domain_getinfolist'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:179: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:190: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:193: undefined reference to `xc_report'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:199: undefined reference to `xc_report_error'
xenpaging.o: In function `main':
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:529: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:539: undefined reference to `xc_report'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:542: undefined reference to `xc_report'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:551: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:556: undefined reference to `xc_report'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:581: undefined reference to `xc_report'
xenpaging.o: In function `xenpaging_populate_page':
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:411: undefined reference to `xc_mem_paging_prep'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:415: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:422: undefined reference to `xc_map_foreign_pages'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:427: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:435: undefined reference to `xc_report_error'
xenpaging.o: In function `main':
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:589: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:602: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:611: undefined reference to `xc_report'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:629: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:643: undefined reference to `xc_report_error'
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/xenpaging.c:648: undefined reference to `xc_interface_close'
policy_default.o: In function `policy_choose_victim':
/usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/xenpaging/policy_default.c:64: undefined reference to `xc_report'
collect2: ld returned 1 exit status
make[3]: *** [xenpaging] Error 1

Signed-off-by: Olaf Hering <olaf@aepfle.de>

---
v2: use XENPAGING_LIBS instead of moving LDFLAGS to the end of cmdline

 tools/xenpaging/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- xen-unstable.hg-4.1.21864.orig/tools/xenpaging/Makefile
+++ xen-unstable.hg-4.1.21864/tools/xenpaging/Makefile
@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 CFLAGS   += -I $(XEN_XC)
 CFLAGS   += -I ./
 CFLAGS   += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore)
-LDFLAGS  += $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore)
+XENPAGING_LIBS = $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore)
 
 POLICY    = default
 
@@ -27,7 +27,7 @@ IBINS    = xenpaging
 all: $(IBINS)
 
 xenpaging: $(OBJS)
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(XENPAGING_LIBS)
 
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)

  reply	other threads:[~2010-07-28 15:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-28 12:55 [PATCH] xenpaging: correct order of linker options to avoid link errors with recent toolchains Olaf Hering
2010-07-28 14:02 ` Ian Jackson
2010-07-28 15:47   ` Olaf Hering [this message]
2010-07-28 16:05     ` Ian Jackson
2010-07-28 16:15       ` Olaf Hering
2010-07-29 15:16         ` Ian Jackson
2010-07-29 15:20           ` Olaf Hering
2010-07-29 15:39             ` Ian Jackson
2010-08-01  9:51           ` [PATCH] split LDLIBS from LDFLAGS to fix link errors in " Olaf Hering
2010-08-11 13:44             ` Ian Jackson

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=20100728154750.GA6899@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.