1
2SUBDIRS = . tests
3
4include $(top_srcdir)/Makefile.all.am
5
6#----------------------------------------------------------------------------
7# <tool>-<platform> stuff
8#----------------------------------------------------------------------------
9
10TOOL_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
13if VGCONF_HAVE_PLATFORM_SEC
14TOOL_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
17endif
18
19
20TOOL_LDADD_COMMON = -lgcc
21TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@ = \
22	$(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) $(TOOL_LDADD_COMMON)
23if VGCONF_HAVE_PLATFORM_SEC
24TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@ = \
25	$(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) $(TOOL_LDADD_COMMON)
26endif
27
28
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.
35TOOL_LDFLAGS_COMMON_LINUX = \
36	-static -nodefaultlibs -nostartfiles -u _start @FLAG_NO_BUILD_ID@
37TOOL_LDFLAGS_COMMON_DARWIN = \
38	-nodefaultlibs -nostartfiles -Wl,-u,__start -Wl,-e,__start
39
40TOOL_LDFLAGS_X86_LINUX = \
41	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
42
43TOOL_LDFLAGS_AMD64_LINUX = \
44	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
45
46TOOL_LDFLAGS_PPC32_LINUX = \
47	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
48
49TOOL_LDFLAGS_PPC64BE_LINUX = \
50	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
51
52TOOL_LDFLAGS_PPC64LE_LINUX = \
53	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
54
55TOOL_LDFLAGS_ARM_LINUX = \
56	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
57
58TOOL_LDFLAGS_ARM64_LINUX = \
59	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
60
61TOOL_LDFLAGS_S390X_LINUX = \
62	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
63
64TOOL_LDFLAGS_X86_DARWIN = \
65	$(TOOL_LDFLAGS_COMMON_DARWIN) -arch i386
66
67TOOL_LDFLAGS_AMD64_DARWIN = \
68	$(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64
69
70# MIPS Linux default start symbol is __start, not _start like on x86 or amd
71TOOL_LDFLAGS_MIPS32_LINUX = \
72	-static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
73	@FLAG_M32@
74
75TOOL_LDFLAGS_MIPS64_LINUX = \
76	-static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
77	@FLAG_M64@
78
79TOOL_LDFLAGS_TILEGX_LINUX = \
80	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
81
82# On Android we must ask for non-executable stack, not sure why.
83if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
84if VGCONF_PLATVARIANT_IS_ANDROID
85TOOL_LDFLAGS_ARM_LINUX += -Wl,-z,noexecstack
86endif
87endif
88
89# NB for 64-bit darwin.  We may want to set -Wl,-pagezero_size to
90# something smaller than the default of 4G, so as to facilitate
91# loading clients who are also linked thusly (currently m_ume.c
92# will fail to load them).  Although such setting is probably
93# better done in link_tool_exe.c.
94#
95#	-Wl,-pagezero_size,0x100000000
96
97
98#----------------------------------------------------------------------------
99# vgpreload_<tool>-<platform>.a stuff
100#----------------------------------------------------------------------------
101
102LIBREPLACEMALLOC_X86_LINUX = \
103	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-linux.a
104
105LIBREPLACEMALLOC_AMD64_LINUX = \
106	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-linux.a
107
108LIBREPLACEMALLOC_PPC32_LINUX = \
109	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-linux.a
110
111LIBREPLACEMALLOC_PPC64BE_LINUX = \
112	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64be-linux.a
113
114LIBREPLACEMALLOC_PPC64LE_LINUX = \
115	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64le-linux.a
116
117LIBREPLACEMALLOC_ARM_LINUX = \
118	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm-linux.a
119
120LIBREPLACEMALLOC_ARM64_LINUX = \
121	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm64-linux.a
122
123LIBREPLACEMALLOC_X86_DARWIN = \
124	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a
125
126LIBREPLACEMALLOC_AMD64_DARWIN = \
127	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-darwin.a
128
129LIBREPLACEMALLOC_S390X_LINUX = \
130	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-s390x-linux.a
131
132LIBREPLACEMALLOC_MIPS32_LINUX = \
133	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips32-linux.a
134
135LIBREPLACEMALLOC_MIPS64_LINUX = \
136	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips64-linux.a
137
138LIBREPLACEMALLOC_TILEGX_LINUX = \
139	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-tilegx-linux.a
140
141LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \
142	-Wl,--whole-archive \
143	$(LIBREPLACEMALLOC_X86_LINUX) \
144	-Wl,--no-whole-archive
145
146LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX = \
147	-Wl,--whole-archive \
148	$(LIBREPLACEMALLOC_AMD64_LINUX) \
149	-Wl,--no-whole-archive
150
151LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX = \
152	-Wl,--whole-archive \
153	$(LIBREPLACEMALLOC_PPC32_LINUX) \
154	-Wl,--no-whole-archive
155
156LIBREPLACEMALLOC_LDFLAGS_PPC64BE_LINUX = \
157	-Wl,--whole-archive \
158	$(LIBREPLACEMALLOC_PPC64BE_LINUX) \
159	-Wl,--no-whole-archive
160
161LIBREPLACEMALLOC_LDFLAGS_PPC64LE_LINUX = \
162	-Wl,--whole-archive \
163	$(LIBREPLACEMALLOC_PPC64LE_LINUX) \
164	-Wl,--no-whole-archive
165
166LIBREPLACEMALLOC_LDFLAGS_ARM_LINUX = \
167	-Wl,--whole-archive \
168	$(LIBREPLACEMALLOC_ARM_LINUX) \
169	-Wl,--no-whole-archive
170
171LIBREPLACEMALLOC_LDFLAGS_ARM64_LINUX = \
172	-Wl,--whole-archive \
173	$(LIBREPLACEMALLOC_ARM64_LINUX) \
174	-Wl,--no-whole-archive
175
176LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN = \
177	$(LIBREPLACEMALLOC_X86_DARWIN)
178
179LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN = \
180	$(LIBREPLACEMALLOC_AMD64_DARWIN)
181
182LIBREPLACEMALLOC_LDFLAGS_S390X_LINUX = \
183	-Wl,--whole-archive \
184	$(LIBREPLACEMALLOC_S390X_LINUX) \
185	-Wl,--no-whole-archive
186
187LIBREPLACEMALLOC_LDFLAGS_MIPS32_LINUX = \
188	-Wl,--whole-archive \
189	$(LIBREPLACEMALLOC_MIPS32_LINUX) \
190	-Wl,--no-whole-archive
191
192LIBREPLACEMALLOC_LDFLAGS_MIPS64_LINUX = \
193	-Wl,--whole-archive \
194	$(LIBREPLACEMALLOC_MIPS64_LINUX) \
195	-Wl,--no-whole-archive
196
197LIBREPLACEMALLOC_LDFLAGS_TILEGX_LINUX = \
198	-Wl,--whole-archive \
199	$(LIBREPLACEMALLOC_TILEGX_LINUX) \
200	-Wl,--no-whole-archive
201
202#----------------------------------------------------------------------------
203# General stuff
204#----------------------------------------------------------------------------
205
206all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
207
208clean-local: clean-noinst_DSYMS
209
210install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS
211
212uninstall-local: uninstall-noinst_PROGRAMS uninstall-noinst_DSYMS
213
214