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
20 TOOL_LDADD_COMMON = -lgcc
21 TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@ = \
22 $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) $(TOOL_LDADD_COMMON)
23 if VGCONF_HAVE_PLATFORM_SEC
24 TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@ = \
25 $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) $(TOOL_LDADD_COMMON)
29 # -Wl,--build-id=none is needed when linking tools on Linux. Without this
30 # flag newer ld versions (2.20 and later) create a .note.gnu.build-id at the
31 # default text segment address, which of course means the resulting executable
32 # is unusable. So we have to tell ld not to generate that, with --build-id=none.
33 TOOL_LDFLAGS_COMMON_LINUX = \
34 -static -nodefaultlibs -nostartfiles -u _start @FLAG_NO_BUILD_ID@
35 TOOL_LDFLAGS_COMMON_DARWIN = \
36 -nodefaultlibs -nostartfiles -Wl,-u,__start -Wl,-e,__start
38 TOOL_LDFLAGS_X86_LINUX = \
39 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
41 TOOL_LDFLAGS_AMD64_LINUX = \
42 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
44 TOOL_LDFLAGS_PPC32_LINUX = \
45 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
47 TOOL_LDFLAGS_PPC64_LINUX = \
48 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
50 TOOL_LDFLAGS_ARM_LINUX = \
51 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
53 TOOL_LDFLAGS_S390X_LINUX = \
54 $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
56 TOOL_LDFLAGS_X86_DARWIN = \
57 $(TOOL_LDFLAGS_COMMON_DARWIN) -arch i386
59 TOOL_LDFLAGS_AMD64_DARWIN = \
60 $(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64
62 # MIPS Linux default start symbol is __start, not _start like on x86 or amd
63 TOOL_LDFLAGS_MIPS32_LINUX = \
64 -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
67 # On Android we must ask for non-executable stack, not sure why.
68 if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
69 if VGCONF_PLATVARIANT_IS_ANDROID
70 TOOL_LDFLAGS_ARM_LINUX += -Wl,-z,noexecstack
74 # NB for 64-bit darwin. We may want to set -Wl,-pagezero_size to
75 # something smaller than the default of 4G, so as to facilitate
76 # loading clients who are also linked thusly (currently m_ume.c
77 # will fail to load them). Although such setting is probably
78 # better done in link_tool_exe.c.
80 # -Wl,-pagezero_size,0x100000000
83 #----------------------------------------------------------------------------
84 # vgpreload_<tool>-<platform>.a stuff
85 #----------------------------------------------------------------------------
87 LIBREPLACEMALLOC_X86_LINUX = \
88 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-linux.a
90 LIBREPLACEMALLOC_AMD64_LINUX = \
91 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-linux.a
93 LIBREPLACEMALLOC_PPC32_LINUX = \
94 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-linux.a
96 LIBREPLACEMALLOC_PPC64_LINUX = \
97 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64-linux.a
99 LIBREPLACEMALLOC_ARM_LINUX = \
100 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm-linux.a
102 LIBREPLACEMALLOC_X86_DARWIN = \
103 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a
105 LIBREPLACEMALLOC_AMD64_DARWIN = \
106 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-darwin.a
108 LIBREPLACEMALLOC_S390X_LINUX = \
109 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-s390x-linux.a
111 LIBREPLACEMALLOC_MIPS32_LINUX = \
112 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips32-linux.a
114 LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \
115 -Wl,--whole-archive \
116 $(LIBREPLACEMALLOC_X86_LINUX) \
117 -Wl,--no-whole-archive
119 LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX = \
120 -Wl,--whole-archive \
121 $(LIBREPLACEMALLOC_AMD64_LINUX) \
122 -Wl,--no-whole-archive
124 LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX = \
125 -Wl,--whole-archive \
126 $(LIBREPLACEMALLOC_PPC32_LINUX) \
127 -Wl,--no-whole-archive
129 LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX = \
130 -Wl,--whole-archive \
131 $(LIBREPLACEMALLOC_PPC64_LINUX) \
132 -Wl,--no-whole-archive
134 LIBREPLACEMALLOC_LDFLAGS_ARM_LINUX = \
135 -Wl,--whole-archive \
136 $(LIBREPLACEMALLOC_ARM_LINUX) \
137 -Wl,--no-whole-archive
139 LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN = \
140 $(LIBREPLACEMALLOC_X86_DARWIN)
142 LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN = \
143 $(LIBREPLACEMALLOC_AMD64_DARWIN)
145 LIBREPLACEMALLOC_LDFLAGS_S390X_LINUX = \
146 -Wl,--whole-archive \
147 $(LIBREPLACEMALLOC_S390X_LINUX) \
148 -Wl,--no-whole-archive
150 LIBREPLACEMALLOC_LDFLAGS_MIPS32_LINUX = \
151 -Wl,--whole-archive \
152 $(LIBREPLACEMALLOC_MIPS32_LINUX) \
153 -Wl,--no-whole-archive
155 #----------------------------------------------------------------------------
157 #----------------------------------------------------------------------------
159 all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
161 clean-local: clean-noinst_DSYMS
163 install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS