From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: [PATCH] correct order of linker options to avoid link errors with recent toolchains Date: Fri, 23 Jul 2010 21:55:14 +0200 Message-ID: <20100723195514.GA11084@aepfle.de> References: <20100723121154.GA3540@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Content-Disposition: inline In-Reply-To: <20100723121154.GA3540@aepfle.de> 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 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 --- v2: use COMPRESSION_LIBS instead of moving LDFLAGS around tools/libxc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- xen-unstable.hg-4.1.21836.orig/tools/libxc/Makefile +++ xen-unstable.hg-4.1.21836/tools/libxc/Makefile @@ -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)