summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurice van der Pot <griffon26@gentoo.org>2009-07-26 12:05:52 +0000
committerMaurice van der Pot <griffon26@gentoo.org>2009-07-26 12:05:52 +0000
commit0a7a9581225fce32f4a170da130a59b06ed97bca (patch)
tree6aecb7efda4e8e2ac494f009ca261318766ab68d /dev-util/valgrind
parentadd <herd> tag (diff)
downloadgentoo-2-0a7a9581225fce32f4a170da130a59b06ed97bca.tar.gz
gentoo-2-0a7a9581225fce32f4a170da130a59b06ed97bca.tar.bz2
gentoo-2-0a7a9581225fce32f4a170da130a59b06ed97bca.zip
Added valgrind-3.4.1-r1 to handle incompatibility with glibc 2.10's strlen (bug #274771) and add optional mpi support (bug #258832).
(Portage version: 2.1.6.13/cvs/Linux x86_64)
Diffstat (limited to 'dev-util/valgrind')
-rw-r--r--dev-util/valgrind/ChangeLog11
-rw-r--r--dev-util/valgrind/files/valgrind-3.4.1-glibc-2.10.1.patch49
-rw-r--r--dev-util/valgrind/files/valgrind-3.4.1-x86_64-ldso-strlen.patch82
-rw-r--r--dev-util/valgrind/valgrind-3.4.1-r1.ebuild106
4 files changed, 247 insertions, 1 deletions
diff --git a/dev-util/valgrind/ChangeLog b/dev-util/valgrind/ChangeLog
index f9e2cfd8725e..7fb45cdf271a 100644
--- a/dev-util/valgrind/ChangeLog
+++ b/dev-util/valgrind/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for dev-util/valgrind
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/valgrind/ChangeLog,v 1.102 2009/07/22 20:23:50 josejx Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/valgrind/ChangeLog,v 1.103 2009/07/26 12:05:52 griffon26 Exp $
+
+*valgrind-3.4.1-r1 (26 Jul 2009)
+
+ 26 Jul 2009; Maurice van der Pot <griffon26@gentoo.org>
+ +valgrind-3.4.1-r1.ebuild, +files/valgrind-3.4.1-glibc-2.10.1.patch,
+ +files/valgrind-3.4.1-x86_64-ldso-strlen.patch:
+ Added -r1 with fix for bug #274771. Thanks to Nikos Chantziaras
+ <realnc@gmail.com> for the bug report and the reference to a patch.
+ Also added mpi use flag to support debugging MPI programs (bug #258832).
22 Jul 2009; Joseph Jezak <josejx@gentoo.org> valgrind-3.4.1.ebuild:
Marked ppc stable for bug #278534.
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
new file mode 100644
index 000000000000..393dc7c2fc6d
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.4.1-glibc-2.10.1.patch
@@ -0,0 +1,49 @@
+--- valgrind-3.4.1/glibc-2.X.supp.in.jj 2009-03-01 17:04:51.000000000 -0500
++++ valgrind-3.4.1/glibc-2.X.supp.in 2009-05-11 11:17:35.605396000 -0400
+@@ -168,9 +168,9 @@
+ Memcheck:Param
+ socketcall.sendto(msg)
+ fun:__sendto_nocancel
+- obj:/*libc-@GLIBC_VERSION@.so
+- obj:/*libc-@GLIBC_VERSION@.so
+- obj:/*libc-@GLIBC_VERSION@.so
++ obj:/*libc-@GLIBC_VERSION@*.so
++ obj:/*libc-@GLIBC_VERSION@*.so
++ obj:/*libc-@GLIBC_VERSION@*.so
+ }
+ {
+ glibc24-64bit-padding-1c
+@@ -180,7 +180,7 @@
+ fun:__nscd_get_map_ref
+ fun:nscd_get*_r
+ fun:*nscd*
+- obj:/*libc-@GLIBC_VERSION@.so
++ obj:/*libc-@GLIBC_VERSION@*.so
+ }
+
+
+@@ -199,18 +199,18 @@
+ Memcheck:Param
+ socketcall.sendto(msg)
+ fun:send
+- obj:/*libc-@GLIBC_VERSION@.so
+- obj:/*libc-@GLIBC_VERSION@.so
+- obj:/*libc-@GLIBC_VERSION@.so
++ obj:/*libc-@GLIBC_VERSION@*.so
++ obj:/*libc-@GLIBC_VERSION@*.so
++ obj:/*libc-@GLIBC_VERSION@*.so
+ }
+ {
+ X11-64bit-padding-4b
+ Memcheck:Param
+ socketcall.send(msg)
+ fun:send
+- obj:/*libc-@GLIBC_VERSION@.so
+- obj:/*libc-@GLIBC_VERSION@.so
+- obj:/*libc-@GLIBC_VERSION@.so
++ obj:/*libc-@GLIBC_VERSION@*.so
++ obj:/*libc-@GLIBC_VERSION@*.so
++ obj:/*libc-@GLIBC_VERSION@*.so
+ }
+
+ ##----------------------------------------------------------------------##
diff --git a/dev-util/valgrind/files/valgrind-3.4.1-x86_64-ldso-strlen.patch b/dev-util/valgrind/files/valgrind-3.4.1-x86_64-ldso-strlen.patch
new file mode 100644
index 000000000000..a6ddfec33446
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.4.1-x86_64-ldso-strlen.patch
@@ -0,0 +1,82 @@
+--- valgrind/coregrind/pub_core_trampoline.h.jj 2009-04-22 12:10:54.000000000 +0200
++++ valgrind/coregrind/pub_core_trampoline.h 2009-04-22 14:50:39.000000000 +0200
+@@ -66,6 +66,7 @@ extern Char* VG_(x86_linux_REDIR_FOR_ind
+ extern void VG_(amd64_linux_SUBST_FOR_rt_sigreturn);
+ extern void VG_(amd64_linux_REDIR_FOR_vgettimeofday);
+ extern void VG_(amd64_linux_REDIR_FOR_vtime);
++extern UInt VG_(amd64_linux_REDIR_FOR_strlen)( void* );
+ #endif
+
+ #if defined(VGP_ppc32_linux)
+--- valgrind/coregrind/m_redir.c.jj 2009-04-22 12:10:54.000000000 +0200
++++ valgrind/coregrind/m_redir.c 2009-04-22 15:32:19.000000000 +0200
+@@ -879,6 +879,20 @@ void VG_(redir_initialise) ( void )
+ (Addr)&VG_(amd64_linux_REDIR_FOR_vtime)
+ );
+
++ /* If we're using memcheck, use these intercepts right from
++ the start, otherwise ld.so makes a lot of noise. */
++ if (0==VG_(strcmp)("Memcheck", VG_(details).name)) {
++
++ static const HChar croakage[]
++ = "Possible fix: add splitdebug to FEATURES in make.conf and remerge glibc.";
++
++ /* this is mandatory - can't sanely continue without it */
++ add_hardwired_spec(
++ "ld-linux-x86-64.so.2", "strlen",
++ (Addr)&VG_(amd64_linux_REDIR_FOR_strlen),
++ croakage
++ );
++ }
+ # elif defined(VGP_ppc32_linux)
+ {
+ static const HChar croakage[]
+--- valgrind/coregrind/m_trampoline.S.jj 2009-04-22 12:10:54.000000000 +0200
++++ valgrind/coregrind/m_trampoline.S 2009-04-22 15:18:37.000000000 +0200
+@@ -174,7 +174,29 @@ VG_(amd64_linux_REDIR_FOR_vtime):
+ .LfnE3:
+ .size VG_(amd64_linux_REDIR_FOR_vtime), .-.LfnB3
+
+-/* A CIE for the above two functions, followed by their FDEs */
++/* There's no particular reason that this needs to be handwritten
++ assembly, but since that's what this file contains, here's a
++ simple strlen implementation (written in C and compiled by gcc.)
++*/
++.global VG_(amd64_linux_REDIR_FOR_strlen)
++.type VG_(amd64_linux_REDIR_FOR_strlen), @function
++VG_(amd64_linux_REDIR_FOR_strlen):
++.LfnB4:
++ xorl %eax, %eax
++ cmpb $0, (%rdi)
++ movq %rdi, %rdx
++ je .L41
++.L40: addq $1, %rdx
++ cmpb $0, (%rdx)
++ jne .L40
++ movq %rdx, %rax
++ subq %rdi, %rax
++.L41: ret
++.LfnE4:
++.size VG_(amd64_linux_REDIR_FOR_strlen), .-VG_(amd64_linux_REDIR_FOR_strlen)
++
++
++/* A CIE for the above three functions, followed by their FDEs */
+ .section .eh_frame,"a",@progbits
+ .Lframe1:
+ .long .LEcie1-.LScie1
+@@ -212,6 +234,15 @@ VG_(amd64_linux_REDIR_FOR_vtime):
+ .uleb128 0x0
+ .align 8
+ .LEfde3:
++.LSfde4:
++ .long .LEfde4-.LASfde4
++.LASfde4:
++ .long .LASfde4-.Lframe1
++ .long .LfnB4
++ .long .LfnE4-.LfnB4
++ .uleb128 0x0
++ .align 8
++.LEfde4:
+ .previous
+
+ .global VG_(trampoline_stuff_end)
diff --git a/dev-util/valgrind/valgrind-3.4.1-r1.ebuild b/dev-util/valgrind/valgrind-3.4.1-r1.ebuild
new file mode 100644
index 000000000000..22ff84915236
--- /dev/null
+++ b/dev-util/valgrind/valgrind-3.4.1-r1.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/valgrind/valgrind-3.4.1-r1.ebuild,v 1.1 2009/07/26 12:05:52 griffon26 Exp $
+
+inherit autotools eutils flag-o-matic toolchain-funcs
+
+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"
+IUSE="mpi"
+
+DEPEND="mpi? ( virtual/mpi )"
+RDEPEND="${DEPEND}
+ !dev-util/callgrind"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # make sure our CFLAGS are respected
+ einfo "Changing configure.in to respect CFLAGS"
+ sed -i -e 's:^CFLAGS="-Wno-long-long":CFLAGS="$CFLAGS -Wno-long-long":' configure.in
+
+ # undefined references to __guard and __stack_smash_handler in VEX (bug #114347)
+ einfo "Changing Makefile.flags.am to disable SSP"
+ sed -i -e 's:^AM_CFLAGS_BASE = :AM_CFLAGS_BASE = -fno-stack-protector :' Makefile.flags.am
+
+ # Correct hard coded doc location
+ sed -i -e "s:doc/valgrind:doc/${P}:" docs/Makefile.am
+
+ # Remove defaulting to ppc32-linux on ppc64 without multilib
+ # "valgrind: failed to start tool 'memcheck' for platform 'ppc32-linux':
+ # No such file or directory"
+ if use ppc64 && ! has_multilib_profile; then
+ epatch "${FILESDIR}/valgrind-3.3.0-only64bit.patch"
+ fi
+
+ # Use local labels in inline asm to prevent 'symbol already defined' errors
+ # when optimisation is on (bug #234644).
+ epatch "${FILESDIR}/valgrind-3.3.1-local-labels.patch"
+
+ # valgrind spits out many false positives on amd64 because of glibc-2.10's
+ # optimized strlen if there is no debug info for glibc (bug #274771). This
+ # patch adds a run-time error if debug info cannot be found.
+ epatch "${FILESDIR}/valgrind-3.4.1-x86_64-ldso-strlen.patch"
+
+ # Fix up some suppressions that were not general enough for glibc versions
+ # with more than just a major and minor number.
+ epatch "${FILESDIR}/valgrind-3.4.1-glibc-2.10.1.patch"
+
+ # Regenerate autotools files
+ eautoreconf
+}
+
+src_compile() {
+ 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
+
+ # gcc 3.3.x fails to compile valgrind with -O3 (bug #129776)
+ if [ "$(gcc-version)" == "3.3" ] && is-flagq -O3; then
+ ewarn "GCC 3.3 cannot compile valgrind with -O3 in CFLAGS, using -O2 instead."
+ replace-flags -O3 -O2
+ fi
+
+ 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} || die "Configure failed!"
+ emake || die "Make failed!"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "Install failed!"
+ dodoc ACKNOWLEDGEMENTS AUTHORS FAQ.txt NEWS README*
+}
+
+pkg_postinst() {
+ if use ppc || use ppc64 || use amd64 ; then
+ ewarn "Valgrind will not work on ppc, ppc64 or amd64 if glibc does not have"
+ ewarn "debug symbols (see https://bugs.gentoo.org/show_bug.cgi?id=214065"
+ ewarn "and http://bugs.gentoo.org/show_bug.cgi?id=274771)."
+ ewarn "To fix this you can add splitdebug to FEATURES in make.conf and"
+ ewarn "remerge glibc."
+ fi
+}