hc
2023-05-26 a23f51ed7a39e452c1037343a84d7db1ca2c5bd7
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
From 6bdab5cc8f1e2ec5f84fc9f59f1699a726980709 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 23 Mar 2016 06:08:59 +0000
Subject: [PATCH 4/6] Fix build on mips/musl
 
Do not include endian.h on musl it includes
further headers which can not be compiled in __ASSEMBLER__
 mode
 
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
---
 src/coredump/_UCD_internal.h | 35 +++++++++++++++++++++++++++++++++++
 src/mips/getcontext.S        |  3 +--
 2 files changed, 36 insertions(+), 2 deletions(-)
 
diff --git a/src/coredump/_UCD_internal.h b/src/coredump/_UCD_internal.h
index 3c95a2a..21ed1c3 100644
--- a/src/coredump/_UCD_internal.h
+++ b/src/coredump/_UCD_internal.h
@@ -44,6 +44,41 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
 
 #include "libunwind_i.h"
 
+#ifndef __GLIBC__
+#include <sys/reg.h>
+
+#define EF_REG0            6
+#define EF_REG1            7
+#define EF_REG2            8
+#define EF_REG3            9
+#define EF_REG4            10
+#define EF_REG5            11
+#define EF_REG6            12
+#define EF_REG7            13
+#define EF_REG8            14
+#define EF_REG9            15
+#define EF_REG10        16
+#define EF_REG11        17
+#define EF_REG12        18
+#define EF_REG13        19
+#define EF_REG14        20
+#define EF_REG15        21
+#define EF_REG16        22
+#define EF_REG17        23
+#define EF_REG18        24
+#define EF_REG19        25
+#define EF_REG20        26
+#define EF_REG21        27
+#define EF_REG22        28
+#define EF_REG23        29
+#define EF_REG24        30
+#define EF_REG25        31
+#define EF_REG28        34
+#define EF_REG29        35
+#define EF_REG30        36
+#define EF_REG31        37
+#endif
+
 
 #if SIZEOF_OFF_T == 4
 typedef uint32_t uoff_t;
diff --git a/src/mips/getcontext.S b/src/mips/getcontext.S
index d1dbd57..de9b681 100644
--- a/src/mips/getcontext.S
+++ b/src/mips/getcontext.S
@@ -24,12 +24,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
 
 #include "offsets.h"
-#include <endian.h>
 
     .text
 
 #if _MIPS_SIM == _ABIO32
-# if __BYTE_ORDER == __BIG_ENDIAN
+# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
 #  define OFFSET 4
 # else
 #  define OFFSET 0
-- 
2.20.1