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