diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2011-03-17 19:38:05 +0000 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2011-03-17 19:38:05 +0000 |
commit | 494c9074b3dc32b7b3b7f84e6aca2781f9bdc096 (patch) | |
tree | 8000a58e21976f02b503a137c09a299ad375bf58 /tools/misc | |
parent | 0394b57cda6f09f2d45feaf5a4f9dc62d6798c23 (diff) | |
download | xen-494c9074b3dc32b7b3b7f84e6aca2781f9bdc096.tar.gz xen-494c9074b3dc32b7b3b7f84e6aca2781f9bdc096.tar.bz2 xen-494c9074b3dc32b7b3b7f84e6aca2781f9bdc096.zip |
tools: do not link against unused libraries.
A fair few things under tools link against libraries which they don't
even use.
Most of this appears to come from copy-and-pasting previous Makefile
snippets and cargo-culting plus the tendency to define global $(LIBS)
even for Makefiles which build multiple separate utilities or
libraries.
Identified by comparing a build with --as-needed to one without by
looking at the NEEDED header of all ELF objects.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/misc')
-rw-r--r-- | tools/misc/Makefile | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/misc/Makefile b/tools/misc/Makefile index e4e8bfe14c..549ee7d3d5 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -15,6 +15,14 @@ TARGETS-$(CONFIG_X86) += xen-detect xen-hvmctx xen-hvmcrash TARGETS-$(CONFIG_MIGRATE) += xen-hptool TARGETS := $(TARGETS-y) +LDLIBS_xenperf := $(LDLIBS_libxenctrl) +LDLIBS_xenpm := $(LDLIBS_libxenctrl) +LDLIBS_xenlockprof := $(LDLIBS_libxenctrl) +LDLIBS_xenwatchdogd := $(LDLIBS_libxenctrl) +LDLIBS_xen-hvmctx := $(LDLIBS_libxenctrl) +LDLIBS_xen-hvmcrash := $(LDLIBS_libxenctrl) +LDLIBS_xen-hptool := $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) + SUBDIRS-$(CONFIG_LOMOUNT) += lomount SUBDIRS-$(CONFIG_MINITERM) += miniterm SUBDIRS := $(SUBDIRS-y) @@ -52,7 +60,7 @@ clean: $(CC) -c $(CFLAGS) -o $@ $< xen-hvmctx xen-hvmcrash xenperf xenpm gtracestat xenlockprof xen-hptool xenwatchdogd: %: %.o Makefile - $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) + $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS_$*) gtraceview: %: %.o Makefile $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CURSES_LIBS) |