summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/musl/musl/0001-riscv-Define-sigcontext-again.patch
blob: fcb324e15f2bd32fa32a4b7e3e521df7cea111e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
commit a0993f8f0f161423ecdcb754f282ffd2fe47a7b5
Author: Rich Felker <dalias@aerifal.cx>
Date:   Wed Oct 2 09:28:03 2019 -0400

    reintroduce riscv64 struct sigcontext
    
    commit ab3eb89a8b83353cdaab12ed017a67a7730f90e9 removed it as part of
    correcting the mcontext_t definition, but there is still code using
    struct sigcontext and expecting the member names present in it, most
    notably libgcc_eh. almost all such usage is incorrect, but bring back
    struct sigcontext at least for now so as not to introduce regressions.

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
diff --git a/arch/riscv64/bits/signal.h b/arch/riscv64/bits/signal.h
index 03fe48c1..2ff4be30 100644
--- a/arch/riscv64/bits/signal.h
+++ b/arch/riscv64/bits/signal.h
@@ -6,12 +6,6 @@
 # define SIGSTKSZ 8192
 #endif
 
-#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-typedef unsigned long greg_t;
-typedef unsigned long gregset_t[32];
-typedef union __riscv_mc_fp_state fpregset_t;
-#endif
-
 typedef unsigned long __riscv_mc_gp_state[32];
 
 struct __riscv_mc_f_ext_state {
@@ -41,6 +35,16 @@ typedef struct mcontext_t {
 	union __riscv_mc_fp_state __fpregs;
 } mcontext_t;
 
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+typedef unsigned long greg_t;
+typedef unsigned long gregset_t[32];
+typedef union __riscv_mc_fp_state fpregset_t;
+struct sigcontext {
+	gregset_t gregs;
+	fpregset_t fpregs;
+};
+#endif
+
 struct sigaltstack {
 	void *ss_sp;
 	int ss_flags;