SHA256
1
0
forked from pool/strace
strace/strace_cid_03ef0b2.patch
Marcus Meissner aec348d425 Accepting request 223856 from home:michel_mno:branches:devel:tools
- strace -p 99999 segfault for ppc64le archi disapear if
  upstream patch 03ef0b2 is applied to this strace 4.8 version
- added patches:
  * strace_cid_03ef0b2.patch

OBS-URL: https://build.opensuse.org/request/show/223856
OBS-URL: https://build.opensuse.org/package/show/devel:tools/strace?expand=0&rev=35
2014-02-26 08:55:39 +00:00

62 lines
1.8 KiB
Diff

From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Wed, 13 Nov 2013 18:09:04 +0000
Subject: [PATCH] Assume that <sys/ptrace.h> provides a valid ptrace prototype
We used to explicitly list architectures where <sys/ptrace.h> from glibc
is known to provide a valid prototype for ptrace, and use a homegrown
replacement for all the rest. Situation seems to be better nowadays,
glibc is not the only libc available, so let's use ptrace prototype from
<sys/ptrace.h> by default, leaving the replacement for rare broken cases
if any.
* defs.h: Use ptrace prototype workaround iff
NEED_PTRACE_PROTOTYPE_WORKAROUND is defined.
This patch is adapted to Suse strace 4.8 version
Signed-off-by: Michel Normand <normand@linux.vnet.ibm.com>
---
defs.h | 24 +++++++-----------------
1 file changed, 7 insertions(+), 17 deletions(-)
Index: strace-4.8/defs.h
===================================================================
--- strace-4.8.orig/defs.h
+++ strace-4.8/defs.h
@@ -147,27 +147,17 @@ extern char *stpcpy(char *dst, const cha
/* To force NOMMU build, set to 1 */
#define NOMMU_SYSTEM 0
-#if (defined(SPARC) || defined(SPARC64) \
- || defined(I386) || defined(X32) || defined(X86_64) \
- || defined(ARM) || defined(AARCH64) \
- || defined(AVR32) \
- || defined(OR1K) \
- || defined(METAG) \
- || defined(TILE) \
- || defined(XTENSA) \
- ) && defined(__GLIBC__)
-# include <sys/ptrace.h>
-#else
-/* Work around awkward prototype in ptrace.h. */
+#ifdef NEED_PTRACE_PROTOTYPE_WORKAROUND
# define ptrace xptrace
# include <sys/ptrace.h>
# undef ptrace
-# ifdef POWERPC
-# define __KERNEL__
-# include <asm/ptrace.h>
-# undef __KERNEL__
-# endif
extern long ptrace(int, int, char *, long);
+#else
+# include <sys/ptrace.h>
+#endif
+
+#if defined(POWERPC)
+# include <asm/ptrace.h>
#endif
#if defined(TILE)