From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: [PATCH] blktap: correct order of linker options to avoid link errors with recent toolchains Date: Wed, 28 Jul 2010 14:54:19 +0200 Message-ID: <20100728125419.GA1949@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Fix link error in openSuSE 11.2. The order of objects and linked libraries is important with recent toolchain when --as-needed is used. ../../memshr/libmemshr.a(interface.o): In function `memshr_vbd_issue_ro_request': /usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/memshr/interface.c:165: undefined reference to `xc_memshr_nominate_gref' /usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/memshr/interface.c:179: undefined reference to `xc_memshr_share' ../../memshr/libmemshr.a(interface.o): In function `memshr_vbd_initialize': /usr/src/packages/BUILD/xen-unstable.hg-4.1.21864/tools/memshr/interface.c:116: undefined reference to `xc_interface_open' collect2: ld returned 1 exit status make[5]: *** [blktapctrl] Error 1 Signed-off-by: Olaf Hering --- tools/blktap/drivers/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- xen-unstable.hg-4.1.21864.orig/tools/blktap/drivers/Makefile +++ xen-unstable.hg-4.1.21864/tools/blktap/drivers/Makefile @@ -29,7 +29,7 @@ CFLAGS += -DMEMSHR MEMSHRLIBS += $(MEMSHR_DIR)/libmemshr.a endif -LDFLAGS_blktapctrl := $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore) $(MEMSHRLIBS) -L../lib -lblktap -lrt -lm -lpthread +LDFLAGS_blktapctrl := $(MEMSHRLIBS) $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore) -L../lib -lblktap -lrt -lm -lpthread LDFLAGS_img := $(LIBAIO_DIR)/libaio.a $(CRYPT_LIB) -lpthread -lz BLK-OBJS-y := block-aio.o