gdb: The signal definitions of musl and gdb collide
[openwrt/.git] / package / devel / gdb / patches / 010-aarch64-headers.patch
1 The signal definitions of musl and gdb collide
2
3 The kernel defines "struct sigcontext" in asm/sigcontext.h and musl libc 
4 defines it in signal.h which collides. 
5 Kernel 4.14 misses the definitions of struct user_sve_header so we still 
6 have to use the aarch64-sve-linux-sigcontext.h header file which also 
7 provides that and make sure aarch64-sve-linux-sigcontext.h does not 
8 provide the same headers as the kernel or musl.
9
10 --- a/gdb/nat/aarch64-sve-linux-ptrace.h
11 +++ b/gdb/nat/aarch64-sve-linux-ptrace.h
12 @@ -20,12 +20,12 @@
13  #ifndef AARCH64_SVE_LINUX_PTRACE_H
14  #define AARCH64_SVE_LINUX_PTRACE_H
15  
16 -#include <asm/sigcontext.h>
17 +#include <signal.h>
18  #include <sys/utsname.h>
19  #include <sys/ptrace.h>
20  #include <asm/ptrace.h>
21  
22 -#ifndef SVE_SIG_ZREGS_SIZE
23 +#ifndef SVE_PT_REGS_SVE
24  #include "aarch64-sve-linux-sigcontext.h"
25  #endif
26  
27 --- a/gdb/nat/aarch64-sve-linux-sigcontext.h
28 +++ b/gdb/nat/aarch64-sve-linux-sigcontext.h
29 @@ -19,6 +19,7 @@
30  #ifndef AARCH64_SVE_LINUX_SIGCONTEXT_H
31  #define AARCH64_SVE_LINUX_SIGCONTEXT_H
32  
33 +#ifndef SVE_MAGIC
34  #define SVE_MAGIC      0x53564501
35  
36  struct sve_context {
37 @@ -128,6 +129,7 @@ struct sve_context {
38         (SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET)
39  
40  #define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
41 +#endif
42  
43  /* SVE/FP/SIMD state (NT_ARM_SVE) */
44