nethercote | 4388a40 | 2004-09-01 23:20:49 +0000 | [diff] [blame] | 1 | |
njn | 7375de3 | 2009-08-05 08:08:18 +0000 | [diff] [blame] | 2 | SUBDIRS = . tests |
nethercote | 4388a40 | 2004-09-01 23:20:49 +0000 | [diff] [blame] | 3 | |
nethercote | b35a8b9 | 2004-09-11 16:45:27 +0000 | [diff] [blame] | 4 | include $(top_srcdir)/Makefile.all.am |
njn | 717cde5 | 2005-05-10 02:47:21 +0000 | [diff] [blame] | 5 | |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 6 | #---------------------------------------------------------------------------- |
| 7 | # <tool>-<platform> stuff |
| 8 | #---------------------------------------------------------------------------- |
| 9 | |
| 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 |
| 17 | endif |
| 18 | |
| 19 | |
| 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) |
| 26 | endif |
| 27 | |
| 28 | |
tom | 04ce9f5 | 2013-03-28 15:53:21 +0000 | [diff] [blame] | 29 | # -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. |
sewardj | 9e6428a | 2010-06-02 00:31:34 +0000 | [diff] [blame] | 35 | TOOL_LDFLAGS_COMMON_LINUX = \ |
tom | 04ce9f5 | 2013-03-28 15:53:21 +0000 | [diff] [blame] | 36 | -static -nodefaultlibs -nostartfiles -u _start @FLAG_NO_BUILD_ID@ |
sewardj | 9e6428a | 2010-06-02 00:31:34 +0000 | [diff] [blame] | 37 | TOOL_LDFLAGS_COMMON_DARWIN = \ |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 38 | -nodefaultlibs -nostartfiles -Wl,-u,__start -Wl,-e,__start |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 39 | |
| 40 | TOOL_LDFLAGS_X86_LINUX = \ |
sewardj | 9e6428a | 2010-06-02 00:31:34 +0000 | [diff] [blame] | 41 | $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 42 | |
| 43 | TOOL_LDFLAGS_AMD64_LINUX = \ |
sewardj | 9e6428a | 2010-06-02 00:31:34 +0000 | [diff] [blame] | 44 | $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 45 | |
| 46 | TOOL_LDFLAGS_PPC32_LINUX = \ |
sewardj | 9e6428a | 2010-06-02 00:31:34 +0000 | [diff] [blame] | 47 | $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 48 | |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 49 | TOOL_LDFLAGS_PPC64BE_LINUX = \ |
| 50 | $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ |
| 51 | |
| 52 | TOOL_LDFLAGS_PPC64LE_LINUX = \ |
sewardj | 9e6428a | 2010-06-02 00:31:34 +0000 | [diff] [blame] | 53 | $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 54 | |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 55 | TOOL_LDFLAGS_ARM_LINUX = \ |
sewardj | 9e6428a | 2010-06-02 00:31:34 +0000 | [diff] [blame] | 56 | $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 57 | |
sewardj | f0c1250 | 2014-01-12 12:54:00 +0000 | [diff] [blame] | 58 | TOOL_LDFLAGS_ARM64_LINUX = \ |
| 59 | $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ |
| 60 | |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 61 | TOOL_LDFLAGS_S390X_LINUX = \ |
| 62 | $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ |
| 63 | |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 64 | TOOL_LDFLAGS_X86_DARWIN = \ |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 65 | $(TOOL_LDFLAGS_COMMON_DARWIN) -arch i386 |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 66 | |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 67 | TOOL_LDFLAGS_AMD64_DARWIN = \ |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 68 | $(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64 |
| 69 | |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 70 | # MIPS Linux default start symbol is __start, not _start like on x86 or amd |
| 71 | TOOL_LDFLAGS_MIPS32_LINUX = \ |
tom | 04ce9f5 | 2013-03-28 15:53:21 +0000 | [diff] [blame] | 72 | -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \ |
| 73 | @FLAG_M32@ |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 74 | |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 75 | TOOL_LDFLAGS_MIPS64_LINUX = \ |
tom | 04ce9f5 | 2013-03-28 15:53:21 +0000 | [diff] [blame] | 76 | -static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \ |
| 77 | @FLAG_M64@ |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 78 | |
sewardj | 1b3a7a4 | 2011-10-26 15:10:49 +0000 | [diff] [blame] | 79 | # On Android we must ask for non-executable stack, not sure why. |
| 80 | if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX |
| 81 | if VGCONF_PLATVARIANT_IS_ANDROID |
| 82 | TOOL_LDFLAGS_ARM_LINUX += -Wl,-z,noexecstack |
| 83 | endif |
| 84 | endif |
| 85 | |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 86 | # 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 |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 93 | |
| 94 | |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 95 | #---------------------------------------------------------------------------- |
| 96 | # vgpreload_<tool>-<platform>.a stuff |
| 97 | #---------------------------------------------------------------------------- |
njn | b7fda4c | 2009-02-06 04:05:43 +0000 | [diff] [blame] | 98 | |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 99 | LIBREPLACEMALLOC_X86_LINUX = \ |
sewardj | 4d3f7a4 | 2009-02-22 23:40:31 +0000 | [diff] [blame] | 100 | $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-linux.a |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 101 | |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 102 | LIBREPLACEMALLOC_AMD64_LINUX = \ |
sewardj | 4d3f7a4 | 2009-02-22 23:40:31 +0000 | [diff] [blame] | 103 | $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-linux.a |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 104 | |
| 105 | LIBREPLACEMALLOC_PPC32_LINUX = \ |
sewardj | 4d3f7a4 | 2009-02-22 23:40:31 +0000 | [diff] [blame] | 106 | $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-linux.a |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 107 | |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 108 | LIBREPLACEMALLOC_PPC64BE_LINUX = \ |
| 109 | $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64be-linux.a |
| 110 | |
| 111 | LIBREPLACEMALLOC_PPC64LE_LINUX = \ |
| 112 | $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64le-linux.a |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 113 | |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 114 | LIBREPLACEMALLOC_ARM_LINUX = \ |
| 115 | $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm-linux.a |
| 116 | |
sewardj | f0c1250 | 2014-01-12 12:54:00 +0000 | [diff] [blame] | 117 | LIBREPLACEMALLOC_ARM64_LINUX = \ |
| 118 | $(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm64-linux.a |
| 119 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 120 | LIBREPLACEMALLOC_X86_DARWIN = \ |
| 121 | $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a |
| 122 | |
| 123 | LIBREPLACEMALLOC_AMD64_DARWIN = \ |
| 124 | $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-darwin.a |
| 125 | |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 126 | LIBREPLACEMALLOC_S390X_LINUX = \ |
| 127 | $(top_builddir)/coregrind/libreplacemalloc_toolpreload-s390x-linux.a |
| 128 | |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 129 | LIBREPLACEMALLOC_MIPS32_LINUX = \ |
| 130 | $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips32-linux.a |
njn | b7fda4c | 2009-02-06 04:05:43 +0000 | [diff] [blame] | 131 | |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 132 | LIBREPLACEMALLOC_MIPS64_LINUX = \ |
| 133 | $(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips64-linux.a |
| 134 | |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 135 | LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \ |
| 136 | -Wl,--whole-archive \ |
| 137 | $(LIBREPLACEMALLOC_X86_LINUX) \ |
| 138 | -Wl,--no-whole-archive |
njn | b7fda4c | 2009-02-06 04:05:43 +0000 | [diff] [blame] | 139 | |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 140 | LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX = \ |
| 141 | -Wl,--whole-archive \ |
| 142 | $(LIBREPLACEMALLOC_AMD64_LINUX) \ |
| 143 | -Wl,--no-whole-archive |
njn | b7fda4c | 2009-02-06 04:05:43 +0000 | [diff] [blame] | 144 | |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 145 | LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX = \ |
| 146 | -Wl,--whole-archive \ |
| 147 | $(LIBREPLACEMALLOC_PPC32_LINUX) \ |
| 148 | -Wl,--no-whole-archive |
njn | b7fda4c | 2009-02-06 04:05:43 +0000 | [diff] [blame] | 149 | |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 150 | LIBREPLACEMALLOC_LDFLAGS_PPC64BE_LINUX = \ |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 151 | -Wl,--whole-archive \ |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 152 | $(LIBREPLACEMALLOC_PPC64BE_LINUX) \ |
| 153 | -Wl,--no-whole-archive |
| 154 | |
| 155 | LIBREPLACEMALLOC_LDFLAGS_PPC64LE_LINUX = \ |
| 156 | -Wl,--whole-archive \ |
| 157 | $(LIBREPLACEMALLOC_PPC64LE_LINUX) \ |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 158 | -Wl,--no-whole-archive |
njn | b7fda4c | 2009-02-06 04:05:43 +0000 | [diff] [blame] | 159 | |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 160 | LIBREPLACEMALLOC_LDFLAGS_ARM_LINUX = \ |
| 161 | -Wl,--whole-archive \ |
| 162 | $(LIBREPLACEMALLOC_ARM_LINUX) \ |
| 163 | -Wl,--no-whole-archive |
| 164 | |
sewardj | f0c1250 | 2014-01-12 12:54:00 +0000 | [diff] [blame] | 165 | LIBREPLACEMALLOC_LDFLAGS_ARM64_LINUX = \ |
| 166 | -Wl,--whole-archive \ |
| 167 | $(LIBREPLACEMALLOC_ARM64_LINUX) \ |
| 168 | -Wl,--no-whole-archive |
| 169 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 170 | LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN = \ |
| 171 | $(LIBREPLACEMALLOC_X86_DARWIN) |
njn | 3e65340 | 2009-02-06 07:12:57 +0000 | [diff] [blame] | 172 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 173 | LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN = \ |
| 174 | $(LIBREPLACEMALLOC_AMD64_DARWIN) |
njn | ac31b05 | 2009-02-12 00:30:02 +0000 | [diff] [blame] | 175 | |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 176 | LIBREPLACEMALLOC_LDFLAGS_S390X_LINUX = \ |
| 177 | -Wl,--whole-archive \ |
| 178 | $(LIBREPLACEMALLOC_S390X_LINUX) \ |
| 179 | -Wl,--no-whole-archive |
| 180 | |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 181 | LIBREPLACEMALLOC_LDFLAGS_MIPS32_LINUX = \ |
| 182 | -Wl,--whole-archive \ |
| 183 | $(LIBREPLACEMALLOC_MIPS32_LINUX) \ |
| 184 | -Wl,--no-whole-archive |
| 185 | |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 186 | LIBREPLACEMALLOC_LDFLAGS_MIPS64_LINUX = \ |
| 187 | -Wl,--whole-archive \ |
| 188 | $(LIBREPLACEMALLOC_MIPS64_LINUX) \ |
| 189 | -Wl,--no-whole-archive |
| 190 | |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 191 | #---------------------------------------------------------------------------- |
| 192 | # General stuff |
| 193 | #---------------------------------------------------------------------------- |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 194 | |
| 195 | all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS |
| 196 | |
| 197 | clean-local: clean-noinst_DSYMS |
| 198 | |
| 199 | install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS |
njn | ac31b05 | 2009-02-12 00:30:02 +0000 | [diff] [blame] | 200 | |
mjw | fbde9cf | 2014-05-09 14:25:39 +0000 | [diff] [blame] | 201 | uninstall-local: uninstall-noinst_PROGRAMS uninstall-noinst_DSYMS |
| 202 | |