tools: support building with --as-needed
authorIan Campbell <ian.campbell@citrix.com>
Thu, 17 Mar 2011 19:15:42 +0000 (19:15 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 17 Mar 2011 19:15:42 +0000 (19:15 +0000)
Tested by forcing --as-needed via tools/Rules.mk but this is included
since the intention is simply to support diustros which default to
--as-needed, not to enable it everywhere.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/Rules.mk
tools/blktap2/vhd/lib/Makefile
tools/libxc/Makefile

index 6249573c5bcb1dafd5bbe4dadf9685feb2c21603..e740799e5838d3796cf34ddce048d87e14289a28 100644 (file)
@@ -65,9 +65,6 @@ CFLAGS  += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
 LDFLAGS += $(shell getconf LFS_LDFLAGS)
 endif
 
-# Xen tools build is currently incompatible with ld --as-needed
-LDFLAGS += -Wl,--no-as-needed
-
 # 32-bit x86 does not perform well with -ve segment accesses on Xen.
 CFLAGS-$(CONFIG_X86_32) += $(call cc-option,$(CC),-mno-tls-direct-seg-refs)
 CFLAGS += $(CFLAGS-y)
index 5854900794d7aba21afdb9bffc799ba7f3e896ca..fdfaeedbb4080a7820411a58e7d2454642a22ab4 100644 (file)
@@ -57,7 +57,7 @@ build: $(LIBVHD-BUILD)
 
 libvhd.a: $(LIB-OBJS)
        $(CC) $(CFLAGS) -Wl,$(SONAME_LDFLAG),$(LIBVHD-SONAME) $(SHLIB_LDFLAGS) \
-               $(LDFLAGS) -o libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(LIBS) $^
+               $(LDFLAGS) -o libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $^ $(LIBS)
        ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) libvhd.so.$(LIBVHD-MAJOR)
        ln -sf libvhd.so.$(LIBVHD-MAJOR) libvhd.so
        $(AR) rc $@ $^
index 9942c3ab11d9f2a9e9a75945e1ecd6f23252e5d6..e75500145d041efdb6fc048716aa6c555064d62d 100644 (file)
@@ -159,7 +159,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
        ln -sf $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-       $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(DLOPEN_LIBS) $(SHLIB_LDFLAGS) -o $@ $^ $(PTHREAD_LIBS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(DLOPEN_LIBS) $(PTHREAD_LIBS)
 
 # libxenguest