summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-util/valgrind
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-util/valgrind')
-rw-r--r--dev-util/valgrind/Manifest4
-rw-r--r--dev-util/valgrind/files/valgrind-3.10.0-non-exec-stack.patch148
-rw-r--r--dev-util/valgrind/files/valgrind-3.10.1-glibc-2.21.patch17
-rw-r--r--dev-util/valgrind/files/valgrind-3.10.1-linux-4.patch29
-rw-r--r--dev-util/valgrind/files/valgrind-3.10.1-non-exec-stack.patch148
-rw-r--r--dev-util/valgrind/files/valgrind-3.6.0-local-labels.patch24
-rw-r--r--dev-util/valgrind/files/valgrind-3.7.0-automake-1.11.2.patch37
-rw-r--r--dev-util/valgrind/files/valgrind-3.7.0-fix-gcc-regex.patch35
-rw-r--r--dev-util/valgrind/files/valgrind-3.7.0-fno-stack-protector.patch12
-rw-r--r--dev-util/valgrind/files/valgrind-3.7.0-glibc-2.15.patch26
-rw-r--r--dev-util/valgrind/files/valgrind-3.7.0-non-exec-stack-v2.patch143
-rw-r--r--dev-util/valgrind/files/valgrind-3.7.0-non-exec-stack.patch138
-rw-r--r--dev-util/valgrind/files/valgrind-3.7.0-respect-flags.patch13
-rw-r--r--dev-util/valgrind/files/valgrind-3.8.0-non-exec-stack.patch142
-rw-r--r--dev-util/valgrind/files/valgrind-3.8.1-gcc-4.8-memmove.patch26
-rw-r--r--dev-util/valgrind/files/valgrind-3.8.1-glibc-2.17.patch26
-rw-r--r--dev-util/valgrind/files/valgrind-3.9.0-glibc-2.19.patch37
-rw-r--r--dev-util/valgrind/files/valgrind-3.9.0-non-exec-stack.patch144
-rw-r--r--dev-util/valgrind/metadata.xml24
-rw-r--r--dev-util/valgrind/valgrind-3.10.1.ebuild115
-rw-r--r--dev-util/valgrind/valgrind-3.7.0-r4.ebuild109
-rw-r--r--dev-util/valgrind/valgrind-3.8.1.ebuild106
-rw-r--r--dev-util/valgrind/valgrind-3.9.0.ebuild106
23 files changed, 1609 insertions, 0 deletions
diff --git a/dev-util/valgrind/Manifest b/dev-util/valgrind/Manifest
new file mode 100644
index 000000000000..1073c90a648e
--- /dev/null
+++ b/dev-util/valgrind/Manifest
@@ -0,0 +1,4 @@
+DIST valgrind-3.10.1.tar.bz2 10967905 SHA256 fa253dc26ddb661b6269df58144eff607ea3f76a9bcfe574b0c7726e1dfcb997 SHA512 8f3d27637c13b06381b3dd44088244e0cf2f7008f40e46f34322f2a5bfa6373d29ce68ff49f19c48f1a5f139d8be5838b9606206e0ce2599c5f74c0db8ce2642 WHIRLPOOL 3d55f35b02195d9859d9192726ea708277f1d3339005d959baa224822c5b71f5347cdd28c7fd8153c10d1e3282855e853caf9c7192751bebdbbc3444c33d885a
+DIST valgrind-3.7.0.tar.bz2 6624216 SHA256 5d62c0330f1481fe2c593249192fa68ff454c19c34343978cc9ce91aa324cbf6 SHA512 0ccf6607fe6d26f0dc0f3d6e45f84645925d0a90ce4ecf6acfc6b4d374d3e909b2a628b03c0a964a45d2462cca6877f818a5f72b3e4a5bbf3a2d9b8a9a343d5f WHIRLPOOL 44bf8c423d6f3222f5e777333acc21e94dfa680509b2152289129961296d8afc090466b6407248b6e172b3c42da5448206f257bd63f8e44aba01007f92a6fde1
+DIST valgrind-3.8.1.tar.bz2 7962963 SHA256 473be00576bed311a662b277a2bfbe97d9cca4058e68619a0e420c9fc19958db SHA512 ba31f5d43bd2d9533846bed6456a0eae40ac071ff8732201dd75c9e2cd7e9ce3224cb5928b9c8fc859a75ce6867a9b6a1fb2ba8ab62cd3944893d6d4156ab25c WHIRLPOOL 81e63bb649455ed29fcd60fc7f3cebde456a610118b9b24530d3b2e8aa4a7561369e992af86ffb158e1f7fc0db7b91738564402931a947a79bb789bd26a8e065
+DIST valgrind-3.9.0.tar.bz2 10003156 SHA256 e6af71a06bc2534541b07743e1d58dc3caf744f38205ca3e5b5a0bdf372ed6f0 SHA512 4b748f9f9a647df50db75fb56f83ee2f25bad9f1f4e4f05c4ac1d1e919e6cd954975c1f325dbedb509c44be1a8516ac2a5f269090946a0d728166ab183016c7b WHIRLPOOL e73c4dcdff829a34889f5654c5ec314f32d2c33f9e64bde3f811359a252749a6c677db80bf2aa2647f935cd38a0ccc19c0358a7b13198032c5d636f97e9e71de
diff --git a/dev-util/valgrind/files/valgrind-3.10.0-non-exec-stack.patch b/dev-util/valgrind/files/valgrind-3.10.0-non-exec-stack.patch
new file mode 100644
index 000000000000..d4ae13d45cf1
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.10.0-non-exec-stack.patch
@@ -0,0 +1,148 @@
+diff -Naur valgrind-3.10.0.orig/coregrind/Makefile.am valgrind-3.10.0/coregrind/Makefile.am
+--- valgrind-3.10.0.orig/coregrind/Makefile.am 2014-09-08 08:28:30.000000000 -0400
++++ valgrind-3.10.0/coregrind/Makefile.am 2014-09-12 20:54:25.720389938 -0400
+@@ -333,18 +333,6 @@
+ m_demangle/demangle.c \
+ m_demangle/dyn-string.c \
+ m_demangle/safe-ctype.c \
+- m_dispatch/dispatch-x86-linux.S \
+- m_dispatch/dispatch-amd64-linux.S \
+- m_dispatch/dispatch-ppc32-linux.S \
+- m_dispatch/dispatch-ppc64be-linux.S \
+- m_dispatch/dispatch-ppc64le-linux.S \
+- m_dispatch/dispatch-arm-linux.S \
+- m_dispatch/dispatch-arm64-linux.S \
+- m_dispatch/dispatch-s390x-linux.S \
+- m_dispatch/dispatch-mips32-linux.S \
+- m_dispatch/dispatch-mips64-linux.S \
+- m_dispatch/dispatch-x86-darwin.S \
+- m_dispatch/dispatch-amd64-darwin.S \
+ m_gdbserver/inferiors.c \
+ m_gdbserver/m_gdbserver.c \
+ m_gdbserver/regcache.c \
+@@ -368,8 +356,6 @@
+ m_initimg/initimg-pathscan.c \
+ m_mach/mach_basics.c \
+ m_mach/mach_msg.c \
+- m_mach/mach_traps-x86-darwin.S \
+- m_mach/mach_traps-amd64-darwin.S \
+ m_replacemalloc/replacemalloc_core.c \
+ m_scheduler/scheduler.c \
+ m_scheduler/sema.c \
+@@ -386,18 +372,6 @@
+ m_sigframe/sigframe-mips64-linux.c \
+ m_sigframe/sigframe-x86-darwin.c \
+ m_sigframe/sigframe-amd64-darwin.c \
+- m_syswrap/syscall-x86-linux.S \
+- m_syswrap/syscall-amd64-linux.S \
+- m_syswrap/syscall-ppc32-linux.S \
+- m_syswrap/syscall-ppc64be-linux.S \
+- m_syswrap/syscall-ppc64le-linux.S \
+- m_syswrap/syscall-arm-linux.S \
+- m_syswrap/syscall-arm64-linux.S \
+- m_syswrap/syscall-s390x-linux.S \
+- m_syswrap/syscall-mips32-linux.S \
+- m_syswrap/syscall-mips64-linux.S \
+- m_syswrap/syscall-x86-darwin.S \
+- m_syswrap/syscall-amd64-darwin.S \
+ m_syswrap/syswrap-main.c \
+ m_syswrap/syswrap-generic.c \
+ m_syswrap/syswrap-linux.c \
+@@ -420,6 +394,29 @@
+ m_ume/main.c \
+ m_ume/script.c
+
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S \
++ m_syswrap/syscall-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S
++
++if VGCONF_HAVE_PLATFORM_SEC
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S \
++ m_syswrap/syscall-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S
++endif
++
++if VGCONF_OS_IS_DARWIN
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_PRI@-darwin.S \
++ m_syswrap/syscall-@VGCONF_ARCH_PRI@-darwin.S \
++ m_mach/mach_traps-@VGCONF_ARCH_PRI@-darwin.S
++if VGCONF_HAVE_PLATFORM_SEC
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_SEC@-darwin.S \
++ m_syswrap/syscall-@VGCONF_ARCH_SEC@-darwin.S \
++ m_mach/mach_traps-@VGCONF_ARCH_SEC@-darwin.S
++endif
++endif
++
+ libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
+ $(COREGRIND_SOURCES_COMMON)
+ nodist_libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
+diff -Naur valgrind-3.10.0.orig/coregrind/m_dispatch/dispatch-amd64-linux.S valgrind-3.10.0/coregrind/m_dispatch/dispatch-amd64-linux.S
+--- valgrind-3.10.0.orig/coregrind/m_dispatch/dispatch-amd64-linux.S 2014-09-08 08:28:46.000000000 -0400
++++ valgrind-3.10.0/coregrind/m_dispatch/dispatch-amd64-linux.S 2014-09-12 20:49:14.681385751 -0400
+@@ -249,11 +249,11 @@
+
+ .size VG_(disp_run_translations), .-VG_(disp_run_translations)
+
++#endif // defined(VGP_amd64_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_amd64_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.10.0.orig/coregrind/m_dispatch/dispatch-x86-linux.S valgrind-3.10.0/coregrind/m_dispatch/dispatch-x86-linux.S
+--- valgrind-3.10.0.orig/coregrind/m_dispatch/dispatch-x86-linux.S 2014-09-08 08:28:46.000000000 -0400
++++ valgrind-3.10.0/coregrind/m_dispatch/dispatch-x86-linux.S 2014-09-12 20:49:14.681385751 -0400
+@@ -240,11 +240,11 @@
+
+ .size VG_(disp_run_translations), .-VG_(disp_run_translations)
+
++#endif // defined(VGP_x86_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_x86_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.10.0.orig/coregrind/m_syswrap/syscall-amd64-linux.S valgrind-3.10.0/coregrind/m_syswrap/syscall-amd64-linux.S
+--- valgrind-3.10.0.orig/coregrind/m_syswrap/syscall-amd64-linux.S 2014-09-08 08:28:45.000000000 -0400
++++ valgrind-3.10.0/coregrind/m_syswrap/syscall-amd64-linux.S 2014-09-12 20:49:14.681385751 -0400
+@@ -205,11 +205,11 @@
+ ML_(blksys_finished): .quad 5b
+ .previous
+
++#endif // defined(VGP_amd64_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_amd64_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.10.0.orig/coregrind/m_syswrap/syscall-x86-linux.S valgrind-3.10.0/coregrind/m_syswrap/syscall-x86-linux.S
+--- valgrind-3.10.0.orig/coregrind/m_syswrap/syscall-x86-linux.S 2014-09-08 08:28:45.000000000 -0400
++++ valgrind-3.10.0/coregrind/m_syswrap/syscall-x86-linux.S 2014-09-12 20:49:14.681385751 -0400
+@@ -165,11 +165,11 @@
+ ML_(blksys_finished): .long 5b
+ .previous
+
++#endif // defined(VGP_x86_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_x86_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
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
new file mode 100644
index 000000000000..286e431b0dd6
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.10.1-glibc-2.21.patch
@@ -0,0 +1,17 @@
+diff -Naur valgrind-3.10.1.orig/configure.ac valgrind-3.10.1/configure.ac
+--- valgrind-3.10.1.orig/configure.ac 2014-11-25 14:41:13.000000000 -0500
++++ valgrind-3.10.1/configure.ac 2015-07-28 22:35:22.315604804 -0400
+@@ -1018,6 +1018,13 @@
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
++ 2.21)
++ AC_MSG_RESULT(2.21 family)
++ AC_DEFINE([GLIBC_2_21], 1, [Define to 1 if you're using glibc 2.21.x])
++ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ ;;
+ darwin)
+ AC_MSG_RESULT(Darwin)
+ AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
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
new file mode 100644
index 000000000000..63918c2c1d0e
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.10.1-linux-4.patch
@@ -0,0 +1,29 @@
+From ecb3746d69820905c076b89e1be7042f52ceaa5f Mon Sep 17 00:00:00 2001
+From: Janne Grunau <j@jannau.net>
+Date: Thu, 19 Mar 2015 22:44:51 +0100
+Subject: [PATCH 1/1] configure: support linux 4.*
+
+There is nothing special in linux 4.0. Handle it as another 3.* (or
+another 2.6.*) release. Compare changeset 14955 in valgrind's
+subversion repository. Valgrind trunk also drops support for linux 2.4
+but there is no need to do that for realeased software.
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0fd2a41..33c7954 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -303,7 +303,7 @@ case "${host_os}" in
+ kernel=`uname -r`
+
+ case "${kernel}" in
+- 2.6.*|3.*)
++ 2.6.*|3.*|4.*)
+ AC_MSG_RESULT([2.6.x/3.x family (${kernel})])
+ AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x or Linux 3.x])
+ ;;
+--
+2.3.3
+
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
new file mode 100644
index 000000000000..e25de99e7902
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.10.1-non-exec-stack.patch
@@ -0,0 +1,148 @@
+diff -Naur valgrind-3.10.1.orig/coregrind/Makefile.am valgrind-3.10.1/coregrind/Makefile.am
+--- valgrind-3.10.1.orig/coregrind/Makefile.am 2014-11-25 14:41:19.000000000 -0500
++++ valgrind-3.10.1/coregrind/Makefile.am 2014-11-26 13:36:44.113678744 -0500
+@@ -333,18 +333,6 @@
+ m_demangle/demangle.c \
+ m_demangle/dyn-string.c \
+ m_demangle/safe-ctype.c \
+- m_dispatch/dispatch-x86-linux.S \
+- m_dispatch/dispatch-amd64-linux.S \
+- m_dispatch/dispatch-ppc32-linux.S \
+- m_dispatch/dispatch-ppc64be-linux.S \
+- m_dispatch/dispatch-ppc64le-linux.S \
+- m_dispatch/dispatch-arm-linux.S \
+- m_dispatch/dispatch-arm64-linux.S \
+- m_dispatch/dispatch-s390x-linux.S \
+- m_dispatch/dispatch-mips32-linux.S \
+- m_dispatch/dispatch-mips64-linux.S \
+- m_dispatch/dispatch-x86-darwin.S \
+- m_dispatch/dispatch-amd64-darwin.S \
+ m_gdbserver/inferiors.c \
+ m_gdbserver/m_gdbserver.c \
+ m_gdbserver/regcache.c \
+@@ -368,8 +356,6 @@
+ m_initimg/initimg-pathscan.c \
+ m_mach/mach_basics.c \
+ m_mach/mach_msg.c \
+- m_mach/mach_traps-x86-darwin.S \
+- m_mach/mach_traps-amd64-darwin.S \
+ m_replacemalloc/replacemalloc_core.c \
+ m_scheduler/scheduler.c \
+ m_scheduler/sema.c \
+@@ -386,18 +372,6 @@
+ m_sigframe/sigframe-mips64-linux.c \
+ m_sigframe/sigframe-x86-darwin.c \
+ m_sigframe/sigframe-amd64-darwin.c \
+- m_syswrap/syscall-x86-linux.S \
+- m_syswrap/syscall-amd64-linux.S \
+- m_syswrap/syscall-ppc32-linux.S \
+- m_syswrap/syscall-ppc64be-linux.S \
+- m_syswrap/syscall-ppc64le-linux.S \
+- m_syswrap/syscall-arm-linux.S \
+- m_syswrap/syscall-arm64-linux.S \
+- m_syswrap/syscall-s390x-linux.S \
+- m_syswrap/syscall-mips32-linux.S \
+- m_syswrap/syscall-mips64-linux.S \
+- m_syswrap/syscall-x86-darwin.S \
+- m_syswrap/syscall-amd64-darwin.S \
+ m_syswrap/syswrap-main.c \
+ m_syswrap/syswrap-generic.c \
+ m_syswrap/syswrap-linux.c \
+@@ -420,6 +394,29 @@
+ m_ume/main.c \
+ m_ume/script.c
+
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S \
++ m_syswrap/syscall-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S
++
++if VGCONF_HAVE_PLATFORM_SEC
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S \
++ m_syswrap/syscall-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S
++endif
++
++if VGCONF_OS_IS_DARWIN
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_PRI@-darwin.S \
++ m_syswrap/syscall-@VGCONF_ARCH_PRI@-darwin.S \
++ m_mach/mach_traps-@VGCONF_ARCH_PRI@-darwin.S
++if VGCONF_HAVE_PLATFORM_SEC
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_SEC@-darwin.S \
++ m_syswrap/syscall-@VGCONF_ARCH_SEC@-darwin.S \
++ m_mach/mach_traps-@VGCONF_ARCH_SEC@-darwin.S
++endif
++endif
++
+ libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
+ $(COREGRIND_SOURCES_COMMON)
+ nodist_libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
+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
+--- valgrind-3.10.1.orig/coregrind/m_dispatch/dispatch-amd64-linux.S 2014-11-25 14:41:20.000000000 -0500
++++ valgrind-3.10.1/coregrind/m_dispatch/dispatch-amd64-linux.S 2014-11-26 13:30:11.840660890 -0500
+@@ -249,11 +249,11 @@
+
+ .size VG_(disp_run_translations), .-VG_(disp_run_translations)
+
++#endif // defined(VGP_amd64_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_amd64_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+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
+--- valgrind-3.10.1.orig/coregrind/m_dispatch/dispatch-x86-linux.S 2014-11-25 14:41:20.000000000 -0500
++++ valgrind-3.10.1/coregrind/m_dispatch/dispatch-x86-linux.S 2014-11-26 13:30:11.840660890 -0500
+@@ -240,11 +240,11 @@
+
+ .size VG_(disp_run_translations), .-VG_(disp_run_translations)
+
++#endif // defined(VGP_x86_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_x86_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+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
+--- valgrind-3.10.1.orig/coregrind/m_syswrap/syscall-amd64-linux.S 2014-11-25 14:41:20.000000000 -0500
++++ valgrind-3.10.1/coregrind/m_syswrap/syscall-amd64-linux.S 2014-11-26 13:30:11.840660890 -0500
+@@ -205,11 +205,11 @@
+ ML_(blksys_finished): .quad 5b
+ .previous
+
++#endif // defined(VGP_amd64_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_amd64_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+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
+--- valgrind-3.10.1.orig/coregrind/m_syswrap/syscall-x86-linux.S 2014-11-25 14:41:20.000000000 -0500
++++ valgrind-3.10.1/coregrind/m_syswrap/syscall-x86-linux.S 2014-11-26 13:30:11.840660890 -0500
+@@ -165,11 +165,11 @@
+ ML_(blksys_finished): .long 5b
+ .previous
+
++#endif // defined(VGP_x86_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_x86_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
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
new file mode 100644
index 000000000000..68e682255611
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.6.0-local-labels.patch
@@ -0,0 +1,24 @@
+--- coregrind/m_libcassert.c 2010-10-21 04:19:45.000000000 +0800
++++ coregrind/m_libcassert.c 2010-10-24 20:23:17.800001876 +0800
+@@ -81,8 +81,8 @@
+ { UInt cia, r1, lr; \
+ __asm__ __volatile__( \
+ "mflr 0;" /* r0 = lr */ \
+- "bl m_libcassert_get_ip;" /* lr = pc */ \
+- "m_libcassert_get_ip:\n" \
++ "bl 0f;" /* lr = pc */ \
++ "0:\n" \
+ "mflr %0;" /* %0 = pc */ \
+ "mtlr 0;" /* restore lr */ \
+ "mr %1,1;" /* %1 = r1 */ \
+@@ -100,8 +100,8 @@
+ { ULong cia, r1, lr; \
+ __asm__ __volatile__( \
+ "mflr 0;" /* r0 = lr */ \
+- "bl .m_libcassert_get_ip;" /* lr = pc */ \
+- ".m_libcassert_get_ip:\n" \
++ "bl 0f;" /* lr = pc */ \
++ "0:\n" \
+ "mflr %0;" /* %0 = pc */ \
+ "mtlr 0;" /* restore lr */ \
+ "mr %1,1;" /* %1 = r1 */ \
diff --git a/dev-util/valgrind/files/valgrind-3.7.0-automake-1.11.2.patch b/dev-util/valgrind/files/valgrind-3.7.0-automake-1.11.2.patch
new file mode 100644
index 000000000000..b0b57bf3a098
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.7.0-automake-1.11.2.patch
@@ -0,0 +1,37 @@
+From: Gregorio Guidi <gregorio.guidi@gmail.com>
+
+Retain the old behavior of the build system even with automake 1.11.2.
+
+Reported-by: Oleg Bulatov <dmage@bk.ru>
+X-Gentoo-Bug: 397429
+X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=397429
+X-KDE-Bug: 290719
+X-KDE-Bug-URL: https://bugs.kde.org/show_bug.cgi?id=290719
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+
+diff -Nur valgrind-3.7.0.orig/coregrind/Makefile.am valgrind-3.7.0/coregrind/Makefile.am
+--- valgrind-3.7.0.orig/coregrind/Makefile.am 2011-10-27 12:55:06.000000000 +0200
++++ valgrind-3.7.0/coregrind/Makefile.am 2012-01-06 17:23:48.717115986 +0100
+@@ -495,7 +495,8 @@
+ m_gdbserver/powerpc-altivec64l.xml
+
+ # so as to make sure these get copied into the install tree
+-pkglib_DATA = $(GDBSERVER_XML_FILES)
++vgdatadir = $(pkglibdir)
++vgdata_DATA = $(GDBSERVER_XML_FILES)
+
+ # so as to make sure these get copied into the tarball
+ EXTRA_DIST += $(GDBSERVER_XML_FILES)
+diff -Nur valgrind-3.7.0.orig/Makefile.am valgrind-3.7.0/Makefile.am
+--- valgrind-3.7.0.orig/Makefile.am 2011-10-26 23:24:45.000000000 +0200
++++ valgrind-3.7.0/Makefile.am 2012-01-06 17:23:17.445114847 +0100
+@@ -61,7 +61,8 @@
+ # default.supp, as it is built from the base .supp files at compile-time.
+ dist_noinst_DATA = $(SUPP_FILES)
+
+-pkglib_DATA = default.supp
++vgdatadir = $(pkglibdir)
++vgdata_DATA = default.supp
+
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = valgrind.pc
diff --git a/dev-util/valgrind/files/valgrind-3.7.0-fix-gcc-regex.patch b/dev-util/valgrind/files/valgrind-3.7.0-fix-gcc-regex.patch
new file mode 100644
index 000000000000..feabf069354a
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.7.0-fix-gcc-regex.patch
@@ -0,0 +1,35 @@
+Index: configure.in
+===================================================================
+--- configure.in (revision 12273)
++++ configure.in (revision 12274)
+@@ -98,18 +98,21 @@
+ # We don't want gcc < 3.0
+ AC_MSG_CHECKING([for a supported version of gcc])
+
+-# Try to get the gcc version, sed-ing out some unexpected stuff
+-# that appears with the default gcc on OSX 10.6 and 10.7 respectively.
+-# Without this, the version number comes out as 686, 10 or 11 :-(
++# Obtain the compiler version.
+ #
+-# i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
+-# i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
++# A few examples of how the ${CC} --version output looks like:
+ #
++# Arch Linux: i686-pc-linux-gnu-gcc (GCC) 4.6.2
++# Debian Linux: gcc (Debian 4.3.2-1.1) 4.3.2
++# openSUSE: gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]
++# Exherbo Linux: x86_64-pc-linux-gnu-gcc (Exherbo gcc-4.6.2) 4.6.2
++# OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
++# OS/X 10.7: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
++# Clang: clang version 2.9 (tags/RELEASE_29/final)
++#
+ [gcc_version=`${CC} --version \
+- | head -n 1 \
+- | $SED 's/i686-apple-darwin10//' \
+- | $SED 's/i686-apple-darwin11//' \
+- | $SED 's/^[^0-9]*\([0-9.]*\).*$/\1/'`]
++ | $SED -n -e 's/[^ ]*gcc[^ ]* ([^)]*) \([0-9.]*\).*$/\1/p' \
++ -e 's/[^ ]*clang version \([0-9.]*\).*$/\1/p'`]
+
+ is_clang="notclang"
+ if test "x`${CC} --version | head -n 1 | $SED 's/\(clang\) version.*/\1/'`" = "xclang" ; then
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
new file mode 100644
index 000000000000..6af455319567
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.7.0-fno-stack-protector.patch
@@ -0,0 +1,12 @@
+diff -Naur valgrind-3.7.0.orig//Makefile.all.am valgrind-3.7.0/Makefile.all.am
+--- valgrind-3.7.0.orig//Makefile.all.am 2011-10-26 17:24:45.000000000 -0400
++++ valgrind-3.7.0/Makefile.all.am 2011-11-10 16:18:18.000000000 -0500
+@@ -82,7 +82,7 @@
+ # performance and get whatever useful warnings we can out of gcc.
+ # -fno-builtin is important for defeating LLVM's idiom recognition
+ # that somehow causes VG_(memset) to get into infinite recursion.
+-AM_CFLAGS_BASE = \
++AM_CFLAGS_BASE = -fno-stack-protector \
+ -O2 -g \
+ -Wall \
+ -Wmissing-prototypes \
diff --git a/dev-util/valgrind/files/valgrind-3.7.0-glibc-2.15.patch b/dev-util/valgrind/files/valgrind-3.7.0-glibc-2.15.patch
new file mode 100644
index 000000000000..f5098a43cf8e
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.7.0-glibc-2.15.patch
@@ -0,0 +1,26 @@
+diff -Naur valgrind-3.7.0.orig//configure.in valgrind-3.7.0/configure.in
+--- valgrind-3.7.0.orig//configure.in 2012-01-14 17:49:13.000000000 -0500
++++ valgrind-3.7.0/configure.in 2012-01-14 18:13:45.000000000 -0500
+@@ -778,6 +778,13 @@
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
++ 2.15)
++ AC_MSG_RESULT(2.15 family)
++ AC_DEFINE([GLIBC_2_15], 1, [Define to 1 if you're using glibc 2.15.x])
++ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ ;;
+ darwin)
+ AC_MSG_RESULT(Darwin)
+ AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
+@@ -791,7 +798,7 @@
+
+ *)
+ AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
+- AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.14])
++ AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.15])
+ AC_MSG_ERROR([or Darwin libc])
+ ;;
+ esac
diff --git a/dev-util/valgrind/files/valgrind-3.7.0-non-exec-stack-v2.patch b/dev-util/valgrind/files/valgrind-3.7.0-non-exec-stack-v2.patch
new file mode 100644
index 000000000000..90c0bf111146
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.7.0-non-exec-stack-v2.patch
@@ -0,0 +1,143 @@
+diff -Naur valgrind-3.7.0.orig//coregrind/Makefile.am valgrind-3.7.0/coregrind/Makefile.am
+--- valgrind-3.7.0.orig//coregrind/Makefile.am 2011-11-10 20:02:47.000000000 -0500
++++ valgrind-3.7.0/coregrind/Makefile.am 2011-11-10 20:03:00.000000000 -0500
+@@ -292,14 +292,6 @@
+ m_demangle/demangle.c \
+ m_demangle/dyn-string.c \
+ m_demangle/safe-ctype.c \
+- m_dispatch/dispatch-x86-linux.S \
+- m_dispatch/dispatch-amd64-linux.S \
+- m_dispatch/dispatch-ppc32-linux.S \
+- m_dispatch/dispatch-ppc64-linux.S \
+- m_dispatch/dispatch-arm-linux.S \
+- m_dispatch/dispatch-s390x-linux.S \
+- m_dispatch/dispatch-x86-darwin.S \
+- m_dispatch/dispatch-amd64-darwin.S \
+ m_gdbserver/m_gdbserver.c \
+ m_gdbserver/inferiors.c \
+ m_gdbserver/m_gdbserver.c \
+@@ -322,8 +314,6 @@
+ m_initimg/initimg-pathscan.c \
+ m_mach/mach_basics.c \
+ m_mach/mach_msg.c \
+- m_mach/mach_traps-x86-darwin.S \
+- m_mach/mach_traps-amd64-darwin.S \
+ m_replacemalloc/replacemalloc_core.c \
+ m_scheduler/scheduler.c \
+ m_scheduler/sema.c \
+@@ -335,14 +325,6 @@
+ m_sigframe/sigframe-s390x-linux.c \
+ m_sigframe/sigframe-x86-darwin.c \
+ m_sigframe/sigframe-amd64-darwin.c \
+- m_syswrap/syscall-x86-linux.S \
+- m_syswrap/syscall-amd64-linux.S \
+- m_syswrap/syscall-ppc32-linux.S \
+- m_syswrap/syscall-ppc64-linux.S \
+- m_syswrap/syscall-arm-linux.S \
+- m_syswrap/syscall-s390x-linux.S \
+- m_syswrap/syscall-x86-darwin.S \
+- m_syswrap/syscall-amd64-darwin.S \
+ m_syswrap/syswrap-main.c \
+ m_syswrap/syswrap-generic.c \
+ m_syswrap/syswrap-linux.c \
+@@ -361,6 +343,29 @@
+ m_ume/main.c \
+ m_ume/script.c
+
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S \
++ m_syswrap/syscall-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S
++
++if VGCONF_HAVE_PLATFORM_SEC
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S \
++ m_syswrap/syscall-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S
++endif
++
++if VGCONF_OS_IS_DARWIN
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_PRI@-darwin.S \
++ m_syswrap/syscall-@VGCONF_ARCH_PRI@-darwin.S \
++ m_mach/mach_traps-@VGCONF_ARCH_PRI@-darwin.S
++if VGCONF_HAVE_PLATFORM_SEC
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_SEC@-darwin.S \
++ m_syswrap/syscall-@VGCONF_ARCH_SEC@-darwin.S \
++ m_mach/mach_traps-@VGCONF_ARCH_SEC@-darwin.S
++endif
++endif
++
+ libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
+ $(COREGRIND_SOURCES_COMMON)
+ nodist_libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
+diff -Naur valgrind-3.7.0.orig//coregrind/m_dispatch/dispatch-amd64-linux.S valgrind-3.7.0/coregrind/m_dispatch/dispatch-amd64-linux.S
+--- valgrind-3.7.0.orig//coregrind/m_dispatch/dispatch-amd64-linux.S 2011-10-26 17:24:42.000000000 -0400
++++ valgrind-3.7.0/coregrind/m_dispatch/dispatch-amd64-linux.S 2011-11-10 20:07:40.000000000 -0500
+@@ -349,11 +349,11 @@
+ ret
+ .size VG_(run_a_noredir_translation), .-VG_(run_a_noredir_translation)
+
++#endif // defined(VGP_amd64_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_amd64_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.7.0.orig//coregrind/m_dispatch/dispatch-x86-linux.S valgrind-3.7.0/coregrind/m_dispatch/dispatch-x86-linux.S
+--- valgrind-3.7.0.orig//coregrind/m_dispatch/dispatch-x86-linux.S 2011-10-26 17:24:42.000000000 -0400
++++ valgrind-3.7.0/coregrind/m_dispatch/dispatch-x86-linux.S 2011-11-10 20:04:07.000000000 -0500
+@@ -320,12 +320,11 @@
+ ret
+ .size VG_(run_a_noredir_translation), .-VG_(run_a_noredir_translation)
+
+-
++#endif // defined(VGP_x86_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_x86_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.7.0.orig//coregrind/m_syswrap/syscall-amd64-linux.S valgrind-3.7.0/coregrind/m_syswrap/syscall-amd64-linux.S
+--- valgrind-3.7.0.orig//coregrind/m_syswrap/syscall-amd64-linux.S 2011-11-10 20:02:47.000000000 -0500
++++ valgrind-3.7.0/coregrind/m_syswrap/syscall-amd64-linux.S 2011-11-10 20:03:00.000000000 -0500
+@@ -205,11 +205,11 @@
+ ML_(blksys_finished): .quad 5b
+ .previous
+
++#endif // defined(VGP_amd64_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_amd64_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.7.0.orig//coregrind/m_syswrap/syscall-x86-linux.S valgrind-3.7.0/coregrind/m_syswrap/syscall-x86-linux.S
+--- valgrind-3.7.0.orig//coregrind/m_syswrap/syscall-x86-linux.S 2011-11-10 20:02:47.000000000 -0500
++++ valgrind-3.7.0/coregrind/m_syswrap/syscall-x86-linux.S 2011-11-10 20:03:00.000000000 -0500
+@@ -164,12 +164,12 @@
+ ML_(blksys_committed): .long 4b
+ ML_(blksys_finished): .long 5b
+ .previous
+-
+-/* Let the linker know we don't need an executable stack */
+-.section .note.GNU-stack,"",@progbits
+
+ #endif // defined(VGP_x86_linux)
+
++/* Let the linker know we don't need an executable stack */
++.section .note.GNU-stack,"",@progbits
++
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
diff --git a/dev-util/valgrind/files/valgrind-3.7.0-non-exec-stack.patch b/dev-util/valgrind/files/valgrind-3.7.0-non-exec-stack.patch
new file mode 100644
index 000000000000..d6cc26dab112
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.7.0-non-exec-stack.patch
@@ -0,0 +1,138 @@
+diff -Naur valgrind-3.7.0.orig//coregrind/Makefile.am valgrind-3.7.0/coregrind/Makefile.am
+--- valgrind-3.7.0.orig//coregrind/Makefile.am 2011-11-10 20:02:47.000000000 -0500
++++ valgrind-3.7.0/coregrind/Makefile.am 2011-11-10 20:03:00.000000000 -0500
+@@ -292,14 +292,6 @@
+ m_demangle/demangle.c \
+ m_demangle/dyn-string.c \
+ m_demangle/safe-ctype.c \
+- m_dispatch/dispatch-x86-linux.S \
+- m_dispatch/dispatch-amd64-linux.S \
+- m_dispatch/dispatch-ppc32-linux.S \
+- m_dispatch/dispatch-ppc64-linux.S \
+- m_dispatch/dispatch-arm-linux.S \
+- m_dispatch/dispatch-s390x-linux.S \
+- m_dispatch/dispatch-x86-darwin.S \
+- m_dispatch/dispatch-amd64-darwin.S \
+ m_gdbserver/m_gdbserver.c \
+ m_gdbserver/inferiors.c \
+ m_gdbserver/m_gdbserver.c \
+@@ -322,8 +314,6 @@
+ m_initimg/initimg-pathscan.c \
+ m_mach/mach_basics.c \
+ m_mach/mach_msg.c \
+- m_mach/mach_traps-x86-darwin.S \
+- m_mach/mach_traps-amd64-darwin.S \
+ m_replacemalloc/replacemalloc_core.c \
+ m_scheduler/scheduler.c \
+ m_scheduler/sema.c \
+@@ -335,14 +325,6 @@
+ m_sigframe/sigframe-s390x-linux.c \
+ m_sigframe/sigframe-x86-darwin.c \
+ m_sigframe/sigframe-amd64-darwin.c \
+- m_syswrap/syscall-x86-linux.S \
+- m_syswrap/syscall-amd64-linux.S \
+- m_syswrap/syscall-ppc32-linux.S \
+- m_syswrap/syscall-ppc64-linux.S \
+- m_syswrap/syscall-arm-linux.S \
+- m_syswrap/syscall-s390x-linux.S \
+- m_syswrap/syscall-x86-darwin.S \
+- m_syswrap/syscall-amd64-darwin.S \
+ m_syswrap/syswrap-main.c \
+ m_syswrap/syswrap-generic.c \
+ m_syswrap/syswrap-linux.c \
+@@ -361,6 +343,24 @@
+ m_ume/main.c \
+ m_ume/script.c
+
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S \
++ m_syswrap/syscall-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S
++
++if VGCONF_HAVE_PLATFORM_SEC
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S \
++ m_syswrap/syscall-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S
++endif
++
++if VGCONF_OS_IS_DARWIN
++COREGRIND_SOURCES_COMMON += \
++ m_start-@VGCONF_ARCH_PRI@-darwin.S \
++ m_start-@VGCONF_ARCH_SEC@-darwin.S \
++ m_mach/mach_traps-@VGCONF_ARCH_PRI@-darwin.S \
++ m_mach/mach_traps-@VGCONF_ARCH_SEC@-darwin.S
++endif
++
+ libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
+ $(COREGRIND_SOURCES_COMMON)
+ nodist_libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
+diff -Naur valgrind-3.7.0.orig//coregrind/m_dispatch/dispatch-amd64-linux.S valgrind-3.7.0/coregrind/m_dispatch/dispatch-amd64-linux.S
+--- valgrind-3.7.0.orig//coregrind/m_dispatch/dispatch-amd64-linux.S 2011-10-26 17:24:42.000000000 -0400
++++ valgrind-3.7.0/coregrind/m_dispatch/dispatch-amd64-linux.S 2011-11-10 20:07:40.000000000 -0500
+@@ -349,11 +349,11 @@
+ ret
+ .size VG_(run_a_noredir_translation), .-VG_(run_a_noredir_translation)
+
++#endif // defined(VGP_amd64_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_amd64_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.7.0.orig//coregrind/m_dispatch/dispatch-x86-linux.S valgrind-3.7.0/coregrind/m_dispatch/dispatch-x86-linux.S
+--- valgrind-3.7.0.orig//coregrind/m_dispatch/dispatch-x86-linux.S 2011-10-26 17:24:42.000000000 -0400
++++ valgrind-3.7.0/coregrind/m_dispatch/dispatch-x86-linux.S 2011-11-10 20:04:07.000000000 -0500
+@@ -320,12 +320,11 @@
+ ret
+ .size VG_(run_a_noredir_translation), .-VG_(run_a_noredir_translation)
+
+-
++#endif // defined(VGP_x86_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_x86_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.7.0.orig//coregrind/m_syswrap/syscall-amd64-linux.S valgrind-3.7.0/coregrind/m_syswrap/syscall-amd64-linux.S
+--- valgrind-3.7.0.orig//coregrind/m_syswrap/syscall-amd64-linux.S 2011-11-10 20:02:47.000000000 -0500
++++ valgrind-3.7.0/coregrind/m_syswrap/syscall-amd64-linux.S 2011-11-10 20:03:00.000000000 -0500
+@@ -205,11 +205,11 @@
+ ML_(blksys_finished): .quad 5b
+ .previous
+
++#endif // defined(VGP_amd64_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_amd64_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.7.0.orig//coregrind/m_syswrap/syscall-x86-linux.S valgrind-3.7.0/coregrind/m_syswrap/syscall-x86-linux.S
+--- valgrind-3.7.0.orig//coregrind/m_syswrap/syscall-x86-linux.S 2011-11-10 20:02:47.000000000 -0500
++++ valgrind-3.7.0/coregrind/m_syswrap/syscall-x86-linux.S 2011-11-10 20:03:00.000000000 -0500
+@@ -164,12 +164,12 @@
+ ML_(blksys_committed): .long 4b
+ ML_(blksys_finished): .long 5b
+ .previous
+-
+-/* Let the linker know we don't need an executable stack */
+-.section .note.GNU-stack,"",@progbits
+
+ #endif // defined(VGP_x86_linux)
+
++/* Let the linker know we don't need an executable stack */
++.section .note.GNU-stack,"",@progbits
++
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
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
new file mode 100644
index 000000000000..860e09c86ed3
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.7.0-respect-flags.patch
@@ -0,0 +1,13 @@
+diff -Naur valgrind-3.7.0.orig//mpi/Makefile.am valgrind-3.7.0/mpi/Makefile.am
+--- valgrind-3.7.0.orig//mpi/Makefile.am 2011-10-26 17:24:23.000000000 -0400
++++ valgrind-3.7.0/mpi/Makefile.am 2011-11-10 16:03:14.000000000 -0500
+@@ -7,9 +7,6 @@
+ CC = $(MPI_CC)
+ DEFS =
+ DEFAULT_INCLUDES =
+-CPPFLAGS =
+-CFLAGS =
+-LDFLAGS =
+
+ EXTRA_DIST = \
+ mpiwrap_type_test.c
diff --git a/dev-util/valgrind/files/valgrind-3.8.0-non-exec-stack.patch b/dev-util/valgrind/files/valgrind-3.8.0-non-exec-stack.patch
new file mode 100644
index 000000000000..66c97764d31b
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.8.0-non-exec-stack.patch
@@ -0,0 +1,142 @@
+diff -Naur valgrind-3.8.0.orig//coregrind/Makefile.am valgrind-3.8.0/coregrind/Makefile.am
+--- valgrind-3.8.0.orig//coregrind/Makefile.am 2012-08-05 03:47:20.000000000 -0400
++++ valgrind-3.8.0/coregrind/Makefile.am 2012-08-18 04:14:35.000000000 -0400
+@@ -297,15 +297,6 @@
+ m_demangle/demangle.c \
+ m_demangle/dyn-string.c \
+ m_demangle/safe-ctype.c \
+- m_dispatch/dispatch-x86-linux.S \
+- m_dispatch/dispatch-amd64-linux.S \
+- m_dispatch/dispatch-ppc32-linux.S \
+- m_dispatch/dispatch-ppc64-linux.S \
+- m_dispatch/dispatch-arm-linux.S \
+- m_dispatch/dispatch-s390x-linux.S \
+- m_dispatch/dispatch-mips32-linux.S \
+- m_dispatch/dispatch-x86-darwin.S \
+- m_dispatch/dispatch-amd64-darwin.S \
+ m_gdbserver/inferiors.c \
+ m_gdbserver/m_gdbserver.c \
+ m_gdbserver/regcache.c \
+@@ -327,8 +318,6 @@
+ m_initimg/initimg-pathscan.c \
+ m_mach/mach_basics.c \
+ m_mach/mach_msg.c \
+- m_mach/mach_traps-x86-darwin.S \
+- m_mach/mach_traps-amd64-darwin.S \
+ m_replacemalloc/replacemalloc_core.c \
+ m_scheduler/scheduler.c \
+ m_scheduler/sema.c \
+@@ -343,15 +332,6 @@
+ m_sigframe/sigframe-mips32-linux.c \
+ m_sigframe/sigframe-x86-darwin.c \
+ m_sigframe/sigframe-amd64-darwin.c \
+- m_syswrap/syscall-x86-linux.S \
+- m_syswrap/syscall-amd64-linux.S \
+- m_syswrap/syscall-ppc32-linux.S \
+- m_syswrap/syscall-ppc64-linux.S \
+- m_syswrap/syscall-arm-linux.S \
+- m_syswrap/syscall-s390x-linux.S \
+- m_syswrap/syscall-mips32-linux.S \
+- m_syswrap/syscall-x86-darwin.S \
+- m_syswrap/syscall-amd64-darwin.S \
+ m_syswrap/syswrap-main.c \
+ m_syswrap/syswrap-generic.c \
+ m_syswrap/syswrap-linux.c \
+@@ -371,6 +351,29 @@
+ m_ume/main.c \
+ m_ume/script.c
+
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S \
++ m_syswrap/syscall-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S
++
++if VGCONF_HAVE_PLATFORM_SEC
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S \
++ m_syswrap/syscall-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S
++endif
++
++if VGCONF_OS_IS_DARWIN
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_PRI@-darwin.S \
++ m_syswrap/syscall-@VGCONF_ARCH_PRI@-darwin.S \
++ m_mach/mach_traps-@VGCONF_ARCH_PRI@-darwin.S
++if VGCONF_HAVE_PLATFORM_SEC
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_SEC@-darwin.S \
++ m_syswrap/syscall-@VGCONF_ARCH_SEC@-darwin.S \
++ m_mach/mach_traps-@VGCONF_ARCH_SEC@-darwin.S
++endif
++endif
++
+ libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
+ $(COREGRIND_SOURCES_COMMON)
+ nodist_libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
+diff -Naur valgrind-3.8.0.orig//coregrind/m_dispatch/dispatch-amd64-linux.S valgrind-3.8.0/coregrind/m_dispatch/dispatch-amd64-linux.S
+--- valgrind-3.8.0.orig//coregrind/m_dispatch/dispatch-amd64-linux.S 2012-08-05 12:04:11.000000000 -0400
++++ valgrind-3.8.0/coregrind/m_dispatch/dispatch-amd64-linux.S 2012-08-18 04:15:57.000000000 -0400
+@@ -249,11 +249,11 @@
+
+ .size VG_(disp_run_translations), .-VG_(disp_run_translations)
+
++#endif // defined(VGP_amd64_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_amd64_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.8.0.orig//coregrind/m_dispatch/dispatch-x86-linux.S valgrind-3.8.0/coregrind/m_dispatch/dispatch-x86-linux.S
+--- valgrind-3.8.0.orig//coregrind/m_dispatch/dispatch-x86-linux.S 2012-08-05 12:04:11.000000000 -0400
++++ valgrind-3.8.0/coregrind/m_dispatch/dispatch-x86-linux.S 2012-08-18 04:16:44.000000000 -0400
+@@ -240,11 +240,11 @@
+
+ .size VG_(disp_run_translations), .-VG_(disp_run_translations)
+
++#endif // defined(VGP_x86_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_x86_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.8.0.orig//coregrind/m_syswrap/syscall-amd64-linux.S valgrind-3.8.0/coregrind/m_syswrap/syscall-amd64-linux.S
+--- valgrind-3.8.0.orig//coregrind/m_syswrap/syscall-amd64-linux.S 2012-08-05 12:04:11.000000000 -0400
++++ valgrind-3.8.0/coregrind/m_syswrap/syscall-amd64-linux.S 2012-08-18 04:17:21.000000000 -0400
+@@ -205,11 +205,11 @@
+ ML_(blksys_finished): .quad 5b
+ .previous
+
++#endif // defined(VGP_amd64_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_amd64_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.8.0.orig//coregrind/m_syswrap/syscall-x86-linux.S valgrind-3.8.0/coregrind/m_syswrap/syscall-x86-linux.S
+--- valgrind-3.8.0.orig//coregrind/m_syswrap/syscall-x86-linux.S 2012-08-05 12:04:11.000000000 -0400
++++ valgrind-3.8.0/coregrind/m_syswrap/syscall-x86-linux.S 2012-08-18 04:17:59.000000000 -0400
+@@ -165,11 +165,11 @@
+ ML_(blksys_finished): .long 5b
+ .previous
+
++#endif // defined(VGP_x86_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_x86_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
diff --git a/dev-util/valgrind/files/valgrind-3.8.1-gcc-4.8-memmove.patch b/dev-util/valgrind/files/valgrind-3.8.1-gcc-4.8-memmove.patch
new file mode 100644
index 000000000000..453a67859ee7
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.8.1-gcc-4.8-memmove.patch
@@ -0,0 +1,26 @@
+Index: coregrind/m_main.c
+===================================================================
+--- coregrind/m_main.c (revision 13287)
++++ coregrind/m_main.c (revision 13288)
+@@ -2636,8 +2636,8 @@
+
+ From this derive two requirements:
+
+- 1. gcc may emit calls to memcpy and memset to deal with structure
+- assignments etc. Since we have chosen to ignore all the
++ 1. gcc may emit calls to memcpy, memmove and memset to deal with
++ structure assignments etc. Since we have chosen to ignore all the
+ "normal" supporting libraries, we have to provide our own
+ implementations of them. No problem.
+
+@@ -2651,6 +2651,10 @@
+ void* memcpy(void *dest, const void *src, SizeT n) {
+ return VG_(memcpy)(dest,src,n);
+ }
++void* memmove(void *dest, const void *src, SizeT n);
++void* memmove(void *dest, const void *src, SizeT n) {
++ return VG_(memmove)(dest,src,n);
++}
+ void* memset(void *s, int c, SizeT n);
+ void* memset(void *s, int c, SizeT n) {
+ return VG_(memset)(s,c,n);
diff --git a/dev-util/valgrind/files/valgrind-3.8.1-glibc-2.17.patch b/dev-util/valgrind/files/valgrind-3.8.1-glibc-2.17.patch
new file mode 100644
index 000000000000..605b80a038e6
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.8.1-glibc-2.17.patch
@@ -0,0 +1,26 @@
+diff -Nuar valgrind-3.8.1.orig/configure.in valgrind-3.8.1/configure.in
+--- valgrind-3.8.1.orig/configure.in 2012-09-18 15:17:32.000000000 -0400
++++ valgrind-3.8.1/configure.in 2013-02-19 13:00:26.000000000 -0500
+@@ -906,6 +906,13 @@
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
++ 2.17)
++ AC_MSG_RESULT(2.17 family)
++ AC_DEFINE([GLIBC_2_17], 1, [Define to 1 if you're using glibc 2.17.x])
++ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ ;;
+ darwin)
+ AC_MSG_RESULT(Darwin)
+ AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
+@@ -919,7 +926,7 @@
+
+ *)
+ AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
+- AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.16])
++ AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.17])
+ AC_MSG_ERROR([or Darwin libc])
+ ;;
+ esac
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
new file mode 100644
index 000000000000..79a3283c9c13
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.9.0-glibc-2.19.patch
@@ -0,0 +1,37 @@
+diff -Naur valgrind-3.9.0-orig/configure valgrind-3.9.0/configure
+--- valgrind-3.9.0-orig/configure 2013-11-01 09:33:32.000000000 +1000
++++ valgrind-3.9.0/configure 2014-02-08 09:28:06.063248544 +1000
+@@ -6689,6 +6689,16 @@
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
++ 2.19)
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: 2.19 family" >&5
++$as_echo "2.19 family" >&6; }
++
++$as_echo "#define GLIBC_2_19 1" >>confdefs.h
++
++ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ ;;
+ darwin)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Darwin" >&5
+ $as_echo "Darwin" >&6; }
+diff -Naur valgrind-3.9.0-orig/configure.ac valgrind-3.9.0/configure.ac
+--- valgrind-3.9.0-orig/configure.ac 2013-11-01 09:28:16.000000000 +1000
++++ valgrind-3.9.0/configure.ac 2014-02-08 09:27:38.870385366 +1000
+@@ -918,6 +918,13 @@
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
++ 2.19)
++ AC_MSG_RESULT(2.19 family)
++ AC_DEFINE([GLIBC_2_19], 1, [Define to 1 if you're using glibc 2.19.x])
++ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ ;;
+ darwin)
+ AC_MSG_RESULT(Darwin)
+ AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
diff --git a/dev-util/valgrind/files/valgrind-3.9.0-non-exec-stack.patch b/dev-util/valgrind/files/valgrind-3.9.0-non-exec-stack.patch
new file mode 100644
index 000000000000..41be42aca003
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.9.0-non-exec-stack.patch
@@ -0,0 +1,144 @@
+diff -Naur valgrind-3.9.0.orig/coregrind/Makefile.am valgrind-3.9.0/coregrind/Makefile.am
+--- valgrind-3.9.0.orig/coregrind/Makefile.am 2013-10-23 06:50:13.000000000 -0400
++++ valgrind-3.9.0/coregrind/Makefile.am 2013-11-02 19:41:26.984017770 -0400
+@@ -309,16 +309,6 @@
+ m_demangle/demangle.c \
+ m_demangle/dyn-string.c \
+ m_demangle/safe-ctype.c \
+- m_dispatch/dispatch-x86-linux.S \
+- m_dispatch/dispatch-amd64-linux.S \
+- m_dispatch/dispatch-ppc32-linux.S \
+- m_dispatch/dispatch-ppc64-linux.S \
+- m_dispatch/dispatch-arm-linux.S \
+- m_dispatch/dispatch-s390x-linux.S \
+- m_dispatch/dispatch-mips32-linux.S \
+- m_dispatch/dispatch-mips64-linux.S \
+- m_dispatch/dispatch-x86-darwin.S \
+- m_dispatch/dispatch-amd64-darwin.S \
+ m_gdbserver/inferiors.c \
+ m_gdbserver/m_gdbserver.c \
+ m_gdbserver/regcache.c \
+@@ -341,8 +331,6 @@
+ m_initimg/initimg-pathscan.c \
+ m_mach/mach_basics.c \
+ m_mach/mach_msg.c \
+- m_mach/mach_traps-x86-darwin.S \
+- m_mach/mach_traps-amd64-darwin.S \
+ m_replacemalloc/replacemalloc_core.c \
+ m_scheduler/scheduler.c \
+ m_scheduler/sema.c \
+@@ -358,16 +346,6 @@
+ m_sigframe/sigframe-mips64-linux.c \
+ m_sigframe/sigframe-x86-darwin.c \
+ m_sigframe/sigframe-amd64-darwin.c \
+- m_syswrap/syscall-x86-linux.S \
+- m_syswrap/syscall-amd64-linux.S \
+- m_syswrap/syscall-ppc32-linux.S \
+- m_syswrap/syscall-ppc64-linux.S \
+- m_syswrap/syscall-arm-linux.S \
+- m_syswrap/syscall-s390x-linux.S \
+- m_syswrap/syscall-mips32-linux.S \
+- m_syswrap/syscall-mips64-linux.S \
+- m_syswrap/syscall-x86-darwin.S \
+- m_syswrap/syscall-amd64-darwin.S \
+ m_syswrap/syswrap-main.c \
+ m_syswrap/syswrap-generic.c \
+ m_syswrap/syswrap-linux.c \
+@@ -389,6 +367,29 @@
+ m_ume/main.c \
+ m_ume/script.c
+
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S \
++ m_syswrap/syscall-@VGCONF_ARCH_PRI@-@VGCONF_OS@.S
++
++if VGCONF_HAVE_PLATFORM_SEC
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S \
++ m_syswrap/syscall-@VGCONF_ARCH_SEC@-@VGCONF_OS@.S
++endif
++
++if VGCONF_OS_IS_DARWIN
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_PRI@-darwin.S \
++ m_syswrap/syscall-@VGCONF_ARCH_PRI@-darwin.S \
++ m_mach/mach_traps-@VGCONF_ARCH_PRI@-darwin.S
++if VGCONF_HAVE_PLATFORM_SEC
++COREGRIND_SOURCES_COMMON += \
++ m_dispatch/dispatch-@VGCONF_ARCH_SEC@-darwin.S \
++ m_syswrap/syscall-@VGCONF_ARCH_SEC@-darwin.S \
++ m_mach/mach_traps-@VGCONF_ARCH_SEC@-darwin.S
++endif
++endif
++
+ libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
+ $(COREGRIND_SOURCES_COMMON)
+ nodist_libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
+diff -Naur valgrind-3.9.0.orig/coregrind/m_dispatch/dispatch-amd64-linux.S valgrind-3.9.0/coregrind/m_dispatch/dispatch-amd64-linux.S
+--- valgrind-3.9.0.orig/coregrind/m_dispatch/dispatch-amd64-linux.S 2013-10-23 06:50:09.000000000 -0400
++++ valgrind-3.9.0/coregrind/m_dispatch/dispatch-amd64-linux.S 2013-11-02 19:31:54.688991721 -0400
+@@ -249,11 +249,11 @@
+
+ .size VG_(disp_run_translations), .-VG_(disp_run_translations)
+
++#endif // defined(VGP_amd64_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_amd64_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.9.0.orig/coregrind/m_dispatch/dispatch-x86-linux.S valgrind-3.9.0/coregrind/m_dispatch/dispatch-x86-linux.S
+--- valgrind-3.9.0.orig/coregrind/m_dispatch/dispatch-x86-linux.S 2013-10-23 06:50:09.000000000 -0400
++++ valgrind-3.9.0/coregrind/m_dispatch/dispatch-x86-linux.S 2013-11-02 19:31:54.688991721 -0400
+@@ -240,11 +240,11 @@
+
+ .size VG_(disp_run_translations), .-VG_(disp_run_translations)
+
++#endif // defined(VGP_x86_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_x86_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.9.0.orig/coregrind/m_syswrap/syscall-amd64-linux.S valgrind-3.9.0/coregrind/m_syswrap/syscall-amd64-linux.S
+--- valgrind-3.9.0.orig/coregrind/m_syswrap/syscall-amd64-linux.S 2013-10-23 06:50:12.000000000 -0400
++++ valgrind-3.9.0/coregrind/m_syswrap/syscall-amd64-linux.S 2013-11-02 19:31:54.689991721 -0400
+@@ -205,11 +205,11 @@
+ ML_(blksys_finished): .quad 5b
+ .previous
+
++#endif // defined(VGP_amd64_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_amd64_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
+diff -Naur valgrind-3.9.0.orig/coregrind/m_syswrap/syscall-x86-linux.S valgrind-3.9.0/coregrind/m_syswrap/syscall-x86-linux.S
+--- valgrind-3.9.0.orig/coregrind/m_syswrap/syscall-x86-linux.S 2013-10-23 06:50:12.000000000 -0400
++++ valgrind-3.9.0/coregrind/m_syswrap/syscall-x86-linux.S 2013-11-02 19:31:54.689991721 -0400
+@@ -165,11 +165,11 @@
+ ML_(blksys_finished): .long 5b
+ .previous
+
++#endif // defined(VGP_x86_linux)
++
+ /* Let the linker know we don't need an executable stack */
+ .section .note.GNU-stack,"",@progbits
+
+-#endif // defined(VGP_x86_linux)
+-
+ /*--------------------------------------------------------------------*/
+ /*--- end ---*/
+ /*--------------------------------------------------------------------*/
diff --git a/dev-util/valgrind/metadata.xml b/dev-util/valgrind/metadata.xml
new file mode 100644
index 000000000000..e20d0c3fba5f
--- /dev/null
+++ b/dev-util/valgrind/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <longdescription>
+ Valgrind is a GPL'd tool to help you find memory-management problems
+ in your programs. When a program is run under Valgrind's supervision,
+ all reads and writes of memory are checked, and calls to
+ malloc/new/free/delete are intercepted. As a result, Valgrind can
+ detect problems such as
+
+ - Use of uninitialised memory
+ - Reading/writing memory after it has been free'd
+ - Reading/writing off the end of malloc'd blocks
+ - Reading/writing inappropriate areas on the stack
+ - Memory leaks -- where pointers to malloc'd blocks are lost forever
+ - Passing of uninitialised and/or unaddressible memory to system calls
+ - Mismatched use of malloc/new/new [] vs free/delete/delete []
+ - Some abuses of the POSIX Pthreads API
+ </longdescription>
+</pkgmetadata>
diff --git a/dev-util/valgrind/valgrind-3.10.1.ebuild b/dev-util/valgrind/valgrind-3.10.1.ebuild
new file mode 100644
index 000000000000..7dd15a4e7a6f
--- /dev/null
+++ b/dev-util/valgrind/valgrind-3.10.1.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+inherit autotools eutils flag-o-matic toolchain-funcs multilib pax-utils
+
+DESCRIPTION="An open-source memory debugger for GNU/Linux"
+HOMEPAGE="http://www.valgrind.org"
+SRC_URI="http://www.valgrind.org/downloads/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 arm ppc ppc64 x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="mpi"
+
+DEPEND="mpi? ( virtual/mpi )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Correct hard coded doc location
+ sed -i -e "s:doc/valgrind:doc/${PF}:" docs/Makefile.am || die
+
+ # Don't force multiarch stuff on OSX, bug #306467
+ sed -i -e 's:-arch \(i386\|x86_64\)::g' Makefile.all.am || die
+
+ # Respect CFLAGS, LDFLAGS
+ epatch "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch
+
+ # Changing Makefile.all.am to disable SSP
+ epatch "${FILESDIR}"/${PN}-3.7.0-fno-stack-protector.patch
+
+ # Yet more local labels, this time for ppc32 & ppc64
+ epatch "${FILESDIR}"/${PN}-3.6.0-local-labels.patch
+
+ # Don't build in empty assembly files for other platforms or we'll get a QA
+ # warning about executable stacks.
+ epatch "${FILESDIR}"/${PN}-3.10.1-non-exec-stack.patch
+
+ # glibc 2.19 fix
+ epatch "${FILESDIR}"/${PN}-3.9.0-glibc-2.19.patch
+
+ # valgrind works fine on linux-4, bug #543648
+ epatch "${FILESDIR}"/${PN}-3.10.1-linux-4.patch
+
+ # glibc 2.21 fix. Bug #554808.
+ epatch "${FILESDIR}"/${PN}-3.10.1-glibc-2.21.patch
+
+ # Allow users to test their own patches
+ epatch_user
+
+ # Regenerate autotools files
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+
+ # Respect ar, bug #468114
+ tc-export AR
+
+ # -fomit-frame-pointer "Assembler messages: Error: junk `8' after expression"
+ # while compiling insn_sse.c in none/tests/x86
+ # -fpie valgrind seemingly hangs when built with pie on
+ # amd64 (bug #102157)
+ # -fstack-protector more undefined references to __guard and __stack_smash_handler
+ # because valgrind doesn't link to glibc (bug #114347)
+ # -m64 -mx32 for multilib-portage, bug #398825
+ # -ggdb3 segmentation fault on startup
+ filter-flags -fomit-frame-pointer
+ filter-flags -fpie
+ filter-flags -fstack-protector
+ filter-flags -m64 -mx32
+ replace-flags -ggdb3 -ggdb2
+
+ if use amd64 || use ppc64; then
+ ! has_multilib_profile && myconf="${myconf} --enable-only64bit"
+ fi
+
+ # Force bitness on darwin, bug #306467
+ use x86-macos && myconf="${myconf} --enable-only32bit"
+ use x64-macos && myconf="${myconf} --enable-only64bit"
+
+ # Don't use mpicc unless the user asked for it (bug #258832)
+ if ! use mpi; then
+ myconf="${myconf} --without-mpicc"
+ fi
+
+ econf ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS FAQ.txt NEWS README*
+
+ pax-mark m "${ED}"/usr/$(get_libdir)/valgrind/*-*-linux
+
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ # fix install_names on shared libraries, can't turn them into bundles,
+ # as dyld won't load them any more then, bug #306467
+ local l
+ for l in "${ED}"/usr/lib/valgrind/*.so ; do
+ install_name_tool -id "${EPREFIX}"/usr/lib/valgrind/${l##*/} "${l}"
+ done
+ fi
+}
+
+pkg_postinst() {
+ elog "Valgrind will not work if glibc does not have debug symbols."
+ elog "To fix this you can add splitdebug to FEATURES in make.conf"
+ elog "and remerge glibc. See:"
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=214065"
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=274771"
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=388703"
+}
diff --git a/dev-util/valgrind/valgrind-3.7.0-r4.ebuild b/dev-util/valgrind/valgrind-3.7.0-r4.ebuild
new file mode 100644
index 000000000000..9d756f0127a2
--- /dev/null
+++ b/dev-util/valgrind/valgrind-3.7.0-r4.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+inherit autotools eutils flag-o-matic toolchain-funcs multilib pax-utils
+
+DESCRIPTION="An open-source memory debugger for GNU/Linux"
+HOMEPAGE="http://www.valgrind.org"
+SRC_URI="http://www.valgrind.org/downloads/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 ppc ppc64 x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="mpi"
+
+DEPEND="mpi? ( virtual/mpi )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Correct hard coded doc location
+ sed -i -e "s:doc/valgrind:doc/${PF}:" docs/Makefile.am || die
+
+ # Don't force multiarch stuff on OSX, bug #306467
+ sed -i -e 's:-arch \(i386\|x86_64\)::g' Makefile.all.am || die
+
+ # Respect CFLAGS, LDFLAGS
+ epatch "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch
+
+ # Changing Makefile.all.am to disable SSP
+ epatch "${FILESDIR}"/${PN}-3.7.0-fno-stack-protector.patch
+
+ # Yet more local labels, this time for ppc32 & ppc64
+ epatch "${FILESDIR}"/${PN}-3.6.0-local-labels.patch
+
+ # Don't build in empty assembly files for other platforms or we'll get a QA
+ # warning about executable stacks.
+ epatch "${FILESDIR}"/${PN}-3.7.0-non-exec-stack-v2.patch
+
+ # Fix the regex to get gcc's version
+ epatch "${FILESDIR}"/${PN}-3.7.0-fix-gcc-regex.patch
+
+ # Fix stricter use of dir variables, bug #397429
+ epatch "${FILESDIR}"/${PN}-3.7.0-automake-1.11.2.patch
+
+ # Fix for glibc 2.15, bug #398921
+ epatch "${FILESDIR}"/${PN}-3.7.0-glibc-2.15.patch
+
+ # Regenerate autotools files
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+
+ # -fomit-frame-pointer "Assembler messages: Error: junk `8' after expression"
+ # while compiling insn_sse.c in none/tests/x86
+ # -fpie valgrind seemingly hangs when built with pie on
+ # amd64 (bug #102157)
+ # -fstack-protector more undefined references to __guard and __stack_smash_handler
+ # because valgrind doesn't link to glibc (bug #114347)
+ # -m64 -mx32 for multilib-portage, bug #398825
+ # -ggdb3 segmentation fault on startup
+ filter-flags -fomit-frame-pointer
+ filter-flags -fpie
+ filter-flags -fstack-protector
+ filter-flags -m64 -mx32
+ replace-flags -ggdb3 -ggdb2
+
+ if use amd64 || use ppc64; then
+ ! has_multilib_profile && myconf="${myconf} --enable-only64bit"
+ fi
+
+ # Force bitness on darwin, bug #306467
+ use x86-macos && myconf="${myconf} --enable-only32bit"
+ use x64-macos && myconf="${myconf} --enable-only64bit"
+
+ # Don't use mpicc unless the user asked for it (bug #258832)
+ if ! use mpi; then
+ myconf="${myconf} --without-mpicc"
+ fi
+
+ econf ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS FAQ.txt NEWS README*
+
+ pax-mark m "${ED}"/usr/$(get_libdir)/valgrind/*-*-linux
+
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ # fix install_names on shared libraries, can't turn them into bundles,
+ # as dyld won't load them any more then, bug #306467
+ local l
+ for l in "${ED}"/usr/lib/valgrind/*.so ; do
+ install_name_tool -id "${EPREFIX}"/usr/lib/valgrind/${l##*/} "${l}"
+ done
+ fi
+}
+
+pkg_postinst() {
+ elog "Valgrind will not work if glibc does not have debug symbols."
+ elog "To fix this you can add splitdebug to FEATURES in make.conf"
+ elog "and remerge glibc. See:"
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=214065"
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=274771"
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=388703"
+}
diff --git a/dev-util/valgrind/valgrind-3.8.1.ebuild b/dev-util/valgrind/valgrind-3.8.1.ebuild
new file mode 100644
index 000000000000..f2e4801eea7b
--- /dev/null
+++ b/dev-util/valgrind/valgrind-3.8.1.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+inherit autotools eutils flag-o-matic toolchain-funcs multilib pax-utils
+
+DESCRIPTION="An open-source memory debugger for GNU/Linux"
+HOMEPAGE="http://www.valgrind.org"
+SRC_URI="http://www.valgrind.org/downloads/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 ~arm ppc ppc64 x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="mpi"
+
+DEPEND="mpi? ( virtual/mpi )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Correct hard coded doc location
+ sed -i -e "s:doc/valgrind:doc/${PF}:" docs/Makefile.am || die
+
+ # Don't force multiarch stuff on OSX, bug #306467
+ sed -i -e 's:-arch \(i386\|x86_64\)::g' Makefile.all.am || die
+
+ # Respect CFLAGS, LDFLAGS
+ epatch "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch
+
+ # Changing Makefile.all.am to disable SSP
+ epatch "${FILESDIR}"/${PN}-3.7.0-fno-stack-protector.patch
+
+ # Yet more local labels, this time for ppc32 & ppc64
+ epatch "${FILESDIR}"/${PN}-3.6.0-local-labels.patch
+
+ # Don't build in empty assembly files for other platforms or we'll get a QA
+ # warning about executable stacks.
+ epatch "${FILESDIR}"/${PN}-3.8.0-non-exec-stack.patch
+
+ # Fix for glibc 2.18, bug #458326
+ epatch "${FILESDIR}"/${PN}-3.8.1-glibc-2.17.patch
+
+ # Regenerate autotools files
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+
+ # Respect ar, bug #468114
+ tc-export AR
+
+ # -fomit-frame-pointer "Assembler messages: Error: junk `8' after expression"
+ # while compiling insn_sse.c in none/tests/x86
+ # -fpie valgrind seemingly hangs when built with pie on
+ # amd64 (bug #102157)
+ # -fstack-protector more undefined references to __guard and __stack_smash_handler
+ # because valgrind doesn't link to glibc (bug #114347)
+ # -m64 -mx32 for multilib-portage, bug #398825
+ # -ggdb3 segmentation fault on startup
+ filter-flags -fomit-frame-pointer
+ filter-flags -fpie
+ filter-flags -fstack-protector
+ filter-flags -m64 -mx32
+ replace-flags -ggdb3 -ggdb2
+
+ if use amd64 || use ppc64; then
+ ! has_multilib_profile && myconf="${myconf} --enable-only64bit"
+ fi
+
+ # Force bitness on darwin, bug #306467
+ use x86-macos && myconf="${myconf} --enable-only32bit"
+ use x64-macos && myconf="${myconf} --enable-only64bit"
+
+ # Don't use mpicc unless the user asked for it (bug #258832)
+ if ! use mpi; then
+ myconf="${myconf} --without-mpicc"
+ fi
+
+ econf ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS FAQ.txt NEWS README*
+
+ pax-mark m "${ED}"/usr/$(get_libdir)/valgrind/*-*-linux
+
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ # fix install_names on shared libraries, can't turn them into bundles,
+ # as dyld won't load them any more then, bug #306467
+ local l
+ for l in "${ED}"/usr/lib/valgrind/*.so ; do
+ install_name_tool -id "${EPREFIX}"/usr/lib/valgrind/${l##*/} "${l}"
+ done
+ fi
+}
+
+pkg_postinst() {
+ elog "Valgrind will not work if glibc does not have debug symbols."
+ elog "To fix this you can add splitdebug to FEATURES in make.conf"
+ elog "and remerge glibc. See:"
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=214065"
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=274771"
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=388703"
+}
diff --git a/dev-util/valgrind/valgrind-3.9.0.ebuild b/dev-util/valgrind/valgrind-3.9.0.ebuild
new file mode 100644
index 000000000000..0ab2a5517640
--- /dev/null
+++ b/dev-util/valgrind/valgrind-3.9.0.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+inherit autotools eutils flag-o-matic toolchain-funcs multilib pax-utils
+
+DESCRIPTION="An open-source memory debugger for GNU/Linux"
+HOMEPAGE="http://www.valgrind.org"
+SRC_URI="http://www.valgrind.org/downloads/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 arm ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="mpi"
+
+DEPEND="mpi? ( virtual/mpi )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Correct hard coded doc location
+ sed -i -e "s:doc/valgrind:doc/${PF}:" docs/Makefile.am || die
+
+ # Don't force multiarch stuff on OSX, bug #306467
+ sed -i -e 's:-arch \(i386\|x86_64\)::g' Makefile.all.am || die
+
+ # Respect CFLAGS, LDFLAGS
+ epatch "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch
+
+ # Changing Makefile.all.am to disable SSP
+ epatch "${FILESDIR}"/${PN}-3.7.0-fno-stack-protector.patch
+
+ # Yet more local labels, this time for ppc32 & ppc64
+ epatch "${FILESDIR}"/${PN}-3.6.0-local-labels.patch
+
+ # Don't build in empty assembly files for other platforms or we'll get a QA
+ # warning about executable stacks.
+ epatch "${FILESDIR}"/${PN}-3.9.0-non-exec-stack.patch
+
+ # glibc 2.19 fix
+ epatch "${FILESDIR}"/${PN}-3.9.0-glibc-2.19.patch
+
+ # Regenerate autotools files
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+
+ # Respect ar, bug #468114
+ tc-export AR
+
+ # -fomit-frame-pointer "Assembler messages: Error: junk `8' after expression"
+ # while compiling insn_sse.c in none/tests/x86
+ # -fpie valgrind seemingly hangs when built with pie on
+ # amd64 (bug #102157)
+ # -fstack-protector more undefined references to __guard and __stack_smash_handler
+ # because valgrind doesn't link to glibc (bug #114347)
+ # -m64 -mx32 for multilib-portage, bug #398825
+ # -ggdb3 segmentation fault on startup
+ filter-flags -fomit-frame-pointer
+ filter-flags -fpie
+ filter-flags -fstack-protector
+ filter-flags -m64 -mx32
+ replace-flags -ggdb3 -ggdb2
+
+ if use amd64 || use ppc64; then
+ ! has_multilib_profile && myconf="${myconf} --enable-only64bit"
+ fi
+
+ # Force bitness on darwin, bug #306467
+ use x86-macos && myconf="${myconf} --enable-only32bit"
+ use x64-macos && myconf="${myconf} --enable-only64bit"
+
+ # Don't use mpicc unless the user asked for it (bug #258832)
+ if ! use mpi; then
+ myconf="${myconf} --without-mpicc"
+ fi
+
+ econf ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS FAQ.txt NEWS README*
+
+ pax-mark m "${ED}"/usr/$(get_libdir)/valgrind/*-*-linux
+
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ # fix install_names on shared libraries, can't turn them into bundles,
+ # as dyld won't load them any more then, bug #306467
+ local l
+ for l in "${ED}"/usr/lib/valgrind/*.so ; do
+ install_name_tool -id "${EPREFIX}"/usr/lib/valgrind/${l##*/} "${l}"
+ done
+ fi
+}
+
+pkg_postinst() {
+ elog "Valgrind will not work if glibc does not have debug symbols."
+ elog "To fix this you can add splitdebug to FEATURES in make.conf"
+ elog "and remerge glibc. See:"
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=214065"
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=274771"
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=388703"
+}