drd/tests/swapcontext: Improve the portability of this test further
[valgrind.git] / Makefile.tool.am
blob2bf90de5da6d9e90cf73cc910552753aff4ccb67
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
44 TOOL_LDFLAGS_X86_LINUX = \
45         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
47 TOOL_LDFLAGS_AMD64_LINUX = \
48         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
50 TOOL_LDFLAGS_PPC32_LINUX = \
51         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
53 TOOL_LDFLAGS_PPC64BE_LINUX = \
54         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
56 TOOL_LDFLAGS_PPC64LE_LINUX = \
57         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
59 TOOL_LDFLAGS_ARM_LINUX = \
60         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
62 TOOL_LDFLAGS_ARM64_LINUX = \
63         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
65 TOOL_LDFLAGS_S390X_LINUX = \
66         $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
68 TOOL_LDFLAGS_X86_DARWIN = \
69         $(TOOL_LDFLAGS_COMMON_DARWIN) -arch i386
71 TOOL_LDFLAGS_AMD64_DARWIN = \
72         $(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64
74 # MIPS Linux default start symbol is __start, not _start like on x86 or amd
75 TOOL_LDFLAGS_MIPS32_LINUX = \
76         -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
77         @FLAG_M32@
79 TOOL_LDFLAGS_NANOMIPS_LINUX = \
80         -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
81         @FLAG_M32@ -Wl,-no-relax
83 TOOL_LDFLAGS_MIPS64_LINUX = \
84         -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
85         @FLAG_M64@
87 TOOL_LDFLAGS_X86_SOLARIS = \
88         $(TOOL_LDFLAGS_COMMON_SOLARIS) @FLAG_M32@
90 TOOL_LDFLAGS_AMD64_SOLARIS = \
91         $(TOOL_LDFLAGS_COMMON_SOLARIS) @FLAG_M64@
93 # On Android we must ask for non-executable stack, not sure why.
94 if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
95 if VGCONF_PLATVARIANT_IS_ANDROID
96 TOOL_LDFLAGS_ARM_LINUX += -Wl,-z,noexecstack
97 endif
98 endif
100 # NB for 64-bit darwin.  We may want to set -Wl,-pagezero_size to
101 # something smaller than the default of 4G, so as to facilitate
102 # loading clients who are also linked thusly (currently m_ume.c
103 # will fail to load them).  Although such setting is probably
104 # better done in link_tool_exe.c.
106 #       -Wl,-pagezero_size,0x100000000
109 #----------------------------------------------------------------------------
110 # vgpreload_<tool>-<platform>.a stuff
111 #----------------------------------------------------------------------------
113 LIBREPLACEMALLOC_X86_LINUX = \
114         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-linux.a
116 LIBREPLACEMALLOC_AMD64_LINUX = \
117         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-linux.a
119 LIBREPLACEMALLOC_PPC32_LINUX = \
120         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-linux.a
122 LIBREPLACEMALLOC_PPC64BE_LINUX = \
123         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64be-linux.a
125 LIBREPLACEMALLOC_PPC64LE_LINUX = \
126         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64le-linux.a
128 LIBREPLACEMALLOC_ARM_LINUX = \
129         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm-linux.a
131 LIBREPLACEMALLOC_ARM64_LINUX = \
132         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm64-linux.a
134 LIBREPLACEMALLOC_X86_DARWIN = \
135         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a
137 LIBREPLACEMALLOC_AMD64_DARWIN = \
138         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-darwin.a
140 LIBREPLACEMALLOC_S390X_LINUX = \
141         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-s390x-linux.a
143 LIBREPLACEMALLOC_MIPS32_LINUX = \
144         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips32-linux.a
146 LIBREPLACEMALLOC_MIPS64_LINUX = \
147         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips64-linux.a
149 LIBREPLACEMALLOC_X86_SOLARIS = \
150         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-solaris.a
152 LIBREPLACEMALLOC_AMD64_SOLARIS = \
153         $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-solaris.a
155 LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \
156         -Wl,--whole-archive \
157         $(LIBREPLACEMALLOC_X86_LINUX) \
158         -Wl,--no-whole-archive
160 LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX = \
161         -Wl,--whole-archive \
162         $(LIBREPLACEMALLOC_AMD64_LINUX) \
163         -Wl,--no-whole-archive
165 LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX = \
166         -Wl,--whole-archive \
167         $(LIBREPLACEMALLOC_PPC32_LINUX) \
168         -Wl,--no-whole-archive
170 LIBREPLACEMALLOC_LDFLAGS_PPC64BE_LINUX = \
171         -Wl,--whole-archive \
172         $(LIBREPLACEMALLOC_PPC64BE_LINUX) \
173         -Wl,--no-whole-archive
175 LIBREPLACEMALLOC_LDFLAGS_PPC64LE_LINUX = \
176         -Wl,--whole-archive \
177         $(LIBREPLACEMALLOC_PPC64LE_LINUX) \
178         -Wl,--no-whole-archive
180 LIBREPLACEMALLOC_LDFLAGS_ARM_LINUX = \
181         -Wl,--whole-archive \
182         $(LIBREPLACEMALLOC_ARM_LINUX) \
183         -Wl,--no-whole-archive
185 LIBREPLACEMALLOC_LDFLAGS_ARM64_LINUX = \
186         -Wl,--whole-archive \
187         $(LIBREPLACEMALLOC_ARM64_LINUX) \
188         -Wl,--no-whole-archive
190 LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN = \
191         $(LIBREPLACEMALLOC_X86_DARWIN)
193 LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN = \
194         $(LIBREPLACEMALLOC_AMD64_DARWIN)
196 LIBREPLACEMALLOC_LDFLAGS_S390X_LINUX = \
197         -Wl,--whole-archive \
198         $(LIBREPLACEMALLOC_S390X_LINUX) \
199         -Wl,--no-whole-archive
201 LIBREPLACEMALLOC_LDFLAGS_MIPS32_LINUX = \
202         -Wl,--whole-archive \
203         $(LIBREPLACEMALLOC_MIPS32_LINUX) \
204         -Wl,--no-whole-archive
206 LIBREPLACEMALLOC_LDFLAGS_MIPS64_LINUX = \
207         -Wl,--whole-archive \
208         $(LIBREPLACEMALLOC_MIPS64_LINUX) \
209         -Wl,--no-whole-archive
211 LIBREPLACEMALLOC_LDFLAGS_X86_SOLARIS = \
212         -Wl,--whole-archive \
213         $(LIBREPLACEMALLOC_X86_SOLARIS) \
214         -Wl,--no-whole-archive
216 LIBREPLACEMALLOC_LDFLAGS_AMD64_SOLARIS = \
217         -Wl,--whole-archive \
218         $(LIBREPLACEMALLOC_AMD64_SOLARIS) \
219         -Wl,--no-whole-archive
221 #----------------------------------------------------------------------------
222 # General stuff
223 #----------------------------------------------------------------------------
225 all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
227 clean-local: clean-noinst_DSYMS
229 install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS
231 uninstall-local: uninstall-noinst_PROGRAMS uninstall-noinst_DSYMS