1From bf84f8f74f087fbf1c4adc293433cd2e7b70df58 Mon Sep 17 00:00:00 2001 2From: Jeffy Chen <jeffy.chen@rock-chips.com> 3Date: Wed, 25 May 2022 21:46:16 +0800 4Subject: [PATCH] The signal definitions of musl and gdb collide 5 6The kernel defines "struct sigcontext" in asm/sigcontext.h and musl libc 7defines it in signal.h which collides. 8Kernel 4.14 misses the definitions of struct user_sve_header so we still 9have to use the aarch64-sve-linux-sigcontext.h header file which also 10provides that and make sure aarch64-sve-linux-sigcontext.h does not 11provide the same headers as the kernel or musl. 12 13From: 14https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/devel/gdb/patches/010-aarch64-headers.patch;h=a718a8c6a4e2d898f33a4f61ab1dc3228f4c3a48;hb=bc89690f6e2c80e100b4dbfbabc7c7adb8218d74 15 16Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> 17--- 18 gdb/nat/aarch64-sve-linux-ptrace.h | 2 +- 19 gdb/nat/aarch64-sve-linux-sigcontext.h | 2 ++ 20 2 files changed, 3 insertions(+), 1 deletion(-) 21 22diff --git a/gdb/nat/aarch64-sve-linux-ptrace.h b/gdb/nat/aarch64-sve-linux-ptrace.h 23index 5c264b3..bf959dc 100644 24--- a/gdb/nat/aarch64-sve-linux-ptrace.h 25+++ b/gdb/nat/aarch64-sve-linux-ptrace.h 26@@ -31,7 +31,7 @@ 27 #include <sys/ptrace.h> 28 #include <asm/ptrace.h> 29 30-#ifndef SVE_SIG_ZREGS_SIZE 31+#ifndef SVE_PT_REGS_SVE 32 #include "aarch64-sve-linux-sigcontext.h" 33 #endif 34 35diff --git a/gdb/nat/aarch64-sve-linux-sigcontext.h b/gdb/nat/aarch64-sve-linux-sigcontext.h 36index 1b40ffa..373e222 100644 37--- a/gdb/nat/aarch64-sve-linux-sigcontext.h 38+++ b/gdb/nat/aarch64-sve-linux-sigcontext.h 39@@ -19,6 +19,7 @@ 40 #ifndef NAT_AARCH64_SVE_LINUX_SIGCONTEXT_H 41 #define NAT_AARCH64_SVE_LINUX_SIGCONTEXT_H 42 43+#ifndef SVE_MAGIC 44 #define SVE_MAGIC 0x53564501 45 46 struct sve_context { 47@@ -128,6 +129,7 @@ struct sve_context { 48 (SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET) 49 50 #define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq)) 51+#endif 52 53 /* SVE/FP/SIMD state (NT_ARM_SVE) */ 54 55-- 562.20.1 57 58