blob: 6ac08cfbaa09240a55ff27b574f710399fd44bf4 [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
bart699fbac2010-06-08 18:23:59 +000029# -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.
sewardj9e6428a2010-06-02 00:31:34 +000033TOOL_LDFLAGS_COMMON_LINUX = \
bart699fbac2010-06-08 18:23:59 +000034 -static -nodefaultlibs -nostartfiles -u _start @FLAG_NO_BUILD_ID@
sewardj9e6428a2010-06-02 00:31:34 +000035TOOL_LDFLAGS_COMMON_AIX5 = \
36 -static -Wl,-e_start_valgrind
37TOOL_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
njn8b68b642009-06-24 00:37:09 +000055TOOL_LDFLAGS_PPC32_AIX5 = \
56 $(TOOL_LDFLAGS_COMMON_AIX5) @FLAG_MAIX32@
57
58TOOL_LDFLAGS_PPC64_AIX5 = \
59 $(TOOL_LDFLAGS_COMMON_AIX5) @FLAG_MAIX64@ -Wl,-bbigtoc
60
61TOOL_LDFLAGS_X86_DARWIN = \
njnea2d6fd2010-07-01 00:20:20 +000062 $(TOOL_LDFLAGS_COMMON_DARWIN) -arch i386
njn8b68b642009-06-24 00:37:09 +000063
njn8b68b642009-06-24 00:37:09 +000064TOOL_LDFLAGS_AMD64_DARWIN = \
njnea2d6fd2010-07-01 00:20:20 +000065 $(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64
66
67# NB for 64-bit darwin. We may want to set -Wl,-pagezero_size to
68# something smaller than the default of 4G, so as to facilitate
69# loading clients who are also linked thusly (currently m_ume.c
70# will fail to load them). Although such setting is probably
71# better done in link_tool_exe.c.
72#
73# -Wl,-pagezero_size,0x100000000
njn8b68b642009-06-24 00:37:09 +000074
75
njn8b68b642009-06-24 00:37:09 +000076#----------------------------------------------------------------------------
77# vgpreload_<tool>-<platform>.a stuff
78#----------------------------------------------------------------------------
njnb7fda4c2009-02-06 04:05:43 +000079
tomfb7bcde2005-11-07 15:24:38 +000080LIBREPLACEMALLOC_X86_LINUX = \
sewardj4d3f7a42009-02-22 23:40:31 +000081 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-linux.a
sewardj45f4e7c2005-09-27 19:20:21 +000082
tomfb7bcde2005-11-07 15:24:38 +000083LIBREPLACEMALLOC_AMD64_LINUX = \
sewardj4d3f7a42009-02-22 23:40:31 +000084 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-linux.a
tomfb7bcde2005-11-07 15:24:38 +000085
86LIBREPLACEMALLOC_PPC32_LINUX = \
sewardj4d3f7a42009-02-22 23:40:31 +000087 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-linux.a
tomfb7bcde2005-11-07 15:24:38 +000088
sewardj2c48c7b2005-11-29 13:05:56 +000089LIBREPLACEMALLOC_PPC64_LINUX = \
sewardj4d3f7a42009-02-22 23:40:31 +000090 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64-linux.a
sewardj2c48c7b2005-11-29 13:05:56 +000091
sewardj59570ff2010-01-01 11:59:33 +000092LIBREPLACEMALLOC_ARM_LINUX = \
93 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm-linux.a
94
sewardj1eff82b2006-10-17 00:56:43 +000095LIBREPLACEMALLOC_PPC32_AIX5 = \
sewardj4d3f7a42009-02-22 23:40:31 +000096 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-aix5.a
sewardj1eff82b2006-10-17 00:56:43 +000097
98LIBREPLACEMALLOC_PPC64_AIX5 = \
sewardj4d3f7a42009-02-22 23:40:31 +000099 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64-aix5.a
sewardj1eff82b2006-10-17 00:56:43 +0000100
njnf76d27a2009-05-28 01:53:07 +0000101LIBREPLACEMALLOC_X86_DARWIN = \
102 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a
103
104LIBREPLACEMALLOC_AMD64_DARWIN = \
105 $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-darwin.a
106
njnb7fda4c2009-02-06 04:05:43 +0000107
tomfb7bcde2005-11-07 15:24:38 +0000108LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \
109 -Wl,--whole-archive \
110 $(LIBREPLACEMALLOC_X86_LINUX) \
111 -Wl,--no-whole-archive
njnb7fda4c2009-02-06 04:05:43 +0000112
tomfb7bcde2005-11-07 15:24:38 +0000113LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX = \
114 -Wl,--whole-archive \
115 $(LIBREPLACEMALLOC_AMD64_LINUX) \
116 -Wl,--no-whole-archive
njnb7fda4c2009-02-06 04:05:43 +0000117
tomfb7bcde2005-11-07 15:24:38 +0000118LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX = \
119 -Wl,--whole-archive \
120 $(LIBREPLACEMALLOC_PPC32_LINUX) \
121 -Wl,--no-whole-archive
njnb7fda4c2009-02-06 04:05:43 +0000122
sewardj2c48c7b2005-11-29 13:05:56 +0000123LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX = \
124 -Wl,--whole-archive \
125 $(LIBREPLACEMALLOC_PPC64_LINUX) \
126 -Wl,--no-whole-archive
njnb7fda4c2009-02-06 04:05:43 +0000127
sewardj59570ff2010-01-01 11:59:33 +0000128LIBREPLACEMALLOC_LDFLAGS_ARM_LINUX = \
129 -Wl,--whole-archive \
130 $(LIBREPLACEMALLOC_ARM_LINUX) \
131 -Wl,--no-whole-archive
132
sewardj1eff82b2006-10-17 00:56:43 +0000133LIBREPLACEMALLOC_LDFLAGS_PPC32_AIX5 = \
134 $(LIBREPLACEMALLOC_PPC32_AIX5)
njnb7fda4c2009-02-06 04:05:43 +0000135
sewardj1eff82b2006-10-17 00:56:43 +0000136LIBREPLACEMALLOC_LDFLAGS_PPC64_AIX5 = \
137 $(LIBREPLACEMALLOC_PPC64_AIX5)
njn3e653402009-02-06 07:12:57 +0000138
njnf76d27a2009-05-28 01:53:07 +0000139LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN = \
140 $(LIBREPLACEMALLOC_X86_DARWIN)
njn3e653402009-02-06 07:12:57 +0000141
njnf76d27a2009-05-28 01:53:07 +0000142LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN = \
143 $(LIBREPLACEMALLOC_AMD64_DARWIN)
njnac31b052009-02-12 00:30:02 +0000144
njn8b68b642009-06-24 00:37:09 +0000145#----------------------------------------------------------------------------
146# General stuff
147#----------------------------------------------------------------------------
njnf76d27a2009-05-28 01:53:07 +0000148
149all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
150
151clean-local: clean-noinst_DSYMS
152
153install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS
njnac31b052009-02-12 00:30:02 +0000154