summaryrefslogtreecommitdiff
path: root/extra/valgrind/valgrind-3.8.1-ptrace-build-fix.patch
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-08-16 01:45:08 -0700
committerroot <root@rshg054.dnsready.net>2013-08-16 01:45:08 -0700
commit6a3f02abeeecab3efb4442e39e28e05897f25316 (patch)
treed64fee954cd25e076689b8fea617e207b86f3749 /extra/valgrind/valgrind-3.8.1-ptrace-build-fix.patch
parent67142d22ee558cc14309b0a3d372ed796ae8d545 (diff)
Fri Aug 16 01:44:39 PDT 2013
Diffstat (limited to 'extra/valgrind/valgrind-3.8.1-ptrace-build-fix.patch')
-rw-r--r--extra/valgrind/valgrind-3.8.1-ptrace-build-fix.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/extra/valgrind/valgrind-3.8.1-ptrace-build-fix.patch b/extra/valgrind/valgrind-3.8.1-ptrace-build-fix.patch
new file mode 100644
index 000000000..89af000b1
--- /dev/null
+++ b/extra/valgrind/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 <sys/user.h>
+ #if defined(VGO_linux)
+ # include <sys/prctl.h>
+-# include <linux/ptrace.h>
+ #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 <stddef.h>
++#include <sys/ptrace.h>
++#include <sys/user.h>
++]], [[
++ 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])