• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 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.
33TOOL_LDFLAGS_COMMON_LINUX = \
34	-static -nodefaultlibs -nostartfiles -u _start @FLAG_NO_BUILD_ID@
35TOOL_LDFLAGS_COMMON_DARWIN = \
36	-nodefaultlibs -nostartfiles -Wl,-u,__start -Wl,-e,__start
37
38TOOL_LDFLAGS_X86_LINUX = \
39	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
40
41TOOL_LDFLAGS_AMD64_LINUX = \
42	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
43
44TOOL_LDFLAGS_PPC32_LINUX = \
45	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
46
47TOOL_LDFLAGS_PPC64_LINUX = \
48	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
49
50TOOL_LDFLAGS_ARM_LINUX = \
51	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
52
53TOOL_LDFLAGS_S390X_LINUX = \
54	$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
55
56TOOL_LDFLAGS_X86_DARWIN = \
57	$(TOOL_LDFLAGS_COMMON_DARWIN) -arch i386
58
59TOOL_LDFLAGS_AMD64_DARWIN = \
60	$(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64
61
62# NB for 64-bit darwin.  We may want to set -Wl,-pagezero_size to
63# something smaller than the default of 4G, so as to facilitate
64# loading clients who are also linked thusly (currently m_ume.c
65# will fail to load them).  Although such setting is probably
66# better done in link_tool_exe.c.
67#
68#	-Wl,-pagezero_size,0x100000000
69
70
71#----------------------------------------------------------------------------
72# vgpreload_<tool>-<platform>.a stuff
73#----------------------------------------------------------------------------
74
75LIBREPLACEMALLOC_X86_LINUX = \
76	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-linux.a
77
78LIBREPLACEMALLOC_AMD64_LINUX = \
79	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-linux.a
80
81LIBREPLACEMALLOC_PPC32_LINUX = \
82	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-linux.a
83
84LIBREPLACEMALLOC_PPC64_LINUX = \
85	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64-linux.a
86
87LIBREPLACEMALLOC_ARM_LINUX = \
88	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm-linux.a
89
90LIBREPLACEMALLOC_X86_DARWIN = \
91	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a
92
93LIBREPLACEMALLOC_AMD64_DARWIN = \
94	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-darwin.a
95
96LIBREPLACEMALLOC_S390X_LINUX = \
97	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-s390x-linux.a
98
99
100LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \
101	-Wl,--whole-archive \
102	$(LIBREPLACEMALLOC_X86_LINUX) \
103	-Wl,--no-whole-archive
104
105LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX = \
106	-Wl,--whole-archive \
107	$(LIBREPLACEMALLOC_AMD64_LINUX) \
108	-Wl,--no-whole-archive
109
110LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX = \
111	-Wl,--whole-archive \
112	$(LIBREPLACEMALLOC_PPC32_LINUX) \
113	-Wl,--no-whole-archive
114
115LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX = \
116	-Wl,--whole-archive \
117	$(LIBREPLACEMALLOC_PPC64_LINUX) \
118	-Wl,--no-whole-archive
119
120LIBREPLACEMALLOC_LDFLAGS_ARM_LINUX = \
121	-Wl,--whole-archive \
122	$(LIBREPLACEMALLOC_ARM_LINUX) \
123	-Wl,--no-whole-archive
124
125LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN = \
126	$(LIBREPLACEMALLOC_X86_DARWIN)
127
128LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN = \
129	$(LIBREPLACEMALLOC_AMD64_DARWIN)
130
131LIBREPLACEMALLOC_LDFLAGS_S390X_LINUX = \
132	-Wl,--whole-archive \
133	$(LIBREPLACEMALLOC_S390X_LINUX) \
134	-Wl,--no-whole-archive
135
136#----------------------------------------------------------------------------
137# General stuff
138#----------------------------------------------------------------------------
139
140all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
141
142clean-local: clean-noinst_DSYMS
143
144install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS
145
146