blob: 458d5ee9854cf53a0468d2cda59a96b56416c84a [file] [log] [blame]
nethercote4388a402004-09-01 23:20:49 +00001
njn7375de32009-08-05 08:08:18 +00002SUBDIRS = . tests
nethercote4388a402004-09-01 23:20:49 +00003
nethercoteb35a8b92004-09-11 16:45:27 +00004include $(top_srcdir)/Makefile.all.am
njn717cde52005-05-10 02:47:21 +00005
njn8b68b642009-06-24 00:37:09 +00006#----------------------------------------------------------------------------
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
tom04ce9f52013-03-28 15:53:21 +000029# -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.
sewardj9e6428a2010-06-02 00:31:34 +000035TOOL_LDFLAGS_COMMON_LINUX = \
tom04ce9f52013-03-28 15:53:21 +000036 -static -nodefaultlibs -nostartfiles -u _start @FLAG_NO_BUILD_ID@
sewardj9e6428a2010-06-02 00:31:34 +000037TOOL_LDFLAGS_COMMON_DARWIN = \
njnea2d6fd2010-07-01 00:20:20 +000038 -nodefaultlibs -nostartfiles -Wl,-u,__start -Wl,-e,__start
njn8b68b642009-06-24 00:37:09 +000039
40TOOL_LDFLAGS_X86_LINUX = \
sewardj9e6428a2010-06-02 00:31:34 +000041 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
njn8b68b642009-06-24 00:37:09 +000042
43TOOL_LDFLAGS_AMD64_LINUX = \
sewardj9e6428a2010-06-02 00:31:34 +000044 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
njn8b68b642009-06-24 00:37:09 +000045
46TOOL_LDFLAGS_PPC32_LINUX = \
sewardj9e6428a2010-06-02 00:31:34 +000047 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
njn8b68b642009-06-24 00:37:09 +000048
carllcae0cc22014-08-07 23:17:29 +000049TOOL_LDFLAGS_PPC64BE_LINUX = \
50 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
51
52TOOL_LDFLAGS_PPC64LE_LINUX = \
sewardj9e6428a2010-06-02 00:31:34 +000053 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
njn8b68b642009-06-24 00:37:09 +000054
sewardj59570ff2010-01-01 11:59:33 +000055TOOL_LDFLAGS_ARM_LINUX = \
sewardj9e6428a2010-06-02 00:31:34 +000056 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
sewardj59570ff2010-01-01 11:59:33 +000057
sewardjf0c12502014-01-12 12:54:00 +000058TOOL_LDFLAGS_ARM64_LINUX = \
59 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
60
sewardjb5b87402011-03-07 16:05:35 +000061TOOL_LDFLAGS_S390X_LINUX = \
62 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
63
njn8b68b642009-06-24 00:37:09 +000064TOOL_LDFLAGS_X86_DARWIN = \
njnea2d6fd2010-07-01 00:20:20 +000065 $(TOOL_LDFLAGS_COMMON_DARWIN) -arch i386
njn8b68b642009-06-24 00:37:09 +000066
njn8b68b642009-06-24 00:37:09 +000067TOOL_LDFLAGS_AMD64_DARWIN = \
njnea2d6fd2010-07-01 00:20:20 +000068 $(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64
69
sewardj5db15402012-06-07 09:13:21 +000070# MIPS Linux default start symbol is __start, not _start like on x86 or amd
71TOOL_LDFLAGS_MIPS32_LINUX = \
tom04ce9f52013-03-28 15:53:21 +000072 -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
73 @FLAG_M32@
sewardj5db15402012-06-07 09:13:21 +000074
petarj4df0bfc2013-02-27 23:17:33 +000075TOOL_LDFLAGS_MIPS64_LINUX = \
tom04ce9f52013-03-28 15:53:21 +000076 -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
77 @FLAG_M64@
petarj4df0bfc2013-02-27 23:17:33 +000078
sewardj1b3a7a42011-10-26 15:10:49 +000079# On Android we must ask for non-executable stack, not sure why.
80if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
81if VGCONF_PLATVARIANT_IS_ANDROID
82TOOL_LDFLAGS_ARM_LINUX += -Wl,-z,noexecstack
83endif
84endif
85
njnea2d6fd2010-07-01 00:20:20 +000086# NB for 64-bit darwin. We may want to set -Wl,-pagezero_size to
87# something smaller than the default of 4G, so as to facilitate
88# loading clients who are also linked thusly (currently m_ume.c
89# will fail to load them). Although such setting is probably
90# better done in link_tool_exe.c.
91#
92# -Wl,-pagezero_size,0x100000000
njn8b68b642009-06-24 00:37:09 +000093
94
njn8b68b642009-06-24 00:37:09 +000095#----------------------------------------------------------------------------
96# vgpreload_<tool>-<platform>.a stuff
97#----------------------------------------------------------------------------
njnb7fda4c2009-02-06 04:05:43 +000098
tomfb7bcde2005-11-07 15:24:38 +000099LIBREPLACEMALLOC_X86_LINUX = \
sewardj4d3f7a42009-02-22 23:40:31 +0000100 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-linux.a
sewardj45f4e7c2005-09-27 19:20:21 +0000101
tomfb7bcde2005-11-07 15:24:38 +0000102LIBREPLACEMALLOC_AMD64_LINUX = \
sewardj4d3f7a42009-02-22 23:40:31 +0000103 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-linux.a
tomfb7bcde2005-11-07 15:24:38 +0000104
105LIBREPLACEMALLOC_PPC32_LINUX = \
sewardj4d3f7a42009-02-22 23:40:31 +0000106 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-linux.a
tomfb7bcde2005-11-07 15:24:38 +0000107
carllcae0cc22014-08-07 23:17:29 +0000108LIBREPLACEMALLOC_PPC64BE_LINUX = \
109 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64be-linux.a
110
111LIBREPLACEMALLOC_PPC64LE_LINUX = \
112 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64le-linux.a
sewardj2c48c7b2005-11-29 13:05:56 +0000113
sewardj59570ff2010-01-01 11:59:33 +0000114LIBREPLACEMALLOC_ARM_LINUX = \
115 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm-linux.a
116
sewardjf0c12502014-01-12 12:54:00 +0000117LIBREPLACEMALLOC_ARM64_LINUX = \
118 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm64-linux.a
119
njnf76d27a2009-05-28 01:53:07 +0000120LIBREPLACEMALLOC_X86_DARWIN = \
121 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a
122
123LIBREPLACEMALLOC_AMD64_DARWIN = \
124 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-darwin.a
125
sewardjb5b87402011-03-07 16:05:35 +0000126LIBREPLACEMALLOC_S390X_LINUX = \
127 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-s390x-linux.a
128
sewardj5db15402012-06-07 09:13:21 +0000129LIBREPLACEMALLOC_MIPS32_LINUX = \
130 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips32-linux.a
njnb7fda4c2009-02-06 04:05:43 +0000131
petarj4df0bfc2013-02-27 23:17:33 +0000132LIBREPLACEMALLOC_MIPS64_LINUX = \
133 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips64-linux.a
134
tomfb7bcde2005-11-07 15:24:38 +0000135LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \
136 -Wl,--whole-archive \
137 $(LIBREPLACEMALLOC_X86_LINUX) \
138 -Wl,--no-whole-archive
njnb7fda4c2009-02-06 04:05:43 +0000139
tomfb7bcde2005-11-07 15:24:38 +0000140LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX = \
141 -Wl,--whole-archive \
142 $(LIBREPLACEMALLOC_AMD64_LINUX) \
143 -Wl,--no-whole-archive
njnb7fda4c2009-02-06 04:05:43 +0000144
tomfb7bcde2005-11-07 15:24:38 +0000145LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX = \
146 -Wl,--whole-archive \
147 $(LIBREPLACEMALLOC_PPC32_LINUX) \
148 -Wl,--no-whole-archive
njnb7fda4c2009-02-06 04:05:43 +0000149
carllcae0cc22014-08-07 23:17:29 +0000150LIBREPLACEMALLOC_LDFLAGS_PPC64BE_LINUX = \
sewardj2c48c7b2005-11-29 13:05:56 +0000151 -Wl,--whole-archive \
carllcae0cc22014-08-07 23:17:29 +0000152 $(LIBREPLACEMALLOC_PPC64BE_LINUX) \
153 -Wl,--no-whole-archive
154
155LIBREPLACEMALLOC_LDFLAGS_PPC64LE_LINUX = \
156 -Wl,--whole-archive \
157 $(LIBREPLACEMALLOC_PPC64LE_LINUX) \
sewardj2c48c7b2005-11-29 13:05:56 +0000158 -Wl,--no-whole-archive
njnb7fda4c2009-02-06 04:05:43 +0000159
sewardj59570ff2010-01-01 11:59:33 +0000160LIBREPLACEMALLOC_LDFLAGS_ARM_LINUX = \
161 -Wl,--whole-archive \
162 $(LIBREPLACEMALLOC_ARM_LINUX) \
163 -Wl,--no-whole-archive
164
sewardjf0c12502014-01-12 12:54:00 +0000165LIBREPLACEMALLOC_LDFLAGS_ARM64_LINUX = \
166 -Wl,--whole-archive \
167 $(LIBREPLACEMALLOC_ARM64_LINUX) \
168 -Wl,--no-whole-archive
169
njnf76d27a2009-05-28 01:53:07 +0000170LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN = \
171 $(LIBREPLACEMALLOC_X86_DARWIN)
njn3e653402009-02-06 07:12:57 +0000172
njnf76d27a2009-05-28 01:53:07 +0000173LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN = \
174 $(LIBREPLACEMALLOC_AMD64_DARWIN)
njnac31b052009-02-12 00:30:02 +0000175
sewardjb5b87402011-03-07 16:05:35 +0000176LIBREPLACEMALLOC_LDFLAGS_S390X_LINUX = \
177 -Wl,--whole-archive \
178 $(LIBREPLACEMALLOC_S390X_LINUX) \
179 -Wl,--no-whole-archive
180
sewardj5db15402012-06-07 09:13:21 +0000181LIBREPLACEMALLOC_LDFLAGS_MIPS32_LINUX = \
182 -Wl,--whole-archive \
183 $(LIBREPLACEMALLOC_MIPS32_LINUX) \
184 -Wl,--no-whole-archive
185
petarj4df0bfc2013-02-27 23:17:33 +0000186LIBREPLACEMALLOC_LDFLAGS_MIPS64_LINUX = \
187 -Wl,--whole-archive \
188 $(LIBREPLACEMALLOC_MIPS64_LINUX) \
189 -Wl,--no-whole-archive
190
njn8b68b642009-06-24 00:37:09 +0000191#----------------------------------------------------------------------------
192# General stuff
193#----------------------------------------------------------------------------
njnf76d27a2009-05-28 01:53:07 +0000194
195all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
196
197clean-local: clean-noinst_DSYMS
198
199install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS
njnac31b052009-02-12 00:30:02 +0000200
mjwfbde9cf2014-05-09 14:25:39 +0000201uninstall-local: uninstall-noinst_PROGRAMS uninstall-noinst_DSYMS
202