summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-03-30 17:56:47 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-31 09:15:05 +0100
commitcf6788c236d09075c941ee27bc582c59fd132839 (patch)
treefdc92927efc29c555a7861ea2f97e6a6bc25b351
parentede11b6b4249282f034da589f419f851a209220f (diff)
downloadpoky-cf6788c236d09075c941ee27bc582c59fd132839.tar.gz
psmisc: Remove including sys/user.h and __WORDSIZE
We can replace __WORDSIZE with UINTPTR_MAX sys/user.h is in conflict with asm/ptrace.h on musl (From OE-Core rev: 9393cbb392d37bebc5f4bc79297940cd8fbd2816) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch51
-rw-r--r--meta/recipes-extended/psmisc/psmisc_22.21.bb8
2 files changed, 56 insertions, 3 deletions
diff --git a/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch b/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch
new file mode 100644
index 0000000000..b57a006bc6
--- /dev/null
+++ b/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch
@@ -0,0 +1,51 @@
1From 5dc872bb2fba6421cb8e1ee578f7bd4aaed55f61 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 24 Mar 2016 15:46:14 +0000
4Subject: [PATCH] Use UINTPTR_MAX instead of __WORDSIZE
5
6Do not include sys/user.h since it conflicts with
7pt_regs struct from kernel APIs in asm/ptrace.h
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11Upstream-Status: Pending
12
13 src/peekfd.c | 13 ++++++++-----
14 1 file changed, 8 insertions(+), 5 deletions(-)
15
16diff --git a/src/peekfd.c b/src/peekfd.c
17index cba2130..0d39878 100644
18--- a/src/peekfd.c
19+++ b/src/peekfd.c
20@@ -30,8 +30,11 @@
21 #include <asm/ptrace.h>
22 #include <byteswap.h>
23 #include <endian.h>
24+#ifdef __GLIBC__
25 #include <sys/user.h>
26+#endif
27 #include <stdlib.h>
28+#include <stdint.h>
29 #include <getopt.h>
30 #include <ctype.h>
31
32@@ -228,11 +231,11 @@ int main(int argc, char **argv)
33 if (WIFSTOPPED(status)) {
34 #ifdef PPC
35 struct pt_regs regs;
36- regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R0, 0);
37- regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R3, 0);
38- regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R4, 0);
39- regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R5, 0);
40- regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_ORIG_R3, 0);
41+ regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R0, 0);
42+ regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R3, 0);
43+ regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R4, 0);
44+ regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R5, 0);
45+ regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_ORIG_R3, 0);
46 #elif defined(ARM)
47 struct pt_regs regs;
48 ptrace(PTRACE_GETREGS, pid, 0, &regs);
49--
501.9.1
51
diff --git a/meta/recipes-extended/psmisc/psmisc_22.21.bb b/meta/recipes-extended/psmisc/psmisc_22.21.bb
index 66aba9ec57..1c6473ebf4 100644
--- a/meta/recipes-extended/psmisc/psmisc_22.21.bb
+++ b/meta/recipes-extended/psmisc/psmisc_22.21.bb
@@ -5,6 +5,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
5SRC_URI[md5sum] = "935c0fd6eb208288262b385fa656f1bf" 5SRC_URI[md5sum] = "935c0fd6eb208288262b385fa656f1bf"
6SRC_URI[sha256sum] = "97323cad619210845b696d7d722c383852b2acb5c49b5b0852c4f29c77a8145a" 6SRC_URI[sha256sum] = "97323cad619210845b696d7d722c383852b2acb5c49b5b0852c4f29c77a8145a"
7 7
8SRC_URI += "file://0001-Typo-in-fuser-makes-M-on-all-the-time.patch \ 8SRC_URI = "${SOURCEFORGE_MIRROR}/psmisc/psmisc-${PV}.tar.gz \
9 file://0002-Include-limits.h-for-PATH_MAX.patch \ 9 file://0001-Typo-in-fuser-makes-M-on-all-the-time.patch \
10 " 10 file://0002-Include-limits.h-for-PATH_MAX.patch \
11 file://0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch \
12 "