From: "Jan Beulich" Subject: Re: [PATCH] tools: disable linker --as-needed option Date: Tue, 01 Feb 2011 09:21:53 +0000 Message-ID: <4D47DEC1020000780002FA3C@vpn.id2.novell.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: 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: Ian Campbell Cc: xen-devel@lists.xensource.com, Nathan March List-Id: xen-devel@lists.xenproject.org >>> On 01.02.11 at 10:09, Ian Campbell wrote: > # HG changeset patch > # User Ian Campbell > # Date 1296550939 0 > # Node ID a3fb60cc3be3dc6596ed8395e0eb70514bdfcc74 > # Parent 5b6663ba2bb2c54e8fa6745afa16297ebe43328d > tools: disable linker --as-needed option. >=20 > The Xen build system is not currently compatible with the --as-needed > linker option. The proper fix for this is turning out to be rather > invasive to the build system so simply disable for now with the > intention of revisiting for the 4.2 release. >=20 > The $(COMMA) trick allows "," in macro arguments. >=20 > Signed-off-by: Ian Campbell > Reported/Tested-by: Nathan March >=20 > diff -r 5b6663ba2bb2 -r a3fb60cc3be3 tools/Rules.mk > --- a/tools/Rules.mk Mon Jan 31 09:14:52 2011 +0000 > +++ b/tools/Rules.mk Tue Feb 01 09:02:19 2011 +0000 > @@ -55,6 +55,10 @@ LDFLAGS +=3D $(shell getconf LFS_LDFLAGS) > LDFLAGS +=3D $(shell getconf LFS_LDFLAGS) > endif > =20 > +# Xen tools build is currently incompatible with ld --as-needed > +COMMA :=3D , > +LDFLAGS +=3D $(call cc-option,$(CC),-Wl$(COMMA)--no-as-needed) I don't think this actually works (Did you try with a linker not supporting this option?), as cc-option is implemented passing -S to the compiler (i.e. the linker won't even get invoked). > + > # 32-bit x86 does not perform well with -ve segment accesses on Xen. > CFLAGS-$(CONFIG_X86_32) +=3D $(call cc-option,$(CC),-mno-tls-direct-seg-= refs) > CFLAGS +=3D $(CFLAGS-y) Jan