libxenguest: correct order of zlib linker options to avoid link errors
authorOlaf Hering <olaf@aepfle.de>
Mon, 26 Jul 2010 10:24:51 +0000 (11:24 +0100)
committerOlaf Hering <olaf@aepfle.de>
Mon, 26 Jul 2010 10:24:51 +0000 (11:24 +0100)
The order of objects and linked libraries is important with recent
toolchain when --as-needed is used.

Introduce new variable COMPRESSION_LIBS and place it at the end of cc
commandline options.  Without this change, symbols in libbzip2 are not
found when building with openSuSE 11.2 and newer.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/Makefile

index 63eeb6ddb7059c150677b9d7b38d82712ec01d92..a87d6c36faf50e51b60aa9a77ca00d74b3a01dce 100644 (file)
@@ -179,9 +179,9 @@ endif
 xc_dom_bzimageloader.o: CFLAGS += $(call zlib-options,D)
 xc_dom_bzimageloader.opic: CFLAGS += $(call zlib-options,D)
 
-libxenguest.so.$(MAJOR).$(MINOR): LDFLAGS += $(call zlib-options,l)
+libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(call zlib-options,l)
 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
-       $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz -lxenctrl $(PTHREAD_LIBS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz -lxenctrl $(PTHREAD_LIBS)
 
 -include $(DEPS)