WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] correct order of linker options to avoid link errors

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] correct order of linker options to avoid link errors with recent toolchains
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Fri, 23 Jul 2010 21:55:14 +0200
Delivery-date: Fri, 23 Jul 2010 12:56:19 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1279914917; l=1312; s=domk; d=aepfle.de; h=In-Reply-To:Content-Type:MIME-Version:References:Subject:To:From: Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=5i4Hg3F0UZKX3GMjy7lXDn0FcQo=; b=qPDhSllv+46b1AalWmngiOx62HCbYtNNIwgz6gmI+10tpckyxbK9TXYSwxHoRRf/Xzw k8tv9YzjhDGAfholl+C3AhVqvA7t+gHFVGxC/qVou+7+gNdQvoELq1er84Ccrq5zQwR7b GkKOQDPUXPFZYGNi7o9+ax/WlXQyyP/UniA=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100723121154.GA3540@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20100723121154.GA3540@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
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@xxxxxxxxx>

---
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)
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel