Gentoo Archives: gentoo-commits

From: Aric Belsito <lluixhi@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: dev-util/valgrind/files/, dev-util/valgrind/
Date: Mon, 05 Dec 2016 05:46:25
Message-Id: 1480916164.e2ff1c62569ad1795cdbfac9856eaa11d8f8ad48.lluixhi@gentoo
1 commit: e2ff1c62569ad1795cdbfac9856eaa11d8f8ad48
2 Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
3 AuthorDate: Mon Dec 5 05:36:04 2016 +0000
4 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
5 CommitDate: Mon Dec 5 05:36:04 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=e2ff1c62
7
8 dev-util/valgrind: add stable and unstable version
9
10 dev-util/valgrind/Manifest | 15 +++
11 .../files/valgrind-3.10.1-glibc-2.21.patch | 17 +++
12 .../files/valgrind-3.10.1-glibc-2.22.patch | 17 +++
13 .../valgrind/files/valgrind-3.10.1-linux-4.patch | 29 ++++
14 dev-util/valgrind/files/valgrind-3.10.1-musl.patch | 44 ++++++
15 .../files/valgrind-3.10.1-non-exec-stack.patch | 148 +++++++++++++++++++++
16 dev-util/valgrind/files/valgrind-3.11.0-musl.patch | 45 +++++++
17 .../files/valgrind-3.6.0-local-labels.patch | 24 ++++
18 .../files/valgrind-3.7.0-fno-stack-protector.patch | 12 ++
19 .../files/valgrind-3.7.0-respect-flags.patch | 13 ++
20 .../valgrind/files/valgrind-3.9.0-glibc-2.19.patch | 37 ++++++
21 dev-util/valgrind/metadata.xml | 24 ++++
22 dev-util/valgrind/valgrind-3.10.1.ebuild | 121 +++++++++++++++++
23 dev-util/valgrind/valgrind-3.12.0.ebuild | 99 ++++++++++++++
24 14 files changed, 645 insertions(+)
25
26 diff --git a/dev-util/valgrind/Manifest b/dev-util/valgrind/Manifest
27 new file mode 100644
28 index 0000000..c4f9e3c
29 --- /dev/null
30 +++ b/dev-util/valgrind/Manifest
31 @@ -0,0 +1,15 @@
32 +AUX valgrind-3.10.1-glibc-2.21.patch 754 SHA256 a26812fc17bad388e3a30e74cec313ffc8c13bb61f8bb2667008af3d5e4d8984 SHA512 e5fa252633629d0688cbc97d60c91b51796c142c4336f0775266cedc14e53530397290dcdb4d6a4170b0579051fa8a33766d7c43980d6785e56880409ae39218 WHIRLPOOL e106fe74225329e05c89b5e69471c88fe65f7044e357c66509ff4731cf5f2f410e79fed0885af015e7c49d4b9b37e4e491fc870f900da18ef9cab146a37c9050
33 +AUX valgrind-3.10.1-glibc-2.22.patch 754 SHA256 c1fb0353065c03abc3867e0c0ffd030abbe9050bd6c0df1622633eac0156f5bc SHA512 c9d6511097b4270474011ee5dd7e87b20ca946c8fc227766db017948d0fcff7b5f8031ce2827b90917c2c9fb059fa65173cc2243c3d57b7e9edfcab740b7250e WHIRLPOOL 5a45da79add0334989ba85697a958416e762593e1b60d604002dea081191ad1aba45c4502191b212db64e208a7b2e7f8a80e5955157487782b31b09e9626e2e4
34 +AUX valgrind-3.10.1-linux-4.patch 972 SHA256 08956afc6390188a6c8bc0cebb81e806d4006e635076878e21043a57e5df4816 SHA512 22fda4cb41ee38e5b871217abf7c697ac6d1f088e9d6f5c035c6c54b0d008f2f23fe900fc036f0990fbad6284d357838e344ec43c156a5d8ec60d7b377abceaf WHIRLPOOL 99528549388b189328de8fe40715cdeac86f22726c62f9ae5aa677ac1a33aeb610230c421738342c4ed8b3b55e43372ecda943d5c2a4e74a26484ff1c1ef8c50
35 +AUX valgrind-3.10.1-musl.patch 1884 SHA256 9f94b5a8674f5f3c1dead32cff036ae5a513158e14c89cf230cd6f3d47e77feb SHA512 5a8ce93abd83a66983f0b47acce4e375dd6b8c57d6772d42f51aea0ec0f0c233cef88230d10e54c06446a84c772810d382fd1861019ad9b28578b0e0bd8ff57c WHIRLPOOL d62e7ddf61e9fd8a810c358051448cf742dd145738e7fbea8bf1f56ea8ceadf9683da6e6e596807dc810ba5e2c8688b45e1ccccc06451742c8598e712227d5a2
36 +AUX valgrind-3.10.1-non-exec-stack.patch 6019 SHA256 812560566e56c32db2ad3a97a2e52327d84648698987079ccf3843203c1e6ddc SHA512 015da8132bb72b81bd017b3e3faefb408a8f053676ff605bec411e40d9b7de21b197f660139df7e540756462406442325305d52ae0da04ac44ec66612fb1b0b3 WHIRLPOOL ddaf89092c4915662e6ba048668715f13e8634edc7cf490099870edda3b23799a76e3c677a430bf966295f84010829217aa0c0f887e48762969b805a365ef101
37 +AUX valgrind-3.11.0-musl.patch 2031 SHA256 c3c036b5976320f5c4f949a5c10c1b361b6328e5ca766658975305892c46efd0 SHA512 29bb3f4719b6ec6e921220135f6d11eb4fa130edf3c94b9b63ddd68fba1426aaa6b1bb7629b25c853a1b2a902f4fd0d8e74a3d641f395d43f0553209e6c5f5d5 WHIRLPOOL 8f06d02c36a52f753ad8103b13b11cc07dcaf531769ca99f142244d737d75d25cb5290eefebd0e7b9b18f40d5a855cee72cef89efae100961566df0b48e63977
38 +AUX valgrind-3.6.0-local-labels.patch 1388 SHA256 34ae13eda378677f1e662e0813f138de9b897d6592d20872c58ed8ac1bcf7def SHA512 079abe5bd99e2acf0e33a46db3772e264a2051d048c1cd34a4ee350395ea38b815f7909008ed1123324857ed25ab0159da4c5da37701570be012a0664481bbc6 WHIRLPOOL ba737636a547154947073478048f693bb28a9e353b8a1ac195d701bb8be69e182aa5d043b1c6085639c80752c68e5c8b26e3ec54bdcff7ac53ca71bc62768f58
39 +AUX valgrind-3.7.0-fno-stack-protector.patch 554 SHA256 83ed90a0e8a8b06dca8aad4e7f1a12e3c84621d502427c0913b72740b310f479 SHA512 4f9573fd68a0e1e209518fb4100c27b697ccd28e7a39abaa921f1949cd87ffb79a6784d2d1f6e006d68a08c7217cee77cba378c18aab48b87a3824eedb53ed5e WHIRLPOOL 097a9658c0b83cec2b49fc0011bc63512d1a1b2e12048203ac963ad1fd526f932d8fee4052e6b8daacec3fa0bc9a0ea25e69f88bbb5df588e9b668252c0dc517
40 +AUX valgrind-3.7.0-respect-flags.patch 360 SHA256 6b1e5938ecafc29428a698296423c71924848b1e746d6ee8a0f1dd91141f1019 SHA512 efdb017283b6a5829d1a5acc31b42ddd177a3ab468eb062b8c4fd90b2dbd06679e8d8bc2d6f813e3001efdda831d4410cc8da3a3e42ee2e49efea0423e4b3ca3 WHIRLPOOL 5bff165cf8f6042905a4d682b0114ee41301de173d43412b16208a08a351fe8ca74a527e4d09f9649dca28cbb61dd8ea2392e10e2b8d7b8ea0e51318915f9565
41 +AUX valgrind-3.9.0-glibc-2.19.patch 1530 SHA256 5cb0b62569d6acf3bc30e168570effecfcccd8cd6d9d9f1ee201c99d74a960f6 SHA512 8f059c9cf61cab427538164fd11bc14d3be17d5f93a77b8ca33426c0bf2fee3b2d0797cd246ec50266cc5f6ebb602d877ab7eded0618836752fd14408a2d5a63 WHIRLPOOL 8556c35adb05b20f466ec6acc1ce4b8a4940cf29b576dc72623278a5eb35f269aa84edb1202bcf059daee1e0c2ff9f7a0828b8f1a0e31b12f6d30d24bf07da37
42 +DIST valgrind-3.10.1.tar.bz2 10967905 SHA256 fa253dc26ddb661b6269df58144eff607ea3f76a9bcfe574b0c7726e1dfcb997 SHA512 8f3d27637c13b06381b3dd44088244e0cf2f7008f40e46f34322f2a5bfa6373d29ce68ff49f19c48f1a5f139d8be5838b9606206e0ce2599c5f74c0db8ce2642 WHIRLPOOL 3d55f35b02195d9859d9192726ea708277f1d3339005d959baa224822c5b71f5347cdd28c7fd8153c10d1e3282855e853caf9c7192751bebdbbc3444c33d885a
43 +DIST valgrind-3.12.0.tar.bz2 12788556 SHA256 67ca4395b2527247780f36148b084f5743a68ab0c850cb43e4a5b4b012cf76a1 SHA512 2c083f7c2e74dc58600397726d9d3af7a2cea40fe3d8733149886d1d77867e6c09996e5be1c58dd932f3662acf7363e04eeadbc0f9c8f0dac089e605024229be WHIRLPOOL 136dd4f358bd18165a5801083cc73fc269a84bf491880af9842e789feea62181e16ca4c099db06fb4ffacf0cb0189b1b29d64790cc4202442f6f6b71ce4c6eea
44 +EBUILD valgrind-3.10.1.ebuild 3688 SHA256 a7e217a8c1cc99aa31a40ed73b8d5d5a1da132675e08b4fb65181d6fec31d2d2 SHA512 8628ea17d0d642fbbc396150951ad3cf0ce1f7728ec3430f24670dc5c81605c5aba7464074f800223b3ebf75a00cea8d57672d5c000152ef243416e4c4db4029 WHIRLPOOL 77167b8cbf8c97b507e142fede1b75a342ae15f7307952ca874fb01a3f832b6a38aa38485d31493448f6ebfd30d847e620f4f7558698dbda7c7a3a046cd3669f
45 +EBUILD valgrind-3.12.0.ebuild 2930 SHA256 2f3d82b860dd6ae0935d52825f9570ea200081bfe46b1cc7168d3471b83aeedd SHA512 1f25175cb3239c65643dcd7f6aa2e5992e04f0f764a18c0a882e588e54b7b45661c3e5b85b2a330475f843fd23e58077690d096cbec451b51d521267c41ec0ab WHIRLPOOL c6da0ece5afa44ff92cb0fac0ec1f1266e504fa678e0470a502969c28e5a2c854d2f3e927b1355e6ae0104a25ad6d3d3fbe0a81c3ed15a5cd4ddb90f662bf17d
46 +MISC metadata.xml 1027 SHA256 24250bf95fab2ba7ee7d2806689796dffc8e7e8b85375c31fe6d329578e5fdb4 SHA512 da5bcaf596f2adaa552cc3b7296891b40be0bafec8a12695076ce8fbe660b8aabe70508eb02ab3fb66b0d9dd0c0c8615f430c1ee0ce3f3579732ea2406c8a778 WHIRLPOOL 9784694680f06fd891d27d35fcb942d7d3d0a2f15834855726e365982525fc70ccc69c61c82366091f07f275c46f59350ed1face4370d1e56b2584a4ee54a571
47
48 diff --git a/dev-util/valgrind/files/valgrind-3.10.1-glibc-2.21.patch b/dev-util/valgrind/files/valgrind-3.10.1-glibc-2.21.patch
49 new file mode 100644
50 index 0000000..286e431
51 --- /dev/null
52 +++ b/dev-util/valgrind/files/valgrind-3.10.1-glibc-2.21.patch
53 @@ -0,0 +1,17 @@
54 +diff -Naur valgrind-3.10.1.orig/configure.ac valgrind-3.10.1/configure.ac
55 +--- valgrind-3.10.1.orig/configure.ac 2014-11-25 14:41:13.000000000 -0500
56 ++++ valgrind-3.10.1/configure.ac 2015-07-28 22:35:22.315604804 -0400
57 +@@ -1018,6 +1018,13 @@
58 + DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
59 + DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
60 + ;;
61 ++ 2.21)
62 ++ AC_MSG_RESULT(2.21 family)
63 ++ AC_DEFINE([GLIBC_2_21], 1, [Define to 1 if you're using glibc 2.21.x])
64 ++ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
65 ++ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
66 ++ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
67 ++ ;;
68 + darwin)
69 + AC_MSG_RESULT(Darwin)
70 + AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
71
72 diff --git a/dev-util/valgrind/files/valgrind-3.10.1-glibc-2.22.patch b/dev-util/valgrind/files/valgrind-3.10.1-glibc-2.22.patch
73 new file mode 100644
74 index 0000000..aa44aec
75 --- /dev/null
76 +++ b/dev-util/valgrind/files/valgrind-3.10.1-glibc-2.22.patch
77 @@ -0,0 +1,17 @@
78 +diff -Naur valgrind-3.10.1.orig/configure.ac valgrind-3.10.1/configure.ac
79 +--- valgrind-3.10.1.orig/configure.ac 2016-04-16 04:24:22.285314910 -0400
80 ++++ valgrind-3.10.1/configure.ac 2016-04-16 04:39:03.437329726 -0400
81 +@@ -1032,6 +1032,13 @@
82 + DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
83 + DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
84 + ;;
85 ++ 2.22)
86 ++ AC_MSG_RESULT(2.22 family)
87 ++ AC_DEFINE([GLIBC_2_22], 1, [Define to 1 if you're using glibc 2.22.x])
88 ++ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
89 ++ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
90 ++ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
91 ++ ;;
92 + darwin)
93 + AC_MSG_RESULT(Darwin)
94 + AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
95
96 diff --git a/dev-util/valgrind/files/valgrind-3.10.1-linux-4.patch b/dev-util/valgrind/files/valgrind-3.10.1-linux-4.patch
97 new file mode 100644
98 index 0000000..63918c2
99 --- /dev/null
100 +++ b/dev-util/valgrind/files/valgrind-3.10.1-linux-4.patch
101 @@ -0,0 +1,29 @@
102 +From ecb3746d69820905c076b89e1be7042f52ceaa5f Mon Sep 17 00:00:00 2001
103 +From: Janne Grunau <j@××××××.net>
104 +Date: Thu, 19 Mar 2015 22:44:51 +0100
105 +Subject: [PATCH 1/1] configure: support linux 4.*
106 +
107 +There is nothing special in linux 4.0. Handle it as another 3.* (or
108 +another 2.6.*) release. Compare changeset 14955 in valgrind's
109 +subversion repository. Valgrind trunk also drops support for linux 2.4
110 +but there is no need to do that for realeased software.
111 +---
112 + configure.ac | 2 +-
113 + 1 file changed, 1 insertion(+), 1 deletion(-)
114 +
115 +diff --git a/configure.ac b/configure.ac
116 +index 0fd2a41..33c7954 100644
117 +--- a/configure.ac
118 ++++ b/configure.ac
119 +@@ -303,7 +303,7 @@ case "${host_os}" in
120 + kernel=`uname -r`
121 +
122 + case "${kernel}" in
123 +- 2.6.*|3.*)
124 ++ 2.6.*|3.*|4.*)
125 + AC_MSG_RESULT([2.6.x/3.x family (${kernel})])
126 + AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x or Linux 3.x])
127 + ;;
128 +--
129 +2.3.3
130 +
131
132 diff --git a/dev-util/valgrind/files/valgrind-3.10.1-musl.patch b/dev-util/valgrind/files/valgrind-3.10.1-musl.patch
133 new file mode 100644
134 index 0000000..573c75d
135 --- /dev/null
136 +++ b/dev-util/valgrind/files/valgrind-3.10.1-musl.patch
137 @@ -0,0 +1,44 @@
138 +diff -ru valgrind-3.10.0.orig/configure.ac valgrind-3.10.0/configure.ac
139 +--- valgrind-3.10.0.orig/configure.ac 2014-09-11 12:12:44.000000000 -0300
140 ++++ valgrind-3.10.0/configure.ac 2014-09-19 13:11:10.338289149 -0300
141 +@@ -1031,8 +1031,6 @@
142 +
143 + *)
144 + AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
145 +- AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.19])
146 +- AC_MSG_ERROR([or Darwin or Bionic libc])
147 + ;;
148 + esac
149 +
150 +diff -ru valgrind-3.10.0.orig/coregrind/vg_preloaded.c valgrind-3.10.0/coregrind/vg_preloaded.c
151 +--- valgrind-3.10.0.orig/coregrind/vg_preloaded.c 2014-09-19 13:08:26.000000000 -0300
152 ++++ valgrind-3.10.0/coregrind/vg_preloaded.c 2014-09-19 13:12:31.301626639 -0300
153 +@@ -57,7 +57,7 @@
154 + void VG_NOTIFY_ON_LOAD(freeres)( void );
155 + void VG_NOTIFY_ON_LOAD(freeres)( void )
156 + {
157 +-# if !defined(__UCLIBC__) \
158 ++# if defined(__GLIBC__) \
159 + && !defined(VGPV_arm_linux_android) && !defined(VGPV_x86_linux_android) \
160 + && !defined(VGPV_mips32_linux_android)
161 + extern void __libc_freeres(void);
162 +--- valgrind-3.10.0.orig/include/pub_tool_redir.h 2014-09-08 15:28:23.000000000 -0300
163 ++++ valgrind-3.10.0/include/pub_tool_redir.h 2014-09-19 14:12:48.195145620 -0300
164 +@@ -241,7 +241,7 @@
165 + /* --- Soname of the standard C library. --- */
166 +
167 + #if defined(VGO_linux)
168 +-# define VG_Z_LIBC_SONAME libcZdsoZa // libc.so*
169 ++# define VG_Z_LIBC_SONAME libcZdZa // libc.*
170 +
171 + #elif defined(VGO_darwin) && (DARWIN_VERS <= DARWIN_10_6)
172 + # define VG_Z_LIBC_SONAME libSystemZdZaZddylib // libSystem.*.dylib
173 +@@ -273,7 +273,7 @@
174 + /* --- Soname of the pthreads library. --- */
175 +
176 + #if defined(VGO_linux)
177 +-# define VG_Z_LIBPTHREAD_SONAME libpthreadZdsoZd0 // libpthread.so.0
178 ++# define VG_Z_LIBPTHREAD_SONAME libcZdZa // libc.*
179 + #elif defined(VGO_darwin)
180 + # define VG_Z_LIBPTHREAD_SONAME libSystemZdZaZddylib // libSystem.*.dylib
181 + #else
182
183 diff --git a/dev-util/valgrind/files/valgrind-3.10.1-non-exec-stack.patch b/dev-util/valgrind/files/valgrind-3.10.1-non-exec-stack.patch
184 new file mode 100644
185 index 0000000..e25de99
186 --- /dev/null
187 +++ b/dev-util/valgrind/files/valgrind-3.10.1-non-exec-stack.patch
188 @@ -0,0 +1,148 @@
189 +diff -Naur valgrind-3.10.1.orig/coregrind/Makefile.am valgrind-3.10.1/coregrind/Makefile.am
190 +--- valgrind-3.10.1.orig/coregrind/Makefile.am 2014-11-25 14:41:19.000000000 -0500
191 ++++ valgrind-3.10.1/coregrind/Makefile.am 2014-11-26 13:36:44.113678744 -0500
192 +@@ -333,18 +333,6 @@
193 + m_demangle/demangle.c \
194 + m_demangle/dyn-string.c \
195 + m_demangle/safe-ctype.c \
196 +- m_dispatch/dispatch-x86-linux.S \
197 +- m_dispatch/dispatch-amd64-linux.S \
198 +- m_dispatch/dispatch-ppc32-linux.S \
199 +- m_dispatch/dispatch-ppc64be-linux.S \
200 +- m_dispatch/dispatch-ppc64le-linux.S \
201 +- m_dispatch/dispatch-arm-linux.S \
202 +- m_dispatch/dispatch-arm64-linux.S \
203 +- m_dispatch/dispatch-s390x-linux.S \
204 +- m_dispatch/dispatch-mips32-linux.S \
205 +- m_dispatch/dispatch-mips64-linux.S \
206 +- m_dispatch/dispatch-x86-darwin.S \
207 +- m_dispatch/dispatch-amd64-darwin.S \
208 + m_gdbserver/inferiors.c \
209 + m_gdbserver/m_gdbserver.c \
210 + m_gdbserver/regcache.c \
211 +@@ -368,8 +356,6 @@
212 + m_initimg/initimg-pathscan.c \
213 + m_mach/mach_basics.c \
214 + m_mach/mach_msg.c \
215 +- m_mach/mach_traps-x86-darwin.S \
216 +- m_mach/mach_traps-amd64-darwin.S \
217 + m_replacemalloc/replacemalloc_core.c \
218 + m_scheduler/scheduler.c \
219 + m_scheduler/sema.c \
220 +@@ -386,18 +372,6 @@
221 + m_sigframe/sigframe-mips64-linux.c \
222 + m_sigframe/sigframe-x86-darwin.c \
223 + m_sigframe/sigframe-amd64-darwin.c \
224 +- m_syswrap/syscall-x86-linux.S \
225 +- m_syswrap/syscall-amd64-linux.S \
226 +- m_syswrap/syscall-ppc32-linux.S \
227 +- m_syswrap/syscall-ppc64be-linux.S \
228 +- m_syswrap/syscall-ppc64le-linux.S \
229 +- m_syswrap/syscall-arm-linux.S \
230 +- m_syswrap/syscall-arm64-linux.S \
231 +- m_syswrap/syscall-s390x-linux.S \
232 +- m_syswrap/syscall-mips32-linux.S \
233 +- m_syswrap/syscall-mips64-linux.S \
234 +- m_syswrap/syscall-x86-darwin.S \
235 +- m_syswrap/syscall-amd64-darwin.S \
236 + m_syswrap/syswrap-main.c \
237 + m_syswrap/syswrap-generic.c \
238 + m_syswrap/syswrap-linux.c \
239 +@@ -420,6 +394,29 @@
240 + m_ume/main.c \
241 + m_ume/script.c
242 +
243 ++COREGRIND_SOURCES_COMMON += \
244 ++ m_dispatch/dispatch-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S \
245 ++ m_syswrap/syscall-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S
246 ++
247 ++if VGCONF_HAVE_PLATFORM_SEC
248 ++COREGRIND_SOURCES_COMMON += \
249 ++ m_dispatch/dispatch-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S \
250 ++ m_syswrap/syscall-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S
251 ++endif
252 ++
253 ++if VGCONF_OS_IS_DARWIN
254 ++COREGRIND_SOURCES_COMMON += \
255 ++ m_dispatch/dispatch-@VGCONF_ARCH_PRI@-darwin.S \
256 ++ m_syswrap/syscall-@VGCONF_ARCH_PRI@-darwin.S \
257 ++ m_mach/mach_traps-@VGCONF_ARCH_PRI@-darwin.S
258 ++if VGCONF_HAVE_PLATFORM_SEC
259 ++COREGRIND_SOURCES_COMMON += \
260 ++ m_dispatch/dispatch-@VGCONF_ARCH_SEC@-darwin.S \
261 ++ m_syswrap/syscall-@VGCONF_ARCH_SEC@-darwin.S \
262 ++ m_mach/mach_traps-@VGCONF_ARCH_SEC@-darwin.S
263 ++endif
264 ++endif
265 ++
266 + libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
267 + $(COREGRIND_SOURCES_COMMON)
268 + nodist_libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
269 +diff -Naur valgrind-3.10.1.orig/coregrind/m_dispatch/dispatch-amd64-linux.S valgrind-3.10.1/coregrind/m_dispatch/dispatch-amd64-linux.S
270 +--- valgrind-3.10.1.orig/coregrind/m_dispatch/dispatch-amd64-linux.S 2014-11-25 14:41:20.000000000 -0500
271 ++++ valgrind-3.10.1/coregrind/m_dispatch/dispatch-amd64-linux.S 2014-11-26 13:30:11.840660890 -0500
272 +@@ -249,11 +249,11 @@
273 +
274 + .size VG_(disp_run_translations), .-VG_(disp_run_translations)
275 +
276 ++#endif // defined(VGP_amd64_linux)
277 ++
278 + /* Let the linker know we don't need an executable stack */
279 + .section .note.GNU-stack,"",@progbits
280 +
281 +-#endif // defined(VGP_amd64_linux)
282 +-
283 + /*--------------------------------------------------------------------*/
284 + /*--- end ---*/
285 + /*--------------------------------------------------------------------*/
286 +diff -Naur valgrind-3.10.1.orig/coregrind/m_dispatch/dispatch-x86-linux.S valgrind-3.10.1/coregrind/m_dispatch/dispatch-x86-linux.S
287 +--- valgrind-3.10.1.orig/coregrind/m_dispatch/dispatch-x86-linux.S 2014-11-25 14:41:20.000000000 -0500
288 ++++ valgrind-3.10.1/coregrind/m_dispatch/dispatch-x86-linux.S 2014-11-26 13:30:11.840660890 -0500
289 +@@ -240,11 +240,11 @@
290 +
291 + .size VG_(disp_run_translations), .-VG_(disp_run_translations)
292 +
293 ++#endif // defined(VGP_x86_linux)
294 ++
295 + /* Let the linker know we don't need an executable stack */
296 + .section .note.GNU-stack,"",@progbits
297 +
298 +-#endif // defined(VGP_x86_linux)
299 +-
300 + /*--------------------------------------------------------------------*/
301 + /*--- end ---*/
302 + /*--------------------------------------------------------------------*/
303 +diff -Naur valgrind-3.10.1.orig/coregrind/m_syswrap/syscall-amd64-linux.S valgrind-3.10.1/coregrind/m_syswrap/syscall-amd64-linux.S
304 +--- valgrind-3.10.1.orig/coregrind/m_syswrap/syscall-amd64-linux.S 2014-11-25 14:41:20.000000000 -0500
305 ++++ valgrind-3.10.1/coregrind/m_syswrap/syscall-amd64-linux.S 2014-11-26 13:30:11.840660890 -0500
306 +@@ -205,11 +205,11 @@
307 + ML_(blksys_finished): .quad 5b
308 + .previous
309 +
310 ++#endif // defined(VGP_amd64_linux)
311 ++
312 + /* Let the linker know we don't need an executable stack */
313 + .section .note.GNU-stack,"",@progbits
314 +
315 +-#endif // defined(VGP_amd64_linux)
316 +-
317 + /*--------------------------------------------------------------------*/
318 + /*--- end ---*/
319 + /*--------------------------------------------------------------------*/
320 +diff -Naur valgrind-3.10.1.orig/coregrind/m_syswrap/syscall-x86-linux.S valgrind-3.10.1/coregrind/m_syswrap/syscall-x86-linux.S
321 +--- valgrind-3.10.1.orig/coregrind/m_syswrap/syscall-x86-linux.S 2014-11-25 14:41:20.000000000 -0500
322 ++++ valgrind-3.10.1/coregrind/m_syswrap/syscall-x86-linux.S 2014-11-26 13:30:11.840660890 -0500
323 +@@ -165,11 +165,11 @@
324 + ML_(blksys_finished): .long 5b
325 + .previous
326 +
327 ++#endif // defined(VGP_x86_linux)
328 ++
329 + /* Let the linker know we don't need an executable stack */
330 + .section .note.GNU-stack,"",@progbits
331 +
332 +-#endif // defined(VGP_x86_linux)
333 +-
334 + /*--------------------------------------------------------------------*/
335 + /*--- end ---*/
336 + /*--------------------------------------------------------------------*/
337
338 diff --git a/dev-util/valgrind/files/valgrind-3.11.0-musl.patch b/dev-util/valgrind/files/valgrind-3.11.0-musl.patch
339 new file mode 100644
340 index 0000000..a76a741
341 --- /dev/null
342 +++ b/dev-util/valgrind/files/valgrind-3.11.0-musl.patch
343 @@ -0,0 +1,45 @@
344 +diff -Naurw valgrind-3.11.0.orig/configure.ac valgrind-3.11.0/configure.ac
345 +--- valgrind-3.11.0.orig/configure.ac 2015-09-22 13:26:31.000000000 -0700
346 ++++ valgrind-3.11.0/configure.ac 2015-09-26 11:54:13.570025359 -0700
347 +@@ -1066,8 +1066,6 @@
348 + ;;
349 + 2.0|2.1|*)
350 + AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
351 +- AC_MSG_ERROR([Valgrind requires glibc version 2.2 or later,])
352 +- AC_MSG_ERROR([Darwin libc, Bionic libc or Solaris libc])
353 + ;;
354 + esac
355 +
356 +diff -Naurw valgrind-3.11.0.orig/coregrind/vg_preloaded.c valgrind-3.11.0/coregrind/vg_preloaded.c
357 +--- valgrind-3.11.0.orig/coregrind/vg_preloaded.c 2015-09-08 06:23:26.000000000 -0700
358 ++++ valgrind-3.11.0/coregrind/vg_preloaded.c 2015-09-26 11:54:52.383359849 -0700
359 +@@ -56,7 +56,7 @@
360 + void VG_NOTIFY_ON_LOAD(freeres)( void );
361 + void VG_NOTIFY_ON_LOAD(freeres)( void )
362 + {
363 +-# if !defined(__UCLIBC__) \
364 ++# if defined(__GLIBC__) \
365 + && !defined(VGPV_arm_linux_android) \
366 + && !defined(VGPV_x86_linux_android) \
367 + && !defined(VGPV_mips32_linux_android) \
368 +diff -Naurw valgrind-3.11.0.orig/include/pub_tool_redir.h valgrind-3.11.0/include/pub_tool_redir.h
369 +--- valgrind-3.11.0.orig/include/pub_tool_redir.h 2015-09-08 06:23:26.000000000 -0700
370 ++++ valgrind-3.11.0/include/pub_tool_redir.h 2015-09-26 11:57:20.796697605 -0700
371 +@@ -242,7 +242,7 @@
372 + /* --- Soname of the standard C library. --- */
373 +
374 + #if defined(VGO_linux) || defined(VGO_solaris)
375 +-# define VG_Z_LIBC_SONAME libcZdsoZa // libc.so*
376 ++# define VG_Z_LIBC_SONAME libcZdZa // libc.*
377 +
378 + #elif defined(VGO_darwin) && (DARWIN_VERS <= DARWIN_10_6)
379 + # define VG_Z_LIBC_SONAME libSystemZdZaZddylib // libSystem.*.dylib
380 +@@ -274,7 +274,7 @@
381 + /* --- Soname of the pthreads library. --- */
382 +
383 + #if defined(VGO_linux)
384 +-# define VG_Z_LIBPTHREAD_SONAME libpthreadZdsoZd0 // libpthread.so.0
385 ++# define VG_Z_LIBPTHREAD_SONAME libcZdZa // libc.*
386 + #elif defined(VGO_darwin)
387 + # define VG_Z_LIBPTHREAD_SONAME libSystemZdZaZddylib // libSystem.*.dylib
388 + #elif defined(VGO_solaris)
389
390 diff --git a/dev-util/valgrind/files/valgrind-3.6.0-local-labels.patch b/dev-util/valgrind/files/valgrind-3.6.0-local-labels.patch
391 new file mode 100644
392 index 0000000..68e6822
393 --- /dev/null
394 +++ b/dev-util/valgrind/files/valgrind-3.6.0-local-labels.patch
395 @@ -0,0 +1,24 @@
396 +--- coregrind/m_libcassert.c 2010-10-21 04:19:45.000000000 +0800
397 ++++ coregrind/m_libcassert.c 2010-10-24 20:23:17.800001876 +0800
398 +@@ -81,8 +81,8 @@
399 + { UInt cia, r1, lr; \
400 + __asm__ __volatile__( \
401 + "mflr 0;" /* r0 = lr */ \
402 +- "bl m_libcassert_get_ip;" /* lr = pc */ \
403 +- "m_libcassert_get_ip:\n" \
404 ++ "bl 0f;" /* lr = pc */ \
405 ++ "0:\n" \
406 + "mflr %0;" /* %0 = pc */ \
407 + "mtlr 0;" /* restore lr */ \
408 + "mr %1,1;" /* %1 = r1 */ \
409 +@@ -100,8 +100,8 @@
410 + { ULong cia, r1, lr; \
411 + __asm__ __volatile__( \
412 + "mflr 0;" /* r0 = lr */ \
413 +- "bl .m_libcassert_get_ip;" /* lr = pc */ \
414 +- ".m_libcassert_get_ip:\n" \
415 ++ "bl 0f;" /* lr = pc */ \
416 ++ "0:\n" \
417 + "mflr %0;" /* %0 = pc */ \
418 + "mtlr 0;" /* restore lr */ \
419 + "mr %1,1;" /* %1 = r1 */ \
420
421 diff --git a/dev-util/valgrind/files/valgrind-3.7.0-fno-stack-protector.patch b/dev-util/valgrind/files/valgrind-3.7.0-fno-stack-protector.patch
422 new file mode 100644
423 index 0000000..6af4553
424 --- /dev/null
425 +++ b/dev-util/valgrind/files/valgrind-3.7.0-fno-stack-protector.patch
426 @@ -0,0 +1,12 @@
427 +diff -Naur valgrind-3.7.0.orig//Makefile.all.am valgrind-3.7.0/Makefile.all.am
428 +--- valgrind-3.7.0.orig//Makefile.all.am 2011-10-26 17:24:45.000000000 -0400
429 ++++ valgrind-3.7.0/Makefile.all.am 2011-11-10 16:18:18.000000000 -0500
430 +@@ -82,7 +82,7 @@
431 + # performance and get whatever useful warnings we can out of gcc.
432 + # -fno-builtin is important for defeating LLVM's idiom recognition
433 + # that somehow causes VG_(memset) to get into infinite recursion.
434 +-AM_CFLAGS_BASE = \
435 ++AM_CFLAGS_BASE = -fno-stack-protector \
436 + -O2 -g \
437 + -Wall \
438 + -Wmissing-prototypes \
439
440 diff --git a/dev-util/valgrind/files/valgrind-3.7.0-respect-flags.patch b/dev-util/valgrind/files/valgrind-3.7.0-respect-flags.patch
441 new file mode 100644
442 index 0000000..860e09c
443 --- /dev/null
444 +++ b/dev-util/valgrind/files/valgrind-3.7.0-respect-flags.patch
445 @@ -0,0 +1,13 @@
446 +diff -Naur valgrind-3.7.0.orig//mpi/Makefile.am valgrind-3.7.0/mpi/Makefile.am
447 +--- valgrind-3.7.0.orig//mpi/Makefile.am 2011-10-26 17:24:23.000000000 -0400
448 ++++ valgrind-3.7.0/mpi/Makefile.am 2011-11-10 16:03:14.000000000 -0500
449 +@@ -7,9 +7,6 @@
450 + CC = $(MPI_CC)
451 + DEFS =
452 + DEFAULT_INCLUDES =
453 +-CPPFLAGS =
454 +-CFLAGS =
455 +-LDFLAGS =
456 +
457 + EXTRA_DIST = \
458 + mpiwrap_type_test.c
459
460 diff --git a/dev-util/valgrind/files/valgrind-3.9.0-glibc-2.19.patch b/dev-util/valgrind/files/valgrind-3.9.0-glibc-2.19.patch
461 new file mode 100644
462 index 0000000..79a3283
463 --- /dev/null
464 +++ b/dev-util/valgrind/files/valgrind-3.9.0-glibc-2.19.patch
465 @@ -0,0 +1,37 @@
466 +diff -Naur valgrind-3.9.0-orig/configure valgrind-3.9.0/configure
467 +--- valgrind-3.9.0-orig/configure 2013-11-01 09:33:32.000000000 +1000
468 ++++ valgrind-3.9.0/configure 2014-02-08 09:28:06.063248544 +1000
469 +@@ -6689,6 +6689,16 @@
470 + DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
471 + DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
472 + ;;
473 ++ 2.19)
474 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: 2.19 family" >&5
475 ++$as_echo "2.19 family" >&6; }
476 ++
477 ++$as_echo "#define GLIBC_2_19 1" >>confdefs.h
478 ++
479 ++ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
480 ++ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
481 ++ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
482 ++ ;;
483 + darwin)
484 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Darwin" >&5
485 + $as_echo "Darwin" >&6; }
486 +diff -Naur valgrind-3.9.0-orig/configure.ac valgrind-3.9.0/configure.ac
487 +--- valgrind-3.9.0-orig/configure.ac 2013-11-01 09:28:16.000000000 +1000
488 ++++ valgrind-3.9.0/configure.ac 2014-02-08 09:27:38.870385366 +1000
489 +@@ -918,6 +918,13 @@
490 + DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
491 + DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
492 + ;;
493 ++ 2.19)
494 ++ AC_MSG_RESULT(2.19 family)
495 ++ AC_DEFINE([GLIBC_2_19], 1, [Define to 1 if you're using glibc 2.19.x])
496 ++ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
497 ++ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
498 ++ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
499 ++ ;;
500 + darwin)
501 + AC_MSG_RESULT(Darwin)
502 + AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
503
504 diff --git a/dev-util/valgrind/metadata.xml b/dev-util/valgrind/metadata.xml
505 new file mode 100644
506 index 0000000..0bf3fac
507 --- /dev/null
508 +++ b/dev-util/valgrind/metadata.xml
509 @@ -0,0 +1,24 @@
510 +<?xml version="1.0" encoding="UTF-8"?>
511 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
512 +<pkgmetadata>
513 + <maintainer type="person">
514 + <email>blueness@g.o</email>
515 + <name>Anthony G. Basile</name>
516 + </maintainer>
517 + <longdescription>
518 + Valgrind is a GPL'd tool to help you find memory-management problems
519 + in your programs. When a program is run under Valgrind's supervision,
520 + all reads and writes of memory are checked, and calls to
521 + malloc/new/free/delete are intercepted. As a result, Valgrind can
522 + detect problems such as
523 +
524 + - Use of uninitialised memory
525 + - Reading/writing memory after it has been free'd
526 + - Reading/writing off the end of malloc'd blocks
527 + - Reading/writing inappropriate areas on the stack
528 + - Memory leaks -- where pointers to malloc'd blocks are lost forever
529 + - Passing of uninitialised and/or unaddressible memory to system calls
530 + - Mismatched use of malloc/new/new [] vs free/delete/delete []
531 + - Some abuses of the POSIX Pthreads API
532 + </longdescription>
533 +</pkgmetadata>
534
535 diff --git a/dev-util/valgrind/valgrind-3.10.1.ebuild b/dev-util/valgrind/valgrind-3.10.1.ebuild
536 new file mode 100644
537 index 0000000..4c1397a
538 --- /dev/null
539 +++ b/dev-util/valgrind/valgrind-3.10.1.ebuild
540 @@ -0,0 +1,121 @@
541 +# Copyright 1999-2016 Gentoo Foundation
542 +# Distributed under the terms of the GNU General Public License v2
543 +# $Id$
544 +
545 +EAPI="5"
546 +inherit autotools eutils flag-o-matic toolchain-funcs multilib pax-utils
547 +
548 +DESCRIPTION="An open-source memory debugger for GNU/Linux"
549 +HOMEPAGE="http://www.valgrind.org"
550 +SRC_URI="http://www.valgrind.org/downloads/${P}.tar.bz2"
551 +
552 +LICENSE="GPL-2"
553 +SLOT="0"
554 +KEYWORDS="-* amd64 arm ppc ppc64 x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
555 +IUSE="mpi"
556 +
557 +DEPEND="mpi? ( virtual/mpi )"
558 +RDEPEND="${DEPEND}"
559 +
560 +src_prepare() {
561 + # Correct hard coded doc location
562 + sed -i -e "s:doc/valgrind:doc/${PF}:" docs/Makefile.am || die
563 +
564 + # Don't force multiarch stuff on OSX, bug #306467
565 + sed -i -e 's:-arch \(i386\|x86_64\)::g' Makefile.all.am || die
566 +
567 + # Respect CFLAGS, LDFLAGS
568 + epatch "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch
569 +
570 + # Changing Makefile.all.am to disable SSP
571 + epatch "${FILESDIR}"/${PN}-3.7.0-fno-stack-protector.patch
572 +
573 + # Yet more local labels, this time for ppc32 & ppc64
574 + epatch "${FILESDIR}"/${PN}-3.6.0-local-labels.patch
575 +
576 + # Don't build in empty assembly files for other platforms or we'll get a QA
577 + # warning about executable stacks.
578 + epatch "${FILESDIR}"/${PN}-3.10.1-non-exec-stack.patch
579 +
580 + # glibc 2.19 fix
581 + epatch "${FILESDIR}"/${PN}-3.9.0-glibc-2.19.patch
582 +
583 + # valgrind works fine on linux-4, bug #543648
584 + epatch "${FILESDIR}"/${PN}-3.10.1-linux-4.patch
585 +
586 + # glibc 2.21 fix. Bug #554808.
587 + epatch "${FILESDIR}"/${PN}-3.10.1-glibc-2.21.patch
588 +
589 + # glibc 2.22 fix. Bug #580092
590 + epatch "${FILESDIR}"/${PN}-3.10.1-glibc-2.22.patch
591 +
592 + # Fix building with musl
593 + epatch "${FILESDIR}"/${PN}-3.10.1-musl.patch
594 +
595 + # Allow users to test their own patches
596 + epatch_user
597 +
598 + # Regenerate autotools files
599 + eautoreconf
600 +}
601 +
602 +src_configure() {
603 + local myconf
604 +
605 + # Respect ar, bug #468114
606 + tc-export AR
607 +
608 + # -fomit-frame-pointer "Assembler messages: Error: junk `8' after expression"
609 + # while compiling insn_sse.c in none/tests/x86
610 + # -fpie valgrind seemingly hangs when built with pie on
611 + # amd64 (bug #102157)
612 + # -fstack-protector more undefined references to __guard and __stack_smash_handler
613 + # because valgrind doesn't link to glibc (bug #114347)
614 + # -m64 -mx32 for multilib-portage, bug #398825
615 + # -ggdb3 segmentation fault on startup
616 + filter-flags -fomit-frame-pointer
617 + filter-flags -fpie
618 + filter-flags -fstack-protector
619 + filter-flags -m64 -mx32
620 + replace-flags -ggdb3 -ggdb2
621 +
622 + if use amd64 || use ppc64; then
623 + ! has_multilib_profile && myconf="${myconf} --enable-only64bit"
624 + fi
625 +
626 + # Force bitness on darwin, bug #306467
627 + use x86-macos && myconf="${myconf} --enable-only32bit"
628 + use x64-macos && myconf="${myconf} --enable-only64bit"
629 +
630 + # Don't use mpicc unless the user asked for it (bug #258832)
631 + if ! use mpi; then
632 + myconf="${myconf} --without-mpicc"
633 + fi
634 +
635 + econf ${myconf}
636 +}
637 +
638 +src_install() {
639 + emake DESTDIR="${D}" install
640 + dodoc AUTHORS FAQ.txt NEWS README*
641 +
642 + pax-mark m "${ED}"/usr/$(get_libdir)/valgrind/*-*-linux
643 +
644 + if [[ ${CHOST} == *-darwin* ]] ; then
645 + # fix install_names on shared libraries, can't turn them into bundles,
646 + # as dyld won't load them any more then, bug #306467
647 + local l
648 + for l in "${ED}"/usr/lib/valgrind/*.so ; do
649 + install_name_tool -id "${EPREFIX}"/usr/lib/valgrind/${l##*/} "${l}"
650 + done
651 + fi
652 +}
653 +
654 +pkg_postinst() {
655 + elog "Valgrind will not work if glibc does not have debug symbols."
656 + elog "To fix this you can add splitdebug to FEATURES in make.conf"
657 + elog "and remerge glibc. See:"
658 + elog "https://bugs.gentoo.org/show_bug.cgi?id=214065"
659 + elog "https://bugs.gentoo.org/show_bug.cgi?id=274771"
660 + elog "https://bugs.gentoo.org/show_bug.cgi?id=388703"
661 +}
662
663 diff --git a/dev-util/valgrind/valgrind-3.12.0.ebuild b/dev-util/valgrind/valgrind-3.12.0.ebuild
664 new file mode 100644
665 index 0000000..f26542b
666 --- /dev/null
667 +++ b/dev-util/valgrind/valgrind-3.12.0.ebuild
668 @@ -0,0 +1,99 @@
669 +# Copyright 1999-2016 Gentoo Foundation
670 +# Distributed under the terms of the GNU General Public License v2
671 +# $Id$
672 +
673 +EAPI="5"
674 +inherit autotools eutils flag-o-matic toolchain-funcs multilib pax-utils
675 +
676 +DESCRIPTION="An open-source memory debugger for GNU/Linux"
677 +HOMEPAGE="http://www.valgrind.org"
678 +SRC_URI="http://www.valgrind.org/downloads/${P}.tar.bz2"
679 +
680 +LICENSE="GPL-2"
681 +SLOT="0"
682 +KEYWORDS="-* ~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
683 +IUSE="mpi"
684 +
685 +DEPEND="mpi? ( virtual/mpi )"
686 +RDEPEND="${DEPEND}"
687 +
688 +src_prepare() {
689 + # Correct hard coded doc location
690 + sed -i -e "s:doc/valgrind:doc/${PF}:" docs/Makefile.am || die
691 +
692 + # Don't force multiarch stuff on OSX, bug #306467
693 + sed -i -e 's:-arch \(i386\|x86_64\)::g' Makefile.all.am || die
694 +
695 + # Respect CFLAGS, LDFLAGS
696 + epatch "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch
697 +
698 + # Changing Makefile.all.am to disable SSP
699 + epatch "${FILESDIR}"/${PN}-3.7.0-fno-stack-protector.patch
700 +
701 + # Fix for MUSL.
702 + epatch "${FILESDIR}"/${PN}-3.11.0-musl.patch
703 +
704 + # Allow users to test their own patches
705 + epatch_user
706 +
707 + # Regenerate autotools files
708 + eautoreconf
709 +}
710 +
711 +src_configure() {
712 + local myconf
713 +
714 + # Respect ar, bug #468114
715 + tc-export AR
716 +
717 + # -fomit-frame-pointer "Assembler messages: Error: junk `8' after expression"
718 + # while compiling insn_sse.c in none/tests/x86
719 + # -fstack-protector more undefined references to __guard and __stack_smash_handler
720 + # because valgrind doesn't link to glibc (bug #114347)
721 + # -m64 -mx32 for multilib-portage, bug #398825
722 + # -ggdb3 segmentation fault on startup
723 + filter-flags -fomit-frame-pointer
724 + filter-flags -fstack-protector
725 + filter-flags -m64 -mx32
726 + replace-flags -ggdb3 -ggdb2
727 +
728 + if use amd64 || use ppc64; then
729 + ! has_multilib_profile && myconf="${myconf} --enable-only64bit"
730 + fi
731 +
732 + # Force bitness on darwin, bug #306467
733 + use x86-macos && myconf="${myconf} --enable-only32bit"
734 + use x64-macos && myconf="${myconf} --enable-only64bit"
735 +
736 + # Don't use mpicc unless the user asked for it (bug #258832)
737 + if ! use mpi; then
738 + myconf="${myconf} --without-mpicc"
739 + fi
740 +
741 + econf ${myconf}
742 +}
743 +
744 +src_install() {
745 + emake DESTDIR="${D}" install
746 + dodoc AUTHORS FAQ.txt NEWS README*
747 +
748 + pax-mark m "${ED}"/usr/$(get_libdir)/valgrind/*-*-linux
749 +
750 + if [[ ${CHOST} == *-darwin* ]] ; then
751 + # fix install_names on shared libraries, can't turn them into bundles,
752 + # as dyld won't load them any more then, bug #306467
753 + local l
754 + for l in "${ED}"/usr/lib/valgrind/*.so ; do
755 + install_name_tool -id "${EPREFIX}"/usr/lib/valgrind/${l##*/} "${l}"
756 + done
757 + fi
758 +}
759 +
760 +pkg_postinst() {
761 + elog "Valgrind will not work if glibc does not have debug symbols."
762 + elog "To fix this you can add splitdebug to FEATURES in make.conf"
763 + elog "and remerge glibc. See:"
764 + elog "https://bugs.gentoo.org/show_bug.cgi?id=214065"
765 + elog "https://bugs.gentoo.org/show_bug.cgi?id=274771"
766 + elog "https://bugs.gentoo.org/show_bug.cgi?id=388703"
767 +}