]> granicus.if.org Git - strace/commitdiff
s390x: fix build with old kernel headers
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sun, 5 Aug 2018 07:38:17 +0000 (09:38 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 5 Aug 2018 11:49:04 +0000 (11:49 +0000)
Avoid defining psw_compat_t and s390_compat_regs if their definitions
are provided by kernel.  Before Linux commit v3.10-rc1~201^2~11,
these definition were available in <asm/ptrace.h>.

* configure.ac (AC_CHECK_TYPES): Check for s390_compat_regs.
* linux/s390x/arch_regs.c [HAVE_S390_COMPAT_REGS]: Do not define
psw_compat_t and s390_compat_regs.
* NEWS: Mention this fix.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
NEWS
configure.ac
linux/s390x/arch_regs.c

diff --git a/NEWS b/NEWS
index 339ebac8025d6dbc8a6b01a7d77e81b47d3de54e..4cae2e0928e707784af4941d7687402f35906677 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,8 @@ Noteworthy changes in release ?.?? (????-??-??)
   * Fixed race condition in aio test.
   * Fixed build with Bionic libc.
   * Fixed build with glibc-2.28.
+  * Fixed build on s390 with kernel headers that do not contain Linux commit
+    v3.10-rc1~201^2~11.
 
 Noteworthy changes in release 4.23 (2018-06-14)
 ===============================================
index e78441533791ccad7179441161388cf2725b88f5..ad1d00fbce7a9c0b57d455c3440e1226fc9d8e3b 100644 (file)
@@ -318,6 +318,9 @@ AC_CHECK_TYPES(m4_normalize([
        struct ptrace_peeksiginfo_args
 ]),,, [#include <sys/ptrace.h>])
 
+# For kernels that do not have v3.10-rc1~201^2~11
+AC_CHECK_TYPES([s390_compat_regs],,, [#include <asm/ptrace.h>])
+
 AC_CHECK_TYPES(m4_normalize([
        struct flock,
        struct flock64,
index b5efde764785be1da38d72eee992895a933ef3e4..58f7b782383c31ee92f1ebe56b7c941aab9d85cb 100644 (file)
@@ -1,3 +1,4 @@
+#ifndef HAVE_S390_COMPAT_REGS
 typedef struct {
        uint32_t mask;
        uint32_t addr;
@@ -9,6 +10,7 @@ typedef struct {
        uint32_t acrs[NUM_ACRS];
        uint32_t orig_gpr2;
 } s390_compat_regs;
+#endif
 
 static union {
        s390_compat_regs s390_regs;