blktap: correct order of linker options to avoid link errors with recent toolchains
PATCH 1/1 blktap: correct order of linker options to avoid link errors with recent toolchains
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
--- tools/blktap/drivers/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/blktap/drivers/Makefile +1 -1
@@ -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