Gentoo Archives: gentoo-commits

From: "Diego Elio Pettenò" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/flameeyes:master commit in: dev-util/valgrind/, dev-util/valgrind/files/
Date: Tue, 15 Nov 2011 14:24:04
Message-Id: b1411749d775d0e5a64a4db88e41623283fcbc4d.flameeyes@gentoo
1 commit: b1411749d775d0e5a64a4db88e41623283fcbc4d
2 Author: Diego Elio Pettenò <flameeyes <AT> flameeyes <DOT> eu>
3 AuthorDate: Tue Nov 15 14:15:11 2011 +0000
4 Commit: Diego Elio Pettenò <flameeyes <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 15 14:15:11 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/flameeyes.git;a=commit;h=b1411749
7
8 Add versions of valgrind that wroks with the current systems.
9
10 ---
11 dev-util/valgrind/Manifest | 11 +-
12 .../files/valgrind-3.4.1-glibc-2.10.1.patch | 49 +++++++
13 .../files/valgrind-3.6.0-local-labels.patch | 24 ++++
14 .../files/valgrind-3.6.0-non-exec-stack.patch | 137 ++++++++++++++++++++
15 .../files/valgrind-9999-fix-as-needed.patch | 29 ++++
16 dev-util/valgrind/valgrind-3.6.0.ebuild | 90 +++++++++++++
17 dev-util/valgrind/valgrind-9999.ebuild | 87 +++++++------
18 7 files changed, 381 insertions(+), 46 deletions(-)
19
20 diff --git a/dev-util/valgrind/Manifest b/dev-util/valgrind/Manifest
21 index 3f9f2ec..361b725 100644
22 --- a/dev-util/valgrind/Manifest
23 +++ b/dev-util/valgrind/Manifest
24 @@ -1,4 +1,7 @@
25 -AUX valgrind-3.2.3-pkg-config.patch 670 RMD160 26d8f37182da50110e4c40c5be0ec9d06185d7fd SHA1 83bda9ceebc7c13586c5bcd49c809c72e2e7511d SHA256 ffd44e653b95326ef1915f406e35cca9a0898ba3e101965d0f6e4229c72c38d5
26 -AUX valgrind-3.3.0-only64bit.patch 580 RMD160 f4304ad005586541400e6c1466dabf8cdaac2b72 SHA1 7c890914ec0fd53b8de662783b230ec78e57e345 SHA256 23485d4b03c66db3c58f3a7e9d0aca439a50b87ea60f2edaaf94229b54a80ee9
27 -AUX valgrind-3.3.1-local-labels.patch 1186 RMD160 3eeb3a847f85b2b68e32ce5966539067103b12c1 SHA1 07c6afbc4eb2565404ffe12aa8cd0357fd736ab4 SHA256 79a0e65903ce1b7ec0c0759c4face9a23bd9724831bf0b8c201dced2dc7dbb71
28 -EBUILD valgrind-9999.ebuild 3043 RMD160 fe682d9f9874919645feb3242131895d9d67679c SHA1 7abcfb8b48ea8cbb307aba37fac312e95ef33153 SHA256 9212d78a07510a3af0040f19720fcd96440db21c91f6f3fdaaf5928aa7330436
29 +AUX valgrind-3.4.1-glibc-2.10.1.patch 1305 RMD160 27586a6140bc0c96589f7077a3c9ee266010ac9c SHA1 dc5df31911c93c98d7876fc6ad9157ab62b38de2 SHA256 b250a3f7e8654cbc835570b0647d035f25a866a51312a8c0d82119db474eddd6
30 +AUX valgrind-3.6.0-local-labels.patch 1388 RMD160 e9c0064d1e857f1e616c5d9ca7a03e78eae3d5ab SHA1 173820d5671f56c864850c2d8df9d6d301dfda38 SHA256 34ae13eda378677f1e662e0813f138de9b897d6592d20872c58ed8ac1bcf7def
31 +AUX valgrind-3.6.0-non-exec-stack.patch 5613 RMD160 641cd94fd5254ea902bd66eb0437e9af0e21fdb4 SHA1 eeb788f208303ef8768d4713c2c01bfd3f2edec4 SHA256 9a5a92506a10af32eba7a28401f061d4a84eac26a4dbb94fc6a19471c4bdb257
32 +AUX valgrind-9999-fix-as-needed.patch 1972 RMD160 c36b4681ceea6b081fbb8276e2bbfcb9499dc41c SHA1 5879f114e83e967cfe2b4e1851bb550a425cf1cf SHA256 56884cec2c5ab2414013ba0ff11e8330d11ba896776e8beb628e75759d2d48b7
33 +DIST valgrind-3.6.0.tar.bz2 5962204 RMD160 d7adc13bdafb1e5057d2e2a7a41076c1acabc368 SHA1 6f7ae88d36dfb45c337175a873aada7bed01c8c3 SHA256 bc0f0153b5a47b986f1d8efa2c488e0aea85a1cf2c4b11c52be127903080285f
34 +EBUILD valgrind-3.6.0.ebuild 2921 RMD160 e579ed554ae4e1c3467bc8604cd025315d2e58ad SHA1 04ad6ee87efd0b8206c2a3b9e871f8989140ef87 SHA256 3284fd2e68767d09cf45e0162a2911a67954afaf39edb1f6c15302060c49d57c
35 +EBUILD valgrind-9999.ebuild 2993 RMD160 c6b8042527b43ec86cb644e987444ebecb827b0a SHA1 3fa4c51399886bcc73fe38392190a77c489fd311 SHA256 25e09d961a888beff6fc5b54c2680cb21436f4fb005d2ad70c48f1cb42c9c22e
36
37 diff --git a/dev-util/valgrind/files/valgrind-3.4.1-glibc-2.10.1.patch b/dev-util/valgrind/files/valgrind-3.4.1-glibc-2.10.1.patch
38 new file mode 100644
39 index 0000000..393dc7c
40 --- /dev/null
41 +++ b/dev-util/valgrind/files/valgrind-3.4.1-glibc-2.10.1.patch
42 @@ -0,0 +1,49 @@
43 +--- valgrind-3.4.1/glibc-2.X.supp.in.jj 2009-03-01 17:04:51.000000000 -0500
44 ++++ valgrind-3.4.1/glibc-2.X.supp.in 2009-05-11 11:17:35.605396000 -0400
45 +@@ -168,9 +168,9 @@
46 + Memcheck:Param
47 + socketcall.sendto(msg)
48 + fun:__sendto_nocancel
49 +- obj:/*libc-@GLIBC_VERSION@.so
50 +- obj:/*libc-@GLIBC_VERSION@.so
51 +- obj:/*libc-@GLIBC_VERSION@.so
52 ++ obj:/*libc-@GLIBC_VERSION@*.so
53 ++ obj:/*libc-@GLIBC_VERSION@*.so
54 ++ obj:/*libc-@GLIBC_VERSION@*.so
55 + }
56 + {
57 + glibc24-64bit-padding-1c
58 +@@ -180,7 +180,7 @@
59 + fun:__nscd_get_map_ref
60 + fun:nscd_get*_r
61 + fun:*nscd*
62 +- obj:/*libc-@GLIBC_VERSION@.so
63 ++ obj:/*libc-@GLIBC_VERSION@*.so
64 + }
65 +
66 +
67 +@@ -199,18 +199,18 @@
68 + Memcheck:Param
69 + socketcall.sendto(msg)
70 + fun:send
71 +- obj:/*libc-@GLIBC_VERSION@.so
72 +- obj:/*libc-@GLIBC_VERSION@.so
73 +- obj:/*libc-@GLIBC_VERSION@.so
74 ++ obj:/*libc-@GLIBC_VERSION@*.so
75 ++ obj:/*libc-@GLIBC_VERSION@*.so
76 ++ obj:/*libc-@GLIBC_VERSION@*.so
77 + }
78 + {
79 + X11-64bit-padding-4b
80 + Memcheck:Param
81 + socketcall.send(msg)
82 + fun:send
83 +- obj:/*libc-@GLIBC_VERSION@.so
84 +- obj:/*libc-@GLIBC_VERSION@.so
85 +- obj:/*libc-@GLIBC_VERSION@.so
86 ++ obj:/*libc-@GLIBC_VERSION@*.so
87 ++ obj:/*libc-@GLIBC_VERSION@*.so
88 ++ obj:/*libc-@GLIBC_VERSION@*.so
89 + }
90 +
91 + ##----------------------------------------------------------------------##
92
93 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
94 new file mode 100644
95 index 0000000..68e6822
96 --- /dev/null
97 +++ b/dev-util/valgrind/files/valgrind-3.6.0-local-labels.patch
98 @@ -0,0 +1,24 @@
99 +--- coregrind/m_libcassert.c 2010-10-21 04:19:45.000000000 +0800
100 ++++ coregrind/m_libcassert.c 2010-10-24 20:23:17.800001876 +0800
101 +@@ -81,8 +81,8 @@
102 + { UInt cia, r1, lr; \
103 + __asm__ __volatile__( \
104 + "mflr 0;" /* r0 = lr */ \
105 +- "bl m_libcassert_get_ip;" /* lr = pc */ \
106 +- "m_libcassert_get_ip:\n" \
107 ++ "bl 0f;" /* lr = pc */ \
108 ++ "0:\n" \
109 + "mflr %0;" /* %0 = pc */ \
110 + "mtlr 0;" /* restore lr */ \
111 + "mr %1,1;" /* %1 = r1 */ \
112 +@@ -100,8 +100,8 @@
113 + { ULong cia, r1, lr; \
114 + __asm__ __volatile__( \
115 + "mflr 0;" /* r0 = lr */ \
116 +- "bl .m_libcassert_get_ip;" /* lr = pc */ \
117 +- ".m_libcassert_get_ip:\n" \
118 ++ "bl 0f;" /* lr = pc */ \
119 ++ "0:\n" \
120 + "mflr %0;" /* %0 = pc */ \
121 + "mtlr 0;" /* restore lr */ \
122 + "mr %1,1;" /* %1 = r1 */ \
123
124 diff --git a/dev-util/valgrind/files/valgrind-3.6.0-non-exec-stack.patch b/dev-util/valgrind/files/valgrind-3.6.0-non-exec-stack.patch
125 new file mode 100644
126 index 0000000..dc99694
127 --- /dev/null
128 +++ b/dev-util/valgrind/files/valgrind-3.6.0-non-exec-stack.patch
129 @@ -0,0 +1,137 @@
130 +diff -ruN valgrind-3.6.0.orig/coregrind/Makefile.am valgrind-3.6.0/coregrind/Makefile.am
131 +--- valgrind-3.6.0.orig/coregrind/Makefile.am 2010-10-21 04:19:45.000000000 +0800
132 ++++ valgrind-3.6.0/coregrind/Makefile.am 2010-10-24 20:39:42.655001876 +0800
133 +@@ -285,23 +285,12 @@
134 + m_demangle/demangle.c \
135 + m_demangle/dyn-string.c \
136 + m_demangle/safe-ctype.c \
137 +- m_dispatch/dispatch-x86-linux.S \
138 +- m_dispatch/dispatch-amd64-linux.S \
139 +- m_dispatch/dispatch-ppc32-linux.S \
140 +- m_dispatch/dispatch-ppc64-linux.S \
141 +- m_dispatch/dispatch-arm-linux.S \
142 +- m_dispatch/dispatch-ppc32-aix5.S \
143 +- m_dispatch/dispatch-ppc64-aix5.S \
144 +- m_dispatch/dispatch-x86-darwin.S \
145 +- m_dispatch/dispatch-amd64-darwin.S \
146 + m_initimg/initimg-linux.c \
147 + m_initimg/initimg-aix5.c \
148 + m_initimg/initimg-darwin.c \
149 + m_initimg/initimg-pathscan.c \
150 + m_mach/mach_basics.c \
151 + m_mach/mach_msg.c \
152 +- m_mach/mach_traps-x86-darwin.S \
153 +- m_mach/mach_traps-amd64-darwin.S \
154 + m_replacemalloc/replacemalloc_core.c \
155 + m_scheduler/scheduler.c \
156 + m_scheduler/sema.c \
157 +@@ -314,15 +303,6 @@
158 + m_sigframe/sigframe-ppc64-aix5.c \
159 + m_sigframe/sigframe-x86-darwin.c \
160 + m_sigframe/sigframe-amd64-darwin.c \
161 +- m_syswrap/syscall-x86-linux.S \
162 +- m_syswrap/syscall-amd64-linux.S \
163 +- m_syswrap/syscall-ppc32-linux.S \
164 +- m_syswrap/syscall-ppc64-linux.S \
165 +- m_syswrap/syscall-arm-linux.S \
166 +- m_syswrap/syscall-ppc32-aix5.S \
167 +- m_syswrap/syscall-ppc64-aix5.S \
168 +- m_syswrap/syscall-x86-darwin.S \
169 +- m_syswrap/syscall-amd64-darwin.S \
170 + m_syswrap/syswrap-main.c \
171 + m_syswrap/syswrap-generic.c \
172 + m_syswrap/syswrap-linux.c \
173 +@@ -343,6 +323,24 @@
174 + m_ume/main.c \
175 + m_ume/script.c
176 +
177 ++COREGRIND_SOURCES_COMMON += \
178 ++ m_dispatch/dispatch-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S \
179 ++ m_syswrap/syscall-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S
180 ++
181 ++if VGCONF_HAVE_PLATFORM_SEC
182 ++COREGRIND_SOURCES_COMMON += \
183 ++ m_dispatch/dispatch-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S \
184 ++ m_syswrap/syscall-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S
185 ++endif
186 ++
187 ++if VGCONF_OS_IS_DARWIN
188 ++COREGRIND_SOURCES_COMMON += \
189 ++ m_start-@VGCONF_ARCH_PRI@-darwin.S \
190 ++ m_start-@VGCONF_ARCH_SEC@-darwin.S \
191 ++ m_mach/mach_traps-@VGCONF_ARCH_PRI@-darwin.S \
192 ++ m_mach/mach_traps-@VGCONF_ARCH_SEC@-darwin.S
193 ++endif
194 ++
195 + libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
196 + $(COREGRIND_SOURCES_COMMON)
197 + nodist_libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
198 +diff -ruN valgrind-3.6.0.orig/coregrind/m_dispatch/dispatch-amd64-linux.S valgrind-3.6.0/coregrind/m_dispatch/dispatch-amd64-linux.S
199 +--- valgrind-3.6.0.orig/coregrind/m_dispatch/dispatch-amd64-linux.S 2010-10-21 04:19:39.000000000 +0800
200 ++++ valgrind-3.6.0/coregrind/m_dispatch/dispatch-amd64-linux.S 2010-10-24 20:39:41.462001899 +0800
201 +@@ -338,11 +338,11 @@
202 + ret
203 + .size VG_(run_a_noredir_translation), .-VG_(run_a_noredir_translation)
204 +
205 ++#endif // defined(VGP_amd64_linux)
206 ++
207 + /* Let the linker know we don't need an executable stack */
208 + .section .note.GNU-stack,"",@progbits
209 +
210 +-#endif // defined(VGP_amd64_linux)
211 +-
212 + /*--------------------------------------------------------------------*/
213 + /*--- end ---*/
214 + /*--------------------------------------------------------------------*/
215 +diff -ruN valgrind-3.6.0.orig/coregrind/m_dispatch/dispatch-x86-linux.S valgrind-3.6.0/coregrind/m_dispatch/dispatch-x86-linux.S
216 +--- valgrind-3.6.0.orig/coregrind/m_dispatch/dispatch-x86-linux.S 2010-10-21 04:19:39.000000000 +0800
217 ++++ valgrind-3.6.0/coregrind/m_dispatch/dispatch-x86-linux.S 2010-10-24 20:39:41.022001883 +0800
218 +@@ -304,12 +304,11 @@
219 + ret
220 + .size VG_(run_a_noredir_translation), .-VG_(run_a_noredir_translation)
221 +
222 ++#endif // defined(VGP_x86_linux)
223 +
224 + /* Let the linker know we don't need an executable stack */
225 + .section .note.GNU-stack,"",@progbits
226 +
227 +-#endif // defined(VGP_x86_linux)
228 +-
229 + /*--------------------------------------------------------------------*/
230 + /*--- end ---*/
231 + /*--------------------------------------------------------------------*/
232 +diff -ruN valgrind-3.6.0.orig/coregrind/m_syswrap/syscall-amd64-linux.S valgrind-3.6.0/coregrind/m_syswrap/syscall-amd64-linux.S
233 +--- valgrind-3.6.0.orig/coregrind/m_syswrap/syscall-amd64-linux.S 2010-10-21 04:19:41.000000000 +0800
234 ++++ valgrind-3.6.0/coregrind/m_syswrap/syscall-amd64-linux.S 2010-10-24 20:39:40.576001879 +0800
235 +@@ -205,11 +205,11 @@
236 + ML_(blksys_finished): .quad 5b
237 + .previous
238 +
239 ++#endif // defined(VGP_amd64_linux)
240 ++
241 + /* Let the linker know we don't need an executable stack */
242 + .section .note.GNU-stack,"",@progbits
243 +
244 +-#endif // defined(VGP_amd64_linux)
245 +-
246 + /*--------------------------------------------------------------------*/
247 + /*--- end ---*/
248 + /*--------------------------------------------------------------------*/
249 +diff -ruN valgrind-3.6.0.orig/coregrind/m_syswrap/syscall-x86-linux.S valgrind-3.6.0/coregrind/m_syswrap/syscall-x86-linux.S
250 +--- valgrind-3.6.0.orig/coregrind/m_syswrap/syscall-x86-linux.S 2010-10-21 04:19:41.000000000 +0800
251 ++++ valgrind-3.6.0/coregrind/m_syswrap/syscall-x86-linux.S 2010-10-24 20:39:40.152001876 +0800
252 +@@ -164,12 +164,12 @@
253 + ML_(blksys_committed): .long 4b
254 + ML_(blksys_finished): .long 5b
255 + .previous
256 ++
257 ++#endif // defined(VGP_x86_linux)
258 +
259 + /* Let the linker know we don't need an executable stack */
260 + .section .note.GNU-stack,"",@progbits
261 +
262 +-#endif // defined(VGP_x86_linux)
263 +-
264 + /*--------------------------------------------------------------------*/
265 + /*--- end ---*/
266 + /*--------------------------------------------------------------------*/
267
268 diff --git a/dev-util/valgrind/files/valgrind-9999-fix-as-needed.patch b/dev-util/valgrind/files/valgrind-9999-fix-as-needed.patch
269 new file mode 100644
270 index 0000000..8ca0393
271 --- /dev/null
272 +++ b/dev-util/valgrind/files/valgrind-9999-fix-as-needed.patch
273 @@ -0,0 +1,29 @@
274 +Fix library link order.
275 +
276 +x86_64-pc-linux-gnu-gcc -m64 -fomit-frame-pointer -fno-stack-protector -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-format-zero-length -fno-strict-aliasing -Wno-long-long -O2 -pipe -ggdb -nopie -fno-stack-protector -Wno-pointer-sign -fno-stack-protector -m64 -fomit-frame-pointer -fno-stack-protector -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-format-zero-length -fno-strict-aliasing -lpthread -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -o vgdb vgdb-vgdb.o
277 +vgdb-vgdb.o: In function `received_signal':
278 +valgrind-9999/work/valgrind-9999/coregrind/vgdb.c:1547: undefined reference to `pthread_cancel'
279 +vgdb-vgdb.o: In function `close_connection':
280 +valgrind-9999/work/valgrind-9999/coregrind/vgdb.c:1650: undefined reference to `pthread_join'
281 +vgdb-vgdb.o: In function `standalone_send_commands':
282 +valgrind-9999/work/valgrind-9999/coregrind/vgdb.c:1796: undefined reference to `pthread_create'
283 +vgdb-vgdb.o: In function `gdb_relay':
284 +/var/tmp/paludis/dev-util-valgrind-9999/work/valgrind-9999/coregrind/vgdb.c:1673: undefined reference to `pthread_create'
285 +vgdb-vgdb.o: In function `invoke_gdbserver_in_valgrind':
286 +valgrind-9999/work/valgrind-9999/coregrind/vgdb.c:1131: undefined reference to `__pthread_register_cancel'
287 +valgrind-9999/work/valgrind-9999/coregrind/vgdb.c:1221: undefined reference to `__pthread_unregister_cancel'
288 +
289 +Breakage found by Diego Pettenò.
290 +diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
291 +index 6d57695..29fa297 100644
292 +--- a/coregrind/Makefile.am
293 ++++ b/coregrind/Makefile.am
294 +@@ -58,7 +58,7 @@ vgdb_CFLAGS = $(AM_CFLAGS_PRI)
295 + vgdb_CCASFLAGS = $(AM_CCASFLAGS_PRI)
296 + vgdb_LDFLAGS = $(AM_CFLAGS_PRI)
297 + if !VGCONF_PLATVARIANT_IS_ANDROID
298 +-vgdb_LDFLAGS += -lpthread
299 ++vgdb_LDADD = -lpthread
300 + endif
301 + if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
302 + vgdb_LDFLAGS += -Wl,-read_only_relocs -Wl,suppress
303
304 diff --git a/dev-util/valgrind/valgrind-3.6.0.ebuild b/dev-util/valgrind/valgrind-3.6.0.ebuild
305 new file mode 100644
306 index 0000000..b2be0c0
307 --- /dev/null
308 +++ b/dev-util/valgrind/valgrind-3.6.0.ebuild
309 @@ -0,0 +1,90 @@
310 +# Copyright 1999-2010 Gentoo Foundation
311 +# Distributed under the terms of the GNU General Public License v2
312 +# $Header: /var/cvsroot/gentoo-x86/dev-util/valgrind/valgrind-3.6.0.ebuild,v 1.1 2010/11/10 01:40:41 blueness Exp $
313 +
314 +EAPI=2
315 +inherit autotools eutils flag-o-matic toolchain-funcs multilib pax-utils
316 +
317 +DESCRIPTION="An open-source memory debugger for GNU/Linux"
318 +HOMEPAGE="http://www.valgrind.org"
319 +SRC_URI="http://www.valgrind.org/downloads/${P}.tar.bz2"
320 +
321 +LICENSE="GPL-2"
322 +SLOT="0"
323 +KEYWORDS="-* ~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
324 +IUSE="mpi"
325 +
326 +DEPEND="mpi? ( virtual/mpi )"
327 +RDEPEND="${DEPEND}"
328 +
329 +src_prepare() {
330 + # Respect CFLAGS, LDFLAGS
331 + sed -i -e '/^CPPFLAGS =/d' -e '/^CFLAGS =/d' -e '/^LDFLAGS =/d' \
332 + mpi/Makefile.am || die
333 +
334 + # Changing Makefile.all.am to disable SSP
335 + sed -i -e 's:^AM_CFLAGS_BASE = :AM_CFLAGS_BASE = -fno-stack-protector :' \
336 + Makefile.all.am || die
337 +
338 + # Correct hard coded doc location
339 + sed -i -e "s:doc/valgrind:doc/${PF}:" \
340 + docs/Makefile.am || die
341 +
342 + # Yet more local labels, this time for ppc32 & ppc64
343 + epatch "${FILESDIR}/valgrind-3.6.0-local-labels.patch"
344 +
345 + # Don't build in empty assembly files for other platforms or we'll get a QA
346 + # warning about executable stacks.
347 + epatch "${FILESDIR}/valgrind-3.6.0-non-exec-stack.patch"
348 +
349 + # Fix up some suppressions that were not general enough for glibc versions
350 + # with more than just a major and minor number.
351 + epatch "${FILESDIR}/valgrind-3.4.1-glibc-2.10.1.patch"
352 +
353 + # Regenerate autotools files
354 + eautoreconf
355 +}
356 +
357 +src_configure() {
358 + local myconf
359 +
360 + # -fomit-frame-pointer "Assembler messages: Error: junk `8' after expression"
361 + # while compiling insn_sse.c in none/tests/x86
362 + # -fpie valgrind seemingly hangs when built with pie on
363 + # amd64 (bug #102157)
364 + # -fstack-protector more undefined references to __guard and __stack_smash_handler
365 + # because valgrind doesn't link to glibc (bug #114347)
366 + # -ggdb3 segmentation fault on startup
367 + filter-flags -fomit-frame-pointer
368 + filter-flags -fpie
369 + filter-flags -fstack-protector
370 + replace-flags -ggdb3 -ggdb2
371 +
372 + if use amd64 || use ppc64; then
373 + ! has_multilib_profile && myconf="${myconf} --enable-only64bit"
374 + fi
375 +
376 + # Don't use mpicc unless the user asked for it (bug #258832)
377 + if ! use mpi; then
378 + myconf="${myconf} --without-mpicc"
379 + fi
380 +
381 + econf ${myconf}
382 +}
383 +
384 +src_install() {
385 + emake DESTDIR="${D}" install || die
386 + dodoc AUTHORS FAQ.txt NEWS README*
387 +
388 + pax-mark m "${D}"/usr/$(get_libdir)/valgrind/*-*-linux
389 +}
390 +
391 +pkg_postinst() {
392 + if use ppc || use ppc64 || use amd64 ; then
393 + ewarn "Valgrind will not work on ppc, ppc64 or amd64 if glibc does not have"
394 + ewarn "debug symbols (see https://bugs.gentoo.org/show_bug.cgi?id=214065"
395 + ewarn "and http://bugs.gentoo.org/show_bug.cgi?id=274771)."
396 + ewarn "To fix this you can add splitdebug to FEATURES in make.conf and"
397 + ewarn "remerge glibc."
398 + fi
399 +}
400
401 diff --git a/dev-util/valgrind/valgrind-9999.ebuild b/dev-util/valgrind/valgrind-9999.ebuild
402 index 6904201..1891a59 100644
403 --- a/dev-util/valgrind/valgrind-9999.ebuild
404 +++ b/dev-util/valgrind/valgrind-9999.ebuild
405 @@ -1,50 +1,55 @@
406 -# Copyright 1999-2008 Gentoo Foundation
407 +# Copyright 1999-2010 Gentoo Foundation
408 # Distributed under the terms of the GNU General Public License v2
409 -# $Header: /var/cvsroot/gentoo-x86/dev-util/valgrind/valgrind-3.3.1.ebuild,v 1.6 2008/08/24 11:41:59 corsair Exp $
410 +# $Header: /var/cvsroot/gentoo-x86/dev-util/valgrind/valgrind-3.6.0.ebuild,v 1.1 2010/11/10 01:40:41 blueness Exp $
411
412 -ESVN_REPO_URI="svn://svn.valgrind.org/valgrind/trunk"
413 -
414 -inherit autotools eutils flag-o-matic toolchain-funcs subversion
415 +EAPI=2
416 +inherit autotools eutils flag-o-matic toolchain-funcs multilib pax-utils subversion
417
418 DESCRIPTION="An open-source memory debugger for GNU/Linux"
419 HOMEPAGE="http://www.valgrind.org"
420 +ESVN_REPO_URI="svn://svn.valgrind.org/valgrind/trunk"
421 +ESVN_PROJECT="valgrind"
422 +SRC_URI=""
423
424 LICENSE="GPL-2"
425 SLOT="0"
426 KEYWORDS=""
427 -IUSE="X"
428 -
429 -RDEPEND="!dev-util/callgrind"
430 +IUSE="mpi"
431
432 -src_unpack() {
433 - subversion_src_unpack
434 - cd "${S}"
435 +DEPEND="mpi? ( virtual/mpi )"
436 +RDEPEND="${DEPEND}"
437
438 - # make sure our CFLAGS are respected
439 - einfo "Changing configure.in to respect CFLAGS"
440 - sed -i -e 's:^CFLAGS="-Wno-long-long":CFLAGS="$CFLAGS -Wno-long-long":' configure.in
441 +src_prepare() {
442 + # Respect CFLAGS, LDFLAGS
443 + sed -i -e '/^CPPFLAGS =/d' -e '/^CFLAGS =/d' -e '/^LDFLAGS =/d' \
444 + mpi/Makefile.am || die
445
446 - # undefined references to __guard and __stack_smash_handler in VEX (bug #114347)
447 - einfo "Changing Makefile.flags.am to disable SSP"
448 - sed -i -e 's:^AM_CFLAGS_BASE = :AM_CFLAGS_BASE = -fno-stack-protector :' Makefile.flags.am
449 + # Changing Makefile.all.am to disable SSP
450 + sed -i -e 's:^AM_CFLAGS_BASE = :AM_CFLAGS_BASE = -fno-stack-protector :' \
451 + Makefile.all.am || die
452
453 # Correct hard coded doc location
454 - sed -i -e "s:doc/valgrind:doc/${P}:" docs/Makefile.am
455 + sed -i -e "s:doc/valgrind:doc/${PF}:" \
456 + docs/Makefile.am || die
457
458 - # Remove defaulting to ppc32-linux on ppc64 without multilib
459 - # "valgrind: failed to start tool 'memcheck' for platform 'ppc32-linux':
460 - # No such file or directory"
461 - if use ppc64 && ! has_multilib_profile; then
462 - epatch "${FILESDIR}/valgrind-3.3.0-only64bit.patch"
463 - fi
464 + # Yet more local labels, this time for ppc32 & ppc64
465 + epatch "${FILESDIR}/valgrind-3.6.0-local-labels.patch"
466 +
467 + #### Don't build in empty assembly files for other platforms or we'll get a QA
468 + #### warning about executable stacks.
469 + ### epatch "${FILESDIR}/valgrind-3.6.0-non-exec-stack.patch"
470 +
471 + ### # Fix up some suppressions that were not general enough for glibc versions
472 + ### # with more than just a major and minor number.
473 + ### epatch "${FILESDIR}/valgrind-3.4.1-glibc-2.10.1.patch"
474
475 - sed -i -e 's:@GLIBC_VERSION@\.so:@GLIBC_VERSION@*.so:' glibc-2.X.supp.in || die
476 + epatch "${FILESDIR}/valgrind-9999-fix-as-needed.patch"
477
478 # Regenerate autotools files
479 eautoreconf
480 }
481
482 -src_compile() {
483 +src_configure() {
484 local myconf
485
486 # -fomit-frame-pointer "Assembler messages: Error: junk `8' after expression"
487 @@ -59,32 +64,30 @@ src_compile() {
488 filter-flags -fstack-protector
489 replace-flags -ggdb3 -ggdb2
490
491 - # gcc 3.3.x fails to compile valgrind with -O3 (bug #129776)
492 - if [ "$(gcc-version)" == "3.3" ] && is-flagq -O3; then
493 - ewarn "GCC 3.3 cannot compile valgrind with -O3 in CFLAGS, using -O2 instead."
494 - replace-flags -O3 -O2
495 - fi
496 -
497 - # Optionally build in X suppression files
498 - use X && myconf="--with-x" || myconf="--with-x=no"
499 -
500 if use amd64 || use ppc64; then
501 ! has_multilib_profile && myconf="${myconf} --enable-only64bit"
502 fi
503
504 - econf ${myconf} --without-mpicc || die "Configure failed!"
505 - emake || die "Make failed!"
506 + # Don't use mpicc unless the user asked for it (bug #258832)
507 + if ! use mpi; then
508 + myconf="${myconf} --without-mpicc"
509 + fi
510 +
511 + econf ${myconf}
512 }
513
514 src_install() {
515 - make DESTDIR="${D}" install || die "Install failed!"
516 - dodoc ACKNOWLEDGEMENTS AUTHORS FAQ.txt NEWS README*
517 + emake DESTDIR="${D}" install || die
518 + dodoc AUTHORS FAQ.txt NEWS README*
519 +
520 + pax-mark m "${D}"/usr/$(get_libdir)/valgrind/*-*-linux
521 }
522
523 pkg_postinst() {
524 - if use ppc || use ppc64 ; then
525 - ewarn "Valgrind will not work on ppc or ppc64 if glibc does not have"
526 - ewarn "debug symbols (see https://bugs.gentoo.org/show_bug.cgi?id=214065)"
527 + if use ppc || use ppc64 || use amd64 ; then
528 + ewarn "Valgrind will not work on ppc, ppc64 or amd64 if glibc does not have"
529 + ewarn "debug symbols (see https://bugs.gentoo.org/show_bug.cgi?id=214065"
530 + ewarn "and http://bugs.gentoo.org/show_bug.cgi?id=274771)."
531 ewarn "To fix this you can add splitdebug to FEATURES in make.conf and"
532 ewarn "remerge glibc."
533 fi