xen: Infratructure for XEN_TMEM_* hypercalls
[valgrind.git] / Makefile.tool.am
blob8e0a0ad62cb0394e100d94d7a47065088cd289ce
2 SUBDIRS = . tests
4 include $(top_srcdir)/Makefile.all.am
6 #----------------------------------------------------------------------------
7 # <tool>-<platform> stuff
8 #----------------------------------------------------------------------------
10 TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@ = \
11         $(top_builddir)/coregrind/libcoregrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a \
12         $(top_builddir)/VEX/libvex-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
13 if VGCONF_HAVE_PLATFORM_SEC
14 TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@ = \
15         $(top_builddir)/coregrind/libcoregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a \
16         $(top_builddir)/VEX/libvex-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
17 endif
20 TOOL_LDADD_COMMON = -lgcc
21 TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@ = \
22         $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) $(TOOL_LDADD_COMMON)
23 if VGCONF_HAVE_PLATFORM_SEC
24 TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@ = \
25         $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) $(TOOL_LDADD_COMMON)
26 endif
29 # -Wl,--build-id=none is needed when linking tools with a linker that only
30 # knows -Ttext and not -Ttext-segment. Without this flag newer ld versions
31 # (2.20 and later) create a .note.gnu.build-id at the default text segment
32 # address, which of course means the resulting executable
33 # is unusable. So we have to tell ld not to generate that, with
34 # --build-id=none unless the linker supports -Ttext-segment.
35 TOOL_LDFLAGS_COMMON_LINUX = \
36         -static -nodefaultlibs -nostartfiles -u _start @FLAG_NO_BUILD_ID@
37 TOOL_LDFLAGS_COMMON_DARWIN = \
38         -nodefaultlibs -nostartfiles -Wl,-u,__start -Wl,-e,__start
40 TOOL_LDFLAGS_X86_LINUX = \
41         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
43 TOOL_LDFLAGS_AMD64_LINUX = \
44         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
46 TOOL_LDFLAGS_PPC32_LINUX = \
47         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
49 TOOL_LDFLAGS_PPC64_LINUX = \
50         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
52 TOOL_LDFLAGS_ARM_LINUX = \
53         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
55 TOOL_LDFLAGS_S390X_LINUX = \
56         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
58 TOOL_LDFLAGS_X86_DARWIN = \
59         $(TOOL_LDFLAGS_COMMON_DARWIN) -arch i386
61 TOOL_LDFLAGS_AMD64_DARWIN = \
62         $(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64
64 # MIPS Linux default start symbol is __start, not _start like on x86 or amd
65 TOOL_LDFLAGS_MIPS32_LINUX = \
66         -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
67         @FLAG_M32@
69 TOOL_LDFLAGS_MIPS64_LINUX = \
70         -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
71         @FLAG_M64@
73 # On Android we must ask for non-executable stack, not sure why.
74 if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
75 if VGCONF_PLATVARIANT_IS_ANDROID
76 TOOL_LDFLAGS_ARM_LINUX += -Wl,-z,noexecstack
77 endif
78 endif
80 # NB for 64-bit darwin.  We may want to set -Wl,-pagezero_size to
81 # something smaller than the default of 4G, so as to facilitate
82 # loading clients who are also linked thusly (currently m_ume.c
83 # will fail to load them).  Although such setting is probably
84 # better done in link_tool_exe.c.
86 #       -Wl,-pagezero_size,0x100000000
89 #----------------------------------------------------------------------------
90 # vgpreload_<tool>-<platform>.a stuff
91 #----------------------------------------------------------------------------
93 LIBREPLACEMALLOC_X86_LINUX = \
94         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-linux.a
96 LIBREPLACEMALLOC_AMD64_LINUX = \
97         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-linux.a
99 LIBREPLACEMALLOC_PPC32_LINUX = \
100         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-linux.a
102 LIBREPLACEMALLOC_PPC64_LINUX = \
103         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64-linux.a
105 LIBREPLACEMALLOC_ARM_LINUX = \
106         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm-linux.a
108 LIBREPLACEMALLOC_X86_DARWIN = \
109         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a
111 LIBREPLACEMALLOC_AMD64_DARWIN = \
112         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-darwin.a
114 LIBREPLACEMALLOC_S390X_LINUX = \
115         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-s390x-linux.a
117 LIBREPLACEMALLOC_MIPS32_LINUX = \
118         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips32-linux.a
120 LIBREPLACEMALLOC_MIPS64_LINUX = \
121         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips64-linux.a
123 LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \
124         -Wl,--whole-archive \
125         $(LIBREPLACEMALLOC_X86_LINUX) \
126         -Wl,--no-whole-archive
128 LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX = \
129         -Wl,--whole-archive \
130         $(LIBREPLACEMALLOC_AMD64_LINUX) \
131         -Wl,--no-whole-archive
133 LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX = \
134         -Wl,--whole-archive \
135         $(LIBREPLACEMALLOC_PPC32_LINUX) \
136         -Wl,--no-whole-archive
138 LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX = \
139         -Wl,--whole-archive \
140         $(LIBREPLACEMALLOC_PPC64_LINUX) \
141         -Wl,--no-whole-archive
143 LIBREPLACEMALLOC_LDFLAGS_ARM_LINUX = \
144         -Wl,--whole-archive \
145         $(LIBREPLACEMALLOC_ARM_LINUX) \
146         -Wl,--no-whole-archive
148 LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN = \
149         $(LIBREPLACEMALLOC_X86_DARWIN)
151 LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN = \
152         $(LIBREPLACEMALLOC_AMD64_DARWIN)
154 LIBREPLACEMALLOC_LDFLAGS_S390X_LINUX = \
155         -Wl,--whole-archive \
156         $(LIBREPLACEMALLOC_S390X_LINUX) \
157         -Wl,--no-whole-archive
159 LIBREPLACEMALLOC_LDFLAGS_MIPS32_LINUX = \
160         -Wl,--whole-archive \
161         $(LIBREPLACEMALLOC_MIPS32_LINUX) \
162         -Wl,--no-whole-archive
164 LIBREPLACEMALLOC_LDFLAGS_MIPS64_LINUX = \
165         -Wl,--whole-archive \
166         $(LIBREPLACEMALLOC_MIPS64_LINUX) \
167         -Wl,--no-whole-archive
169 #----------------------------------------------------------------------------
170 # General stuff
171 #----------------------------------------------------------------------------
173 all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
175 clean-local: clean-noinst_DSYMS
177 install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS