blob: 8e0a0ad62cb0394e100d94d7a47065088cd289ce [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
49TOOL_LDFLAGS_PPC64_LINUX = \
sewardj9e6428a2010-06-02 00:31:34 +000050 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
njn8b68b642009-06-24 00:37:09 +000051
sewardj59570ff2010-01-01 11:59:33 +000052TOOL_LDFLAGS_ARM_LINUX = \
sewardj9e6428a2010-06-02 00:31:34 +000053 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
sewardj59570ff2010-01-01 11:59:33 +000054
sewardjb5b87402011-03-07 16:05:35 +000055TOOL_LDFLAGS_S390X_LINUX = \
56 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
57
njn8b68b642009-06-24 00:37:09 +000058TOOL_LDFLAGS_X86_DARWIN = \
njnea2d6fd2010-07-01 00:20:20 +000059 $(TOOL_LDFLAGS_COMMON_DARWIN) -arch i386
njn8b68b642009-06-24 00:37:09 +000060
njn8b68b642009-06-24 00:37:09 +000061TOOL_LDFLAGS_AMD64_DARWIN = \
njnea2d6fd2010-07-01 00:20:20 +000062 $(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64
63
sewardj5db15402012-06-07 09:13:21 +000064# MIPS Linux default start symbol is __start, not _start like on x86 or amd
65TOOL_LDFLAGS_MIPS32_LINUX = \
tom04ce9f52013-03-28 15:53:21 +000066 -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
67 @FLAG_M32@
sewardj5db15402012-06-07 09:13:21 +000068
petarj4df0bfc2013-02-27 23:17:33 +000069TOOL_LDFLAGS_MIPS64_LINUX = \
tom04ce9f52013-03-28 15:53:21 +000070 -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
71 @FLAG_M64@
petarj4df0bfc2013-02-27 23:17:33 +000072
sewardj1b3a7a42011-10-26 15:10:49 +000073# On Android we must ask for non-executable stack, not sure why.
74if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
75if VGCONF_PLATVARIANT_IS_ANDROID
76TOOL_LDFLAGS_ARM_LINUX += -Wl,-z,noexecstack
77endif
78endif
79
njnea2d6fd2010-07-01 00:20:20 +000080# NB for 64-bit darwin. We may want to set -Wl,-pagezero_size to
81# something smaller than the default of 4G, so as to facilitate
82# loading clients who are also linked thusly (currently m_ume.c
83# will fail to load them). Although such setting is probably
84# better done in link_tool_exe.c.
85#
86# -Wl,-pagezero_size,0x100000000
njn8b68b642009-06-24 00:37:09 +000087
88
njn8b68b642009-06-24 00:37:09 +000089#----------------------------------------------------------------------------
90# vgpreload_<tool>-<platform>.a stuff
91#----------------------------------------------------------------------------
njnb7fda4c2009-02-06 04:05:43 +000092
tomfb7bcde2005-11-07 15:24:38 +000093LIBREPLACEMALLOC_X86_LINUX = \
sewardj4d3f7a42009-02-22 23:40:31 +000094 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-linux.a
sewardj45f4e7c2005-09-27 19:20:21 +000095
tomfb7bcde2005-11-07 15:24:38 +000096LIBREPLACEMALLOC_AMD64_LINUX = \
sewardj4d3f7a42009-02-22 23:40:31 +000097 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-linux.a
tomfb7bcde2005-11-07 15:24:38 +000098
99LIBREPLACEMALLOC_PPC32_LINUX = \
sewardj4d3f7a42009-02-22 23:40:31 +0000100 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-linux.a
tomfb7bcde2005-11-07 15:24:38 +0000101
sewardj2c48c7b2005-11-29 13:05:56 +0000102LIBREPLACEMALLOC_PPC64_LINUX = \
sewardj4d3f7a42009-02-22 23:40:31 +0000103 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64-linux.a
sewardj2c48c7b2005-11-29 13:05:56 +0000104
sewardj59570ff2010-01-01 11:59:33 +0000105LIBREPLACEMALLOC_ARM_LINUX = \
106 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm-linux.a
107
njnf76d27a2009-05-28 01:53:07 +0000108LIBREPLACEMALLOC_X86_DARWIN = \
109 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a
110
111LIBREPLACEMALLOC_AMD64_DARWIN = \
112 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-darwin.a
113
sewardjb5b87402011-03-07 16:05:35 +0000114LIBREPLACEMALLOC_S390X_LINUX = \
115 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-s390x-linux.a
116
sewardj5db15402012-06-07 09:13:21 +0000117LIBREPLACEMALLOC_MIPS32_LINUX = \
118 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips32-linux.a
njnb7fda4c2009-02-06 04:05:43 +0000119
petarj4df0bfc2013-02-27 23:17:33 +0000120LIBREPLACEMALLOC_MIPS64_LINUX = \
121 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips64-linux.a
122
tomfb7bcde2005-11-07 15:24:38 +0000123LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \
124 -Wl,--whole-archive \
125 $(LIBREPLACEMALLOC_X86_LINUX) \
126 -Wl,--no-whole-archive
njnb7fda4c2009-02-06 04:05:43 +0000127
tomfb7bcde2005-11-07 15:24:38 +0000128LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX = \
129 -Wl,--whole-archive \
130 $(LIBREPLACEMALLOC_AMD64_LINUX) \
131 -Wl,--no-whole-archive
njnb7fda4c2009-02-06 04:05:43 +0000132
tomfb7bcde2005-11-07 15:24:38 +0000133LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX = \
134 -Wl,--whole-archive \
135 $(LIBREPLACEMALLOC_PPC32_LINUX) \
136 -Wl,--no-whole-archive
njnb7fda4c2009-02-06 04:05:43 +0000137
sewardj2c48c7b2005-11-29 13:05:56 +0000138LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX = \
139 -Wl,--whole-archive \
140 $(LIBREPLACEMALLOC_PPC64_LINUX) \
141 -Wl,--no-whole-archive
njnb7fda4c2009-02-06 04:05:43 +0000142
sewardj59570ff2010-01-01 11:59:33 +0000143LIBREPLACEMALLOC_LDFLAGS_ARM_LINUX = \
144 -Wl,--whole-archive \
145 $(LIBREPLACEMALLOC_ARM_LINUX) \
146 -Wl,--no-whole-archive
147
njnf76d27a2009-05-28 01:53:07 +0000148LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN = \
149 $(LIBREPLACEMALLOC_X86_DARWIN)
njn3e653402009-02-06 07:12:57 +0000150
njnf76d27a2009-05-28 01:53:07 +0000151LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN = \
152 $(LIBREPLACEMALLOC_AMD64_DARWIN)
njnac31b052009-02-12 00:30:02 +0000153
sewardjb5b87402011-03-07 16:05:35 +0000154LIBREPLACEMALLOC_LDFLAGS_S390X_LINUX = \
155 -Wl,--whole-archive \
156 $(LIBREPLACEMALLOC_S390X_LINUX) \
157 -Wl,--no-whole-archive
158
sewardj5db15402012-06-07 09:13:21 +0000159LIBREPLACEMALLOC_LDFLAGS_MIPS32_LINUX = \
160 -Wl,--whole-archive \
161 $(LIBREPLACEMALLOC_MIPS32_LINUX) \
162 -Wl,--no-whole-archive
163
petarj4df0bfc2013-02-27 23:17:33 +0000164LIBREPLACEMALLOC_LDFLAGS_MIPS64_LINUX = \
165 -Wl,--whole-archive \
166 $(LIBREPLACEMALLOC_MIPS64_LINUX) \
167 -Wl,--no-whole-archive
168
njn8b68b642009-06-24 00:37:09 +0000169#----------------------------------------------------------------------------
170# General stuff
171#----------------------------------------------------------------------------
njnf76d27a2009-05-28 01:53:07 +0000172
173all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
174
175clean-local: clean-noinst_DSYMS
176
177install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS
njnac31b052009-02-12 00:30:02 +0000178