debuggers.hg

view tools/Rules.mk @ 22902:18807b89083d

tools: disable linker --as-needed option.

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.

The --no-as-needed option is available at least since binutils 2.15
(released in May 2004) and hence I think can be unconditionally relied
on.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reported-by: Nathan March <nathan@gt.net>
Tested-by: Nathan March <nathan@gt.net>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Ian Campbell <ian.campbell@citrix.com>
date Tue Feb 01 19:23:31 2011 +0000 (2011-02-01)
parents ae51abc964ee
children
line source
1 # -*- mode: Makefile; -*-
3 # `all' is the default target
4 all:
6 include $(XEN_ROOT)/Config.mk
8 export _INSTALL := $(INSTALL)
9 INSTALL = $(XEN_ROOT)/tools/cross-install
11 XEN_INCLUDE = $(XEN_ROOT)/tools/include
12 XEN_XC = $(XEN_ROOT)/tools/python/xen/lowlevel/xc
13 XEN_LIBXC = $(XEN_ROOT)/tools/libxc
14 XEN_XENSTORE = $(XEN_ROOT)/tools/xenstore
15 XEN_LIBXENSTAT = $(XEN_ROOT)/tools/xenstat/libxenstat/src
16 XEN_BLKTAP2 = $(XEN_ROOT)/tools/blktap2
18 CFLAGS_include = -I$(XEN_INCLUDE)
20 CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_include)
21 LDLIBS_libxenctrl = -L$(XEN_LIBXC) -lxenctrl $(DLOPEN_LIBS)
23 CFLAGS_libxenguest = -I$(XEN_LIBXC) $(CFLAGS_include)
24 LDLIBS_libxenguest = -L$(XEN_LIBXC) -lxenguest
26 CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_include)
27 LDLIBS_libxenstore = -L$(XEN_XENSTORE) -lxenstore
29 ifeq ($(CONFIG_Linux),y)
30 LIBXL_BLKTAP = y
31 else
32 LIBXL_BLKTAP = n
33 endif
35 ifeq ($(LIBXL_BLKTAP),y)
36 CFLAGS_libblktapctl = -I$(XEN_BLKTAP2)/control -I$(XEN_BLKTAP2)/include $(CFLAGS_include)
37 LDLIBS_libblktapctl = -L$(XEN_BLKTAP2)/control -lblktapctl
38 else
39 CFLAGS_libblktapctl =
40 LDLIBS_libblktapctl =
41 endif
43 X11_LDPATH = -L/usr/X11R6/$(LIBLEAFDIR)
45 CFLAGS += -D__XEN_TOOLS__
47 # Get gcc to generate the dependencies for us.
48 CFLAGS += -MMD -MF .$(@F).d
49 DEPS = .*.d
51 ifneq ($(XEN_OS),NetBSD)
52 # Enable implicit LFS support *and* explicit LFS names.
53 CFLAGS += $(shell getconf LFS_CFLAGS)
54 CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
55 LDFLAGS += $(shell getconf LFS_LDFLAGS)
56 endif
58 # Xen tools build is currently incompatible with ld --as-needed
59 LDFLAGS += -Wl,--no-as-needed
61 # 32-bit x86 does not perform well with -ve segment accesses on Xen.
62 CFLAGS-$(CONFIG_X86_32) += $(call cc-option,$(CC),-mno-tls-direct-seg-refs)
63 CFLAGS += $(CFLAGS-y)
65 # Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
66 check-$(CONFIG_X86) = $(call cc-ver-check,CC,0x030400,\
67 "Xen requires at least gcc-3.4")
68 $(eval $(check-y))
70 _PYTHON_PATH := $(shell which $(PYTHON))
71 PYTHON_PATH ?= $(_PYTHON_PATH)
72 INSTALL_PYTHON_PROG = \
73 $(XEN_ROOT)/tools/python/install-wrap "$(PYTHON_PATH)" $(INSTALL_PROG)
75 %.opic: %.c
76 $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
78 %.o: %.c
79 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
81 %.o: %.cc
82 $(CC) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
84 subdirs-all subdirs-clean subdirs-install subdirs-distclean: .phony
85 @set -e; for subdir in $(SUBDIRS) $(SUBDIRS-y); do \
86 $(MAKE) subdir-$(patsubst subdirs-%,%,$@)-$$subdir; \
87 done
89 subdir-all-% subdir-clean-% subdir-install-%: .phony
90 $(MAKE) -C $* $(patsubst subdir-%-$*,%,$@)
92 subdir-distclean-%: .phony
93 $(MAKE) -C $* clean