[OpenWrt-Devel] [PATCH] strace: fix build on mpc85xx target

Alexandru Ardelean ardeleanalex at gmail.com
Wed Apr 27 11:17:11 EDT 2016


This is another issue with musl and kernel headers colliding.
However this one cannot seem to be fixed with header guards
as my last 2 patches for mpc85xx.

Patch 1: http://patchwork.ozlabs.org/patch/614830/
Patch 2: http://patchwork.ozlabs.org/patch/615669/

It seems that doing a bit inclusion black-magic
in the strace package fixes this.

Adding header guards in musl seems a bit tricky, because
strace requires some reg definitions from the kernel headers
which are not in the musl headers.

The ar71xx target seems to build fine with this change.
It's the only I've manually tested (other than mpc85xx).

Build failure is (from buildbot):
===========================================================
process.Tpo -c -o strace-process.o `test -f 'process.c' || echo './'`process.c
In file included from /store/buildbot/slave/mpc85xx/build/staging_dir/toolchain-powerpc_8540_gcc-5.3.0_musl-1.1.14/include/linux/ptrace.h:100:0,
                 from ptrace.h:55,
                 from process.c:46:
/store/buildbot/slave/mpc85xx/build/staging_dir/toolchain-powerpc_8540_gcc-5.3.0_musl-1.1.14/include/asm/ptrace.h:31:8: error: redefinition of 'struct pt_regs'
 struct pt_regs {
        ^
In file included from /store/buildbot/slave/mpc85xx/build/staging_dir/toolchain-powerpc_8540_gcc-5.3.0_musl-1.1.14/include/sys/user.h:11:0,
                 from regs.h:1,
                 from process.c:45:
/store/buildbot/slave/mpc85xx/build/staging_dir/toolchain-powerpc_8540_gcc-5.3.0_musl-1.1.14/include/bits/user.h:1:8: note: originally defined here
 struct pt_regs {
        ^
Makefile:3141: recipe for target 'strace-process.o' failed
===========================================================

Signed-off-by: Alexandru Ardelean <ardeleanalex at gmail.com>
---
 .../ocedo-001-workaround-pt_regs-collisions-ppc.patch     | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 package/devel/strace/patches/ocedo-001-workaround-pt_regs-collisions-ppc.patch

diff --git a/package/devel/strace/patches/ocedo-001-workaround-pt_regs-collisions-ppc.patch b/package/devel/strace/patches/ocedo-001-workaround-pt_regs-collisions-ppc.patch
new file mode 100644
index 0000000..3a56003
--- /dev/null
+++ b/package/devel/strace/patches/ocedo-001-workaround-pt_regs-collisions-ppc.patch
@@ -0,0 +1,15 @@
+diff --git a/ptrace.h b/ptrace.h
+index d8af976..f767378 100644
+--- a/ptrace.h
++++ b/ptrace.h
+@@ -52,7 +52,10 @@ extern long ptrace(int, int, char *, long);
+ # define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args
+ #endif
+ 
++#include <linux/types.h>
++#define __ASSEMBLY__
+ #include <linux/ptrace.h>
++#undef __ASSEMBLY__
+ 
+ #ifdef HAVE_STRUCT_IA64_FPREG
+ # undef ia64_fpreg
-- 
2.8.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list