summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2012-01-04 23:07:07 -0500
committerAnthony G. Basile <blueness@gentoo.org>2012-01-04 23:07:07 -0500
commit48d9937f30007dfef0ed8b82b6b3c941ed2b8bd5 (patch)
tree4f13a9a138256b9260f526ad790ae34e650e1c92 /dev-util
parentsys-kernel/hardened-sources: update manifest, changed patchset (diff)
downloadblueness-48d9937f30007dfef0ed8b82b6b3c941ed2b8bd5.tar.gz
blueness-48d9937f30007dfef0ed8b82b6b3c941ed2b8bd5.tar.bz2
blueness-48d9937f30007dfef0ed8b82b6b3c941ed2b8bd5.zip
dev-util/valgrind: address bug #397429
(Portage version: 2.1.10.41/git/Linux x86_64, signed Manifest commit with key 0xD0455535)
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/valgrind/Manifest19
-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.patch24
-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-non-exec-stack.patch138
-rw-r--r--dev-util/valgrind/files/valgrind-3.7.0-respect-flags.patch13
-rw-r--r--dev-util/valgrind/metadata.xml23
-rw-r--r--dev-util/valgrind/valgrind-3.7.0-r2.ebuild88
9 files changed, 376 insertions, 0 deletions
diff --git a/dev-util/valgrind/Manifest b/dev-util/valgrind/Manifest
new file mode 100644
index 0000000..ed658ba
--- /dev/null
+++ b/dev-util/valgrind/Manifest
@@ -0,0 +1,19 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+AUX valgrind-3.6.0-local-labels.patch 1388 RMD160 e9c0064d1e857f1e616c5d9ca7a03e78eae3d5ab SHA1 173820d5671f56c864850c2d8df9d6d301dfda38 SHA256 34ae13eda378677f1e662e0813f138de9b897d6592d20872c58ed8ac1bcf7def
+AUX valgrind-3.7.0-automake-1.11.2.patch 1012 RMD160 7a0bbe583423d3fb313040ceb7f9a2baa928b221 SHA1 cd9c95a3701ea9eb2e2caa3439b8c2e2ba3cdc9f SHA256 416939b3f6722992f3023a5f8e4df8713a8aaa2b184b14a57a094d4627040599
+AUX valgrind-3.7.0-fix-gcc-regex.patch 1723 RMD160 f4fdc113f58d7151315f6a65a262471d4f8a75db SHA1 7ed537bcc935a40001a3d11fbff353e9cee342d5 SHA256 3a587d7dcc1ed447cc006cfef0cfb3597f17c96ac8adc7adbdc14d313a1d6852
+AUX valgrind-3.7.0-fno-stack-protector.patch 554 RMD160 df9a699ff35cf867e17b04a200c5e68015955167 SHA1 ed6368061d47448a597f6a2a9635f66e244b5a13 SHA256 83ed90a0e8a8b06dca8aad4e7f1a12e3c84621d502427c0913b72740b310f479
+AUX valgrind-3.7.0-non-exec-stack.patch 5644 RMD160 86178ee97653b2b4074e98e2342c5104583fa759 SHA1 8074a41b2e8915fa3a63ce827a14088949057bed SHA256 4de10480b6e27379083203df3cfedccdace68d0aad611440478ca2f1b2f89751
+AUX valgrind-3.7.0-respect-flags.patch 360 RMD160 b3ca9a393a68d312fa12cd272720e67c8661cfc4 SHA1 2ca0d9474bd4a81d45981bc8433359832d1ce8b9 SHA256 6b1e5938ecafc29428a698296423c71924848b1e746d6ee8a0f1dd91141f1019
+DIST valgrind-3.7.0.tar.bz2 6624216 RMD160 6ffbf04a8ff4eb2555d1a6bd87c0656828830761 SHA1 b412f49895bb8a78fc314047119760b5d36e5b5e SHA256 5d62c0330f1481fe2c593249192fa68ff454c19c34343978cc9ce91aa324cbf6
+EBUILD valgrind-3.7.0-r2.ebuild 2827 RMD160 2bd96b971686e20678b49de02f9a705db9c7ca2f SHA1 c24fc712b76261be8161a3939f9ae443b983ef45 SHA256 abae11fa86b3c4d8f445d7337e1078b563952b7b09bf70c216c260065bbe850e
+MISC metadata.xml 980 RMD160 7441340fd2659400fb15d857446dac8f7b3f1176 SHA1 07af40cb309fcd80ca639dea5110b1109ce72427 SHA256 513a0d653dfae858a7f426745bd0abe5dcbc8748d468310fdce156e0e21e2cd0
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.17 (GNU/Linux)
+
+iEUEAREIAAYFAk8FIesACgkQl5yvQNBFVTU9ggCgjvm5PuJOPgcRlLwgdrs+feMH
+XvoAljiKcTzl/8Hi2MxIp/AsXO7aKCY=
+=3Zpf
+-----END PGP SIGNATURE-----
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 0000000..68e6822
--- /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 0000000..2c286f9
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.7.0-automake-1.11.2.patch
@@ -0,0 +1,24 @@
+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 2012-01-04 22:46:34.000000000 -0500
++++ valgrind-3.7.0/coregrind/Makefile.am 2012-01-04 22:48:51.000000000 -0500
+@@ -495,7 +495,7 @@
+ m_gdbserver/powerpc-altivec64l.xml
+
+ # so as to make sure these get copied into the install tree
+-pkglib_DATA = $(GDBSERVER_XML_FILES)
++pkgdata_DATA = $(GDBSERVER_XML_FILES)
+
+ # so as to make sure these get copied into the tarball
+ EXTRA_DIST += $(GDBSERVER_XML_FILES)
+diff -Naur valgrind-3.7.0.orig//Makefile.am valgrind-3.7.0/Makefile.am
+--- valgrind-3.7.0.orig//Makefile.am 2011-10-26 17:24:45.000000000 -0400
++++ valgrind-3.7.0/Makefile.am 2012-01-04 22:48:58.000000000 -0500
+@@ -61,7 +61,7 @@
+ # default.supp, as it is built from the base .supp files at compile-time.
+ dist_noinst_DATA = $(SUPP_FILES)
+
+-pkglib_DATA = default.supp
++pkgdata_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 0000000..feabf06
--- /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 0000000..6af4553
--- /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-non-exec-stack.patch b/dev-util/valgrind/files/valgrind-3.7.0-non-exec-stack.patch
new file mode 100644
index 0000000..d6cc26d
--- /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 0000000..860e09c
--- /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/metadata.xml b/dev-util/valgrind/metadata.xml
new file mode 100644
index 0000000..92870ed
--- /dev/null
+++ b/dev-util/valgrind/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ </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.7.0-r2.ebuild b/dev-util/valgrind/valgrind-3.7.0-r2.ebuild
new file mode 100644
index 0000000..729a48a
--- /dev/null
+++ b/dev-util/valgrind/valgrind-3.7.0-r2.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/valgrind/valgrind-3.7.0-r1.ebuild,v 1.1 2011/11/23 19:19:48 blueness Exp $
+
+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"
+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
+
+ # 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.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
+
+ # 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)
+ # -ggdb3 segmentation fault on startup
+ filter-flags -fomit-frame-pointer
+ filter-flags -fpie
+ filter-flags -fstack-protector
+ replace-flags -ggdb3 -ggdb2
+
+ if use amd64 || use ppc64; then
+ ! has_multilib_profile && myconf="${myconf} --enable-only64bit"
+ fi
+
+ # 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 "${D}"/usr/$(get_libdir)/valgrind/*-*-linux
+}
+
+pkg_postinst() {
+ ewarn "Valgrind will not work if glibc does not have debug symbols."
+ ewarn "To fix this you can add splitdebug to FEATURES in make.conf"
+ ewarn "and remerge glibc. See:"
+ ewarn "https://bugs.gentoo.org/show_bug.cgi?id=214065"
+ ewarn "https://bugs.gentoo.org/show_bug.cgi?id=274771"
+ ewarn "https://bugs.gentoo.org/show_bug.cgi?id=388703"
+}