From 9393cbb392d37bebc5f4bc79297940cd8fbd2816 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 30 Mar 2016 17:56:47 +0000 Subject: 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 Signed-off-by: Khem Raj Signed-off-by: Richard Purdie --- ...001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch | 51 ++++++++++++++++++++++ meta/recipes-extended/psmisc/psmisc_22.21.bb | 8 ++-- 2 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch (limited to 'meta/recipes-extended') 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 @@ +From 5dc872bb2fba6421cb8e1ee578f7bd4aaed55f61 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 24 Mar 2016 15:46:14 +0000 +Subject: [PATCH] Use UINTPTR_MAX instead of __WORDSIZE + +Do not include sys/user.h since it conflicts with +pt_regs struct from kernel APIs in asm/ptrace.h + +Signed-off-by: Khem Raj +--- +Upstream-Status: Pending + + src/peekfd.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/src/peekfd.c b/src/peekfd.c +index cba2130..0d39878 100644 +--- a/src/peekfd.c ++++ b/src/peekfd.c +@@ -30,8 +30,11 @@ + #include + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + #include ++#include + #include + #include + +@@ -228,11 +231,11 @@ int main(int argc, char **argv) + if (WIFSTOPPED(status)) { + #ifdef PPC + struct pt_regs regs; +- regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R0, 0); +- regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R3, 0); +- regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R4, 0); +- regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R5, 0); +- regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_ORIG_R3, 0); ++ regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R0, 0); ++ regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R3, 0); ++ regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R4, 0); ++ regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R5, 0); ++ regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_ORIG_R3, 0); + #elif defined(ARM) + struct pt_regs regs; + ptrace(PTRACE_GETREGS, pid, 0, ®s); +-- +1.9.1 + 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" SRC_URI[md5sum] = "935c0fd6eb208288262b385fa656f1bf" SRC_URI[sha256sum] = "97323cad619210845b696d7d722c383852b2acb5c49b5b0852c4f29c77a8145a" -SRC_URI += "file://0001-Typo-in-fuser-makes-M-on-all-the-time.patch \ - file://0002-Include-limits.h-for-PATH_MAX.patch \ - " +SRC_URI = "${SOURCEFORGE_MIRROR}/psmisc/psmisc-${PV}.tar.gz \ + file://0001-Typo-in-fuser-makes-M-on-all-the-time.patch \ + file://0002-Include-limits.h-for-PATH_MAX.patch \ + file://0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch \ + " -- cgit v1.2.3