Add another drd/tests/bar_bad exp variant.
[valgrind.git] / Makefile.tool.am
blobc779596e714df802187cd35bd9494c32515b84c2
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
19 TOOL_LDADD_COMMON = -lgcc
20 TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@ = \
21         $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) $(TOOL_LDADD_COMMON)
22 if VGCONF_HAVE_PLATFORM_SEC
23 TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@ = \
24         $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) $(TOOL_LDADD_COMMON)
25 endif
27 if !COMPILER_IS_CLANG
28 TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@ += \
29         $(top_builddir)/coregrind/libgcc-sup-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
30 if VGCONF_HAVE_PLATFORM_SEC
31 TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@ += \
32         $(top_builddir)/coregrind/libgcc-sup-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
33 endif
34 else
35 if VGCONF_PLATFORMS_INCLUDE_ARM64_LINUX
36 TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@ += \
37         $(top_builddir)/coregrind/libgcc-sup-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
38 if VGCONF_HAVE_PLATFORM_SEC
39 TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@ += \
40         $(top_builddir)/coregrind/libgcc-sup-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
41 endif
42 endif
43 endif
45 # -Wl,--build-id=none is needed when linking tools with a linker that only
46 # knows -Ttext and not -Ttext-segment. Without this flag newer ld versions
47 # (2.20 and later) create a .note.gnu.build-id at the default text segment
48 # address, which of course means the resulting executable
49 # is unusable. So we have to tell ld not to generate that, with
50 # --build-id=none unless the linker supports -Ttext-segment.
51 TOOL_LDFLAGS_COMMON_LINUX = \
52         -static -nodefaultlibs -nostartfiles -u _start @FLAG_NO_BUILD_ID@
53 TOOL_LDFLAGS_COMMON_DARWIN = \
54         -nodefaultlibs -nostartfiles -Wl,-u,__start -Wl,-e,__start
55 TOOL_LDFLAGS_COMMON_SOLARIS = \
56         -static -nodefaultlibs -nostartfiles -u _start \
57         -Wl,-M,/usr/lib/ld/map.noexstk
58 TOOL_LDFLAGS_COMMON_FREEBSD = -static \
59         -nodefaultlibs -nostartfiles -Wl,-u,_start @FLAG_NO_BUILD_ID@
61 TOOL_LDFLAGS_X86_LINUX = \
62         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
64 TOOL_LDFLAGS_X86_FREEBSD = \
65         $(TOOL_LDFLAGS_COMMON_FREEBSD) @FLAG_M32@
67 TOOL_LDFLAGS_AMD64_LINUX = \
68         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
70 TOOL_LDFLAGS_AMD64_FREEBSD = \
71         $(TOOL_LDFLAGS_COMMON_FREEBSD) @FLAG_M64@
73 TOOL_LDFLAGS_PPC32_LINUX = \
74         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
76 TOOL_LDFLAGS_PPC64BE_LINUX = \
77         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
79 TOOL_LDFLAGS_PPC64LE_LINUX = \
80         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
82 TOOL_LDFLAGS_ARM_LINUX = \
83         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
85 TOOL_LDFLAGS_ARM64_LINUX = \
86         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
88 TOOL_LDFLAGS_ARM64_FREEBSD = \
89         $(TOOL_LDFLAGS_COMMON_FREEBSD) @FLAG_M64@
91 TOOL_LDFLAGS_S390X_LINUX = \
92         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ @FLAG_S390_PGSTE@
94 TOOL_LDFLAGS_X86_DARWIN = \
95         $(TOOL_LDFLAGS_COMMON_DARWIN) -arch i386
97 TOOL_LDFLAGS_AMD64_DARWIN = \
98         $(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64
100 # MIPS Linux default start symbol is __start, not _start like on x86 or amd
101 TOOL_LDFLAGS_MIPS32_LINUX = \
102         -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
103         @FLAG_M32@
105 TOOL_LDFLAGS_NANOMIPS_LINUX = \
106         -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
107         @FLAG_M32@ -Wl,-no-relax
109 TOOL_LDFLAGS_MIPS64_LINUX = \
110         -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
111         @FLAG_M64@
113 TOOL_LDFLAGS_X86_SOLARIS = \
114         $(TOOL_LDFLAGS_COMMON_SOLARIS) @FLAG_M32@
116 TOOL_LDFLAGS_AMD64_SOLARIS = \
117         $(TOOL_LDFLAGS_COMMON_SOLARIS) @FLAG_M64@
119 # On Android we must ask for non-executable stack, not sure why.
120 if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
121 if VGCONF_PLATVARIANT_IS_ANDROID
122 TOOL_LDFLAGS_ARM_LINUX += -Wl,-z,noexecstack
123 endif
124 endif
126 # NB for 64-bit darwin.  We may want to set -Wl,-pagezero_size to
127 # something smaller than the default of 4G, so as to facilitate
128 # loading clients who are also linked thusly (currently m_ume.c
129 # will fail to load them).  Although such setting is probably
130 # better done in link_tool_exe.c.
132 #       -Wl,-pagezero_size,0x100000000
135 #----------------------------------------------------------------------------
136 # vgpreload_<tool>-<platform>.a stuff
137 #----------------------------------------------------------------------------
139 LIBREPLACEMALLOC_X86_LINUX = \
140         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-linux.a
142 LIBREPLACEMALLOC_AMD64_LINUX = \
143         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-linux.a
145 LIBREPLACEMALLOC_PPC32_LINUX = \
146         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-linux.a
148 LIBREPLACEMALLOC_PPC64BE_LINUX = \
149         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64be-linux.a
151 LIBREPLACEMALLOC_PPC64LE_LINUX = \
152         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64le-linux.a
154 LIBREPLACEMALLOC_X86_FREEBSD = \
155         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-freebsd.a
157 LIBREPLACEMALLOC_ARM_LINUX = \
158         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm-linux.a
160 LIBREPLACEMALLOC_ARM64_LINUX = \
161         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm64-linux.a
163 LIBREPLACEMALLOC_AMD64_FREEBSD = \
164         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-freebsd.a
166 LIBREPLACEMALLOC_ARM64_FREEBSD = \
167         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm64-freebsd.a
169 LIBREPLACEMALLOC_X86_DARWIN = \
170         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a
172 LIBREPLACEMALLOC_AMD64_DARWIN = \
173         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-darwin.a
175 LIBREPLACEMALLOC_S390X_LINUX = \
176         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-s390x-linux.a
178 LIBREPLACEMALLOC_MIPS32_LINUX = \
179         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips32-linux.a
181 LIBREPLACEMALLOC_MIPS64_LINUX = \
182         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips64-linux.a
184 LIBREPLACEMALLOC_X86_SOLARIS = \
185         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-solaris.a
187 LIBREPLACEMALLOC_AMD64_SOLARIS = \
188         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-solaris.a
190 LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \
191         -Wl,--whole-archive \
192         $(LIBREPLACEMALLOC_X86_LINUX) \
193         -Wl,--no-whole-archive
195 LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX = \
196         -Wl,--whole-archive \
197         $(LIBREPLACEMALLOC_AMD64_LINUX) \
198         -Wl,--no-whole-archive
200 LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX = \
201         -Wl,--whole-archive \
202         $(LIBREPLACEMALLOC_PPC32_LINUX) \
203         -Wl,--no-whole-archive
205 LIBREPLACEMALLOC_LDFLAGS_PPC64BE_LINUX = \
206         -Wl,--whole-archive \
207         $(LIBREPLACEMALLOC_PPC64BE_LINUX) \
208         -Wl,--no-whole-archive
210 LIBREPLACEMALLOC_LDFLAGS_PPC64LE_LINUX = \
211         -Wl,--whole-archive \
212         $(LIBREPLACEMALLOC_PPC64LE_LINUX) \
213         -Wl,--no-whole-archive
215 LIBREPLACEMALLOC_LDFLAGS_ARM_LINUX = \
216         -Wl,--whole-archive \
217         $(LIBREPLACEMALLOC_ARM_LINUX) \
218         -Wl,--no-whole-archive
220 LIBREPLACEMALLOC_LDFLAGS_ARM64_LINUX = \
221         -Wl,--whole-archive \
222         $(LIBREPLACEMALLOC_ARM64_LINUX) \
223         -Wl,--no-whole-archive
225 LIBREPLACEMALLOC_LDFLAGS_X86_FREEBSD = \
226         -Wl,--whole-archive \
227         $(LIBREPLACEMALLOC_X86_FREEBSD) \
228         -Wl,--no-whole-archive
230 LIBREPLACEMALLOC_LDFLAGS_AMD64_FREEBSD = \
231         -Wl,--whole-archive \
232         $(LIBREPLACEMALLOC_AMD64_FREEBSD) \
233         -Wl,--no-whole-archive
235 LIBREPLACEMALLOC_LDFLAGS_ARM64_FREEBSD = \
236         -Wl,--whole-archive \
237         $(LIBREPLACEMALLOC_ARM64_FREEBSD) \
238         -Wl,--no-whole-archive
240 LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN = \
241         $(LIBREPLACEMALLOC_X86_DARWIN)
243 LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN = \
244         $(LIBREPLACEMALLOC_AMD64_DARWIN)
246 LIBREPLACEMALLOC_LDFLAGS_S390X_LINUX = \
247         -Wl,--whole-archive \
248         $(LIBREPLACEMALLOC_S390X_LINUX) \
249         -Wl,--no-whole-archive
251 LIBREPLACEMALLOC_LDFLAGS_MIPS32_LINUX = \
252         -Wl,--whole-archive \
253         $(LIBREPLACEMALLOC_MIPS32_LINUX) \
254         -Wl,--no-whole-archive
256 LIBREPLACEMALLOC_LDFLAGS_MIPS64_LINUX = \
257         -Wl,--whole-archive \
258         $(LIBREPLACEMALLOC_MIPS64_LINUX) \
259         -Wl,--no-whole-archive
261 LIBREPLACEMALLOC_LDFLAGS_X86_SOLARIS = \
262         -Wl,--whole-archive \
263         $(LIBREPLACEMALLOC_X86_SOLARIS) \
264         -Wl,--no-whole-archive
266 LIBREPLACEMALLOC_LDFLAGS_AMD64_SOLARIS = \
267         -Wl,--whole-archive \
268         $(LIBREPLACEMALLOC_AMD64_SOLARIS) \
269         -Wl,--no-whole-archive
271 #----------------------------------------------------------------------------
272 # General stuff
273 #----------------------------------------------------------------------------
275 all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
277 clean-local: clean-noinst_DSYMS
279 install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS
281 uninstall-local: uninstall-noinst_PROGRAMS uninstall-noinst_DSYMS