-> 3.19.0 final.
[valgrind.git] / Makefile.tool.am
blobfe5f002cece8a792785adfb095a42b4c4a0f72cf
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         $(top_builddir)/coregrind/libgcc-sup-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
22 TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@ = \
23         $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) $(TOOL_LDADD_COMMON)
24 if VGCONF_HAVE_PLATFORM_SEC
25 TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@ = \
26         $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) $(TOOL_LDADD_COMMON)
27 endif
30 # -Wl,--build-id=none is needed when linking tools with a linker that only
31 # knows -Ttext and not -Ttext-segment. Without this flag newer ld versions
32 # (2.20 and later) create a .note.gnu.build-id at the default text segment
33 # address, which of course means the resulting executable
34 # is unusable. So we have to tell ld not to generate that, with
35 # --build-id=none unless the linker supports -Ttext-segment.
36 TOOL_LDFLAGS_COMMON_LINUX = \
37         -static -nodefaultlibs -nostartfiles -u _start @FLAG_NO_BUILD_ID@
38 TOOL_LDFLAGS_COMMON_DARWIN = \
39         -nodefaultlibs -nostartfiles -Wl,-u,__start -Wl,-e,__start
40 TOOL_LDFLAGS_COMMON_SOLARIS = \
41         -static -nodefaultlibs -nostartfiles -u _start \
42         -Wl,-M,/usr/lib/ld/map.noexstk
43 TOOL_LDFLAGS_COMMON_FREEBSD = -static \
44         -nodefaultlibs -nostartfiles -Wl,-u,_start @FLAG_NO_BUILD_ID@
46 TOOL_LDFLAGS_X86_LINUX = \
47         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
49 TOOL_LDFLAGS_X86_FREEBSD = \
50         $(TOOL_LDFLAGS_COMMON_FREEBSD) @FLAG_M32@
52 TOOL_LDFLAGS_AMD64_LINUX = \
53         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
55 TOOL_LDFLAGS_AMD64_FREEBSD = \
56         $(TOOL_LDFLAGS_COMMON_FREEBSD) @FLAG_M64@
58 TOOL_LDFLAGS_PPC32_LINUX = \
59         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
61 TOOL_LDFLAGS_PPC64BE_LINUX = \
62         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
64 TOOL_LDFLAGS_PPC64LE_LINUX = \
65         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
67 TOOL_LDFLAGS_ARM_LINUX = \
68         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
70 TOOL_LDFLAGS_ARM64_LINUX = \
71         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
73 TOOL_LDFLAGS_S390X_LINUX = \
74         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
76 TOOL_LDFLAGS_X86_DARWIN = \
77         $(TOOL_LDFLAGS_COMMON_DARWIN) -arch i386
79 TOOL_LDFLAGS_AMD64_DARWIN = \
80         $(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64
82 # MIPS Linux default start symbol is __start, not _start like on x86 or amd
83 TOOL_LDFLAGS_MIPS32_LINUX = \
84         -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
85         @FLAG_M32@
87 TOOL_LDFLAGS_NANOMIPS_LINUX = \
88         -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
89         @FLAG_M32@ -Wl,-no-relax
91 TOOL_LDFLAGS_MIPS64_LINUX = \
92         -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
93         @FLAG_M64@
95 TOOL_LDFLAGS_X86_SOLARIS = \
96         $(TOOL_LDFLAGS_COMMON_SOLARIS) @FLAG_M32@
98 TOOL_LDFLAGS_AMD64_SOLARIS = \
99         $(TOOL_LDFLAGS_COMMON_SOLARIS) @FLAG_M64@
101 # On Android we must ask for non-executable stack, not sure why.
102 if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
103 if VGCONF_PLATVARIANT_IS_ANDROID
104 TOOL_LDFLAGS_ARM_LINUX += -Wl,-z,noexecstack
105 endif
106 endif
108 # NB for 64-bit darwin.  We may want to set -Wl,-pagezero_size to
109 # something smaller than the default of 4G, so as to facilitate
110 # loading clients who are also linked thusly (currently m_ume.c
111 # will fail to load them).  Although such setting is probably
112 # better done in link_tool_exe.c.
114 #       -Wl,-pagezero_size,0x100000000
117 #----------------------------------------------------------------------------
118 # vgpreload_<tool>-<platform>.a stuff
119 #----------------------------------------------------------------------------
121 LIBREPLACEMALLOC_X86_LINUX = \
122         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-linux.a
124 LIBREPLACEMALLOC_AMD64_LINUX = \
125         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-linux.a
127 LIBREPLACEMALLOC_PPC32_LINUX = \
128         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-linux.a
130 LIBREPLACEMALLOC_PPC64BE_LINUX = \
131         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64be-linux.a
133 LIBREPLACEMALLOC_PPC64LE_LINUX = \
134         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64le-linux.a
136 LIBREPLACEMALLOC_X86_FREEBSD = \
137         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-freebsd.a
139 LIBREPLACEMALLOC_ARM_LINUX = \
140         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm-linux.a
142 LIBREPLACEMALLOC_ARM64_LINUX = \
143         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm64-linux.a
145 LIBREPLACEMALLOC_AMD64_FREEBSD = \
146         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-freebsd.a
148 LIBREPLACEMALLOC_X86_DARWIN = \
149         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a
151 LIBREPLACEMALLOC_AMD64_DARWIN = \
152         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-darwin.a
154 LIBREPLACEMALLOC_S390X_LINUX = \
155         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-s390x-linux.a
157 LIBREPLACEMALLOC_MIPS32_LINUX = \
158         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips32-linux.a
160 LIBREPLACEMALLOC_MIPS64_LINUX = \
161         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips64-linux.a
163 LIBREPLACEMALLOC_X86_SOLARIS = \
164         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-solaris.a
166 LIBREPLACEMALLOC_AMD64_SOLARIS = \
167         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-solaris.a
169 LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \
170         -Wl,--whole-archive \
171         $(LIBREPLACEMALLOC_X86_LINUX) \
172         -Wl,--no-whole-archive
174 LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX = \
175         -Wl,--whole-archive \
176         $(LIBREPLACEMALLOC_AMD64_LINUX) \
177         -Wl,--no-whole-archive
179 LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX = \
180         -Wl,--whole-archive \
181         $(LIBREPLACEMALLOC_PPC32_LINUX) \
182         -Wl,--no-whole-archive
184 LIBREPLACEMALLOC_LDFLAGS_PPC64BE_LINUX = \
185         -Wl,--whole-archive \
186         $(LIBREPLACEMALLOC_PPC64BE_LINUX) \
187         -Wl,--no-whole-archive
189 LIBREPLACEMALLOC_LDFLAGS_PPC64LE_LINUX = \
190         -Wl,--whole-archive \
191         $(LIBREPLACEMALLOC_PPC64LE_LINUX) \
192         -Wl,--no-whole-archive
194 LIBREPLACEMALLOC_LDFLAGS_ARM_LINUX = \
195         -Wl,--whole-archive \
196         $(LIBREPLACEMALLOC_ARM_LINUX) \
197         -Wl,--no-whole-archive
199 LIBREPLACEMALLOC_LDFLAGS_ARM64_LINUX = \
200         -Wl,--whole-archive \
201         $(LIBREPLACEMALLOC_ARM64_LINUX) \
202         -Wl,--no-whole-archive
204 LIBREPLACEMALLOC_LDFLAGS_X86_FREEBSD = \
205         -Wl,--whole-archive \
206         $(LIBREPLACEMALLOC_X86_FREEBSD) \
207         -Wl,--no-whole-archive
209 LIBREPLACEMALLOC_LDFLAGS_AMD64_FREEBSD = \
210         -Wl,--whole-archive \
211         $(LIBREPLACEMALLOC_AMD64_FREEBSD) \
212         -Wl,--no-whole-archive
214 LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN = \
215         $(LIBREPLACEMALLOC_X86_DARWIN)
217 LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN = \
218         $(LIBREPLACEMALLOC_AMD64_DARWIN)
220 LIBREPLACEMALLOC_LDFLAGS_S390X_LINUX = \
221         -Wl,--whole-archive \
222         $(LIBREPLACEMALLOC_S390X_LINUX) \
223         -Wl,--no-whole-archive
225 LIBREPLACEMALLOC_LDFLAGS_MIPS32_LINUX = \
226         -Wl,--whole-archive \
227         $(LIBREPLACEMALLOC_MIPS32_LINUX) \
228         -Wl,--no-whole-archive
230 LIBREPLACEMALLOC_LDFLAGS_MIPS64_LINUX = \
231         -Wl,--whole-archive \
232         $(LIBREPLACEMALLOC_MIPS64_LINUX) \
233         -Wl,--no-whole-archive
235 LIBREPLACEMALLOC_LDFLAGS_X86_SOLARIS = \
236         -Wl,--whole-archive \
237         $(LIBREPLACEMALLOC_X86_SOLARIS) \
238         -Wl,--no-whole-archive
240 LIBREPLACEMALLOC_LDFLAGS_AMD64_SOLARIS = \
241         -Wl,--whole-archive \
242         $(LIBREPLACEMALLOC_AMD64_SOLARIS) \
243         -Wl,--no-whole-archive
245 #----------------------------------------------------------------------------
246 # General stuff
247 #----------------------------------------------------------------------------
249 all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
251 clean-local: clean-noinst_DSYMS
253 install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS
255 uninstall-local: uninstall-noinst_PROGRAMS uninstall-noinst_DSYMS