From e3720e2a3d5ffbeaf88cbe622c8274494ff3c419 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 13 Aug 2013 21:17:07 +0200 Subject: [PATCH] valgrind: sync patches with Arch from upstream subversion repo. --- .../patches/use-sys-pthread-header.patch | 10 --- .../patches/valgrind-3.8.1-glibc-2.17.patch | 36 --------- .../patches/valgrind-3.8.1-glibc-2.18.patch | 32 ++++++++ .../valgrind-3.8.1-ptrace-build-fix.patch | 78 +++++++++++++++++++ srcpkgs/valgrind/template | 10 ++- 5 files changed, 117 insertions(+), 49 deletions(-) delete mode 100644 srcpkgs/valgrind/patches/use-sys-pthread-header.patch delete mode 100644 srcpkgs/valgrind/patches/valgrind-3.8.1-glibc-2.17.patch create mode 100644 srcpkgs/valgrind/patches/valgrind-3.8.1-glibc-2.18.patch create mode 100644 srcpkgs/valgrind/patches/valgrind-3.8.1-ptrace-build-fix.patch diff --git a/srcpkgs/valgrind/patches/use-sys-pthread-header.patch b/srcpkgs/valgrind/patches/use-sys-pthread-header.patch deleted file mode 100644 index 39a56783ec..0000000000 --- a/srcpkgs/valgrind/patches/use-sys-pthread-header.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- coregrind/vgdb.c.orig 2013-08-13 11:47:04.267748406 +0200 -+++ coregrind/vgdb.c 2013-08-13 11:47:11.851818772 +0200 -@@ -102,7 +102,6 @@ I_die_here : (PTRACEINVOKER) architectur - #include - #if defined(VGO_linux) - # include --# include - #endif - #endif - diff --git a/srcpkgs/valgrind/patches/valgrind-3.8.1-glibc-2.17.patch b/srcpkgs/valgrind/patches/valgrind-3.8.1-glibc-2.17.patch deleted file mode 100644 index 67dede7842..0000000000 --- a/srcpkgs/valgrind/patches/valgrind-3.8.1-glibc-2.17.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- configure 2012-09-19 05:19:23.000000000 +1000 -+++ configure 2012-12-27 08:11:36.645429011 +1000 -@@ -6612,6 +6612,24 @@ - - # DEFAULT_SUPP set by kernel version check above. - ;; -+ 2.1[78]*) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: 2.17 family" >&5 -+$as_echo "2.17 family" >&6; } -+ -+$as_echo "#define GLIBC_2_17 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; } -+ -+$as_echo "#define DARWIN_LIBC 1" >>confdefs.h -+ -+ # DEFAULT_SUPP set by kernel version check above. -+ ;; - bionic) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Bionic" >&5 - $as_echo "Bionic" >&6; } -@@ -6624,7 +6642,7 @@ - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported version ${GLIBC_VERSION}" >&5 - $as_echo "unsupported version ${GLIBC_VERSION}" >&6; } -- as_fn_error "Valgrind requires glibc version 2.2 - 2.16" "$LINENO" 5 -+ as_fn_error "Valgrind requires glibc version 2.2 - 2.18" "$LINENO" 5 - as_fn_error "or Darwin libc" "$LINENO" 5 - ;; - esac diff --git a/srcpkgs/valgrind/patches/valgrind-3.8.1-glibc-2.18.patch b/srcpkgs/valgrind/patches/valgrind-3.8.1-glibc-2.18.patch new file mode 100644 index 0000000000..d5e5c3cc64 --- /dev/null +++ b/srcpkgs/valgrind/patches/valgrind-3.8.1-glibc-2.18.patch @@ -0,0 +1,32 @@ +--- configure.in 2013-08-13 22:36:20.201676976 +1000 ++++ configure.in 2013-08-13 22:38:18.402750093 +1000 +@@ -906,6 +906,20 @@ + 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}" ++ ;; ++ 2.18) ++ AC_MSG_RESULT(2.18 family) ++ AC_DEFINE([GLIBC_2_18], 1, [Define to 1 if you're using glibc 2.18.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 +933,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.18]) + AC_MSG_ERROR([or Darwin libc]) + ;; + esac diff --git a/srcpkgs/valgrind/patches/valgrind-3.8.1-ptrace-build-fix.patch b/srcpkgs/valgrind/patches/valgrind-3.8.1-ptrace-build-fix.patch new file mode 100644 index 0000000000..89af000b12 --- /dev/null +++ b/srcpkgs/valgrind/patches/valgrind-3.8.1-ptrace-build-fix.patch @@ -0,0 +1,78 @@ +Index: coregrind/vgdb.c +=================================================================== +--- coregrind/vgdb.c (revision 13470) ++++ coregrind/vgdb.c (revision 13471) +@@ -100,11 +100,10 @@ + + #if defined(PTRACEINVOKER) + #include + #if defined(VGO_linux) + # include +-# include + #endif + #endif + + + // Outputs information for the user about ptrace not working. + +Index: coregrind/vgdb.c +=================================================================== +--- coregrind/vgdb.c (revision 13481) ++++ coregrind/vgdb.c (revision 13482) +@@ -691,7 +691,7 @@ + // runtime check not yet done. + // 0 : PTRACE_GETREGS runtime check has failed. + // 1 : PTRACE_GETREGS defined and runtime check ok. +-#ifdef PTRACE_GETREGS ++#ifdef HAVE_PTRACE_GETREGS + static int has_working_ptrace_getregs = -1; + #endif + +@@ -702,7 +702,7 @@ + Bool getregs (int pid, void *regs, long regs_bsz) + { + DEBUG(1, "getregs regs_bsz %ld\n", regs_bsz); +-# ifdef PTRACE_GETREGS ++# ifdef HAVE_PTRACE_GETREGS + if (has_working_ptrace_getregs) { + // Platforms having GETREGS + long res; +@@ -773,7 +773,7 @@ + DEBUG(1, "setregs regs_bsz %ld\n", regs_bsz); + // Note : the below is checking for GETREGS, not SETREGS + // as if one is defined and working, the other one should also work. +-# ifdef PTRACE_GETREGS ++# ifdef HAVE_PTRACE_GETREGS + if (has_working_ptrace_getregs) { + // Platforms having SETREGS + long res; +Index: configure.in +=================================================================== +--- configure.in (revision 13481) ++++ configure.in (revision 13482) +@@ -1040,6 +1040,25 @@ + + AM_CONDITIONAL([HAVE_GNU_STPNCPY], [test x$ac_have_gnu_stpncpy = xyes]) + ++# Check for PTRACE_GETREGS ++ ++AC_MSG_CHECKING([for PTRACE_GETREGS]) ++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++#include ++#include ++#include ++]], [[ ++ void *p; ++ long res = ptrace (PTRACE_GETREGS, 0, p, p); ++]])], [ ++AC_MSG_RESULT([yes]) ++AC_DEFINE([HAVE_PTRACE_GETREGS], 1, ++ [Define to 1 if you have the `PTRACE_GETREGS' ptrace request.]) ++], [ ++AC_MSG_RESULT([no]) ++]) ++ ++ + # Check for CLOCK_MONOTONIC + + AC_MSG_CHECKING([for CLOCK_MONOTONIC]) diff --git a/srcpkgs/valgrind/template b/srcpkgs/valgrind/template index 5645bdc95c..70c4acc305 100644 --- a/srcpkgs/valgrind/template +++ b/srcpkgs/valgrind/template @@ -1,11 +1,11 @@ # Template file for 'valgrind' pkgname=valgrind version=3.8.1 -revision=4 +revision=5 only_for_archs="i686 x86_64" build_style=gnu-configure configure_args="--enable-tls --with-mpicc=/dev/null" -hostmakedepends="perl pkg-config" +hostmakedepends="perl pkg-config automake libtool" short_desc="Tool for finding memory management bugs in programs" maintainer="Juan RP " homepage="http://valgrind.org/" @@ -13,9 +13,13 @@ license="GPL-2" distfiles="http://www.valgrind.org/downloads/${pkgname}-${version}.tar.bz2" checksum=473be00576bed311a662b277a2bfbe97d9cca4058e68619a0e420c9fc19958db +pre_configure() { + ./autogen.sh +} + valgrind-devel_package() { depends="valgrind>=${version}" - short_desc+=" -- development files" + short_desc+=" - development files" pkg_install() { vmove usr/include vmove usr/lib/pkgconfig