Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / debian / patches / mips64el.patch
1 --- a/basis-library/mlton/platform.sig
2 +++ b/basis-library/mlton/platform.sig
3 @@ -10,7 +10,7 @@
4 structure Arch:
5 sig
6 datatype t = Alpha | AMD64 | ARM | ARM64 | HPPA | IA64 | m68k |
7 - MIPS | PowerPC | PowerPC64 | S390 | Sparc | X86
8 + MIPS | MIPS64 | PowerPC | PowerPC64 | S390 | Sparc | X86
9
10 val fromString: string -> t option
11 val host: t
12 --- a/basis-library/mlton/platform.sml
13 +++ b/basis-library/mlton/platform.sml
14 @@ -25,6 +25,7 @@
15 (IA64, "IA64"),
16 (m68k, "m68k"),
17 (MIPS, "MIPS"),
18 + (MIPS64, "MIPS64"),
19 (PowerPC, "PowerPC"),
20 (PowerPC64, "PowerPC64"),
21 (S390, "S390"),
22 --- a/basis-library/primitive/prim-mlton.sml
23 +++ b/basis-library/primitive/prim-mlton.sml
24 @@ -154,6 +154,7 @@
25 | IA64
26 | m68k
27 | MIPS
28 + | MIPS64
29 | PowerPC
30 | PowerPC64
31 | S390
32 @@ -170,6 +171,7 @@
33 | "ia64" => IA64
34 | "m68k" => m68k
35 | "mips" => MIPS
36 + | "mips64" => MIPS64
37 | "powerpc" => PowerPC
38 | "powerpc64" => PowerPC64
39 | "s390" => S390
40 --- a/bin/platform
41 +++ b/bin/platform
42 @@ -108,6 +108,9 @@
43 m68k*)
44 HOST_ARCH=m68k
45 ;;
46 +mips64*)
47 + HOST_ARCH=mips64
48 +;;
49 mips*)
50 # big-endian and little-endian detect via headers
51 HOST_ARCH=mips
52 --- a/lib/stubs/mlton-stubs/mlton.sml
53 +++ b/lib/stubs/mlton-stubs/mlton.sml
54 @@ -159,7 +159,7 @@
55 structure Arch =
56 struct
57 datatype t = Alpha | AMD64 | ARM | ARM64 | HPPA | IA64 | m68k |
58 - MIPS | PowerPC | PowerPC64 | S390 | Sparc | X86
59 + MIPS | MIPS64 | PowerPC | PowerPC64 | S390 | Sparc | X86
60
61 val all = [(Alpha, "Alpha"),
62 (AMD64, "AMD64"),
63 @@ -169,6 +169,7 @@
64 (IA64, "IA64"),
65 (m68k, "m68k"),
66 (MIPS, "MIPS"),
67 + (MIPS64, "MIPS64"),
68 (PowerPC, "PowerPC"),
69 (PowerPC64, "PowerPC64"),
70 (S390, "S390"),
71 --- a/lib/stubs/mlton-stubs/platform.sig
72 +++ b/lib/stubs/mlton-stubs/platform.sig
73 @@ -10,7 +10,7 @@
74 structure Arch:
75 sig
76 datatype t = Alpha | AMD64 | ARM | ARM64 | HPPA | IA64 | m68k |
77 - MIPS | PowerPC | PowerPC64 | S390 | Sparc | X86
78 + MIPS | MIPS64 | PowerPC | PowerPC64 | S390 | Sparc | X86
79
80 val fromString: string -> t option
81 val host: t
82 --- a/mlton/main/main.fun
83 +++ b/mlton/main/main.fun
84 @@ -192,6 +192,7 @@
85 | HPPA => true
86 | IA64 => true
87 | MIPS => true
88 + | MIPS64 => true
89 | Sparc => true
90 | S390 => true
91 | _ => false
92 --- a/runtime/cenv.h
93 +++ b/runtime/cenv.h
94 @@ -101,6 +101,8 @@
95 #include "platform/ia64.h"
96 #elif (defined (__m68k__))
97 #include "platform/m68k.h"
98 +#elif (defined (__mips64))
99 +#include "platform/mips64.h"
100 #elif (defined (__mips__))
101 #include "platform/mips.h"
102 #elif (defined (__powerpc64__))
103 --- /dev/null
104 +++ b/runtime/platform/mips64.h
105 @@ -0,0 +1 @@
106 +#define MLton_Platform_Arch_host "mips64"
107 --- a/runtime/platform/linux.c
108 +++ b/runtime/platform/linux.c
109 @@ -37,7 +37,7 @@
110 #else
111 GC_handleSigProf ((code_pointer) scp->si_regs.pc);
112 #endif
113 -#elif (defined (__mips__))
114 +#elif (defined (__mips64)) || (defined (__mips__))
115 ucontext_t* ucp = (ucontext_t*)context;
116 #ifdef __UCLIBC__
117 GC_handleSigProf ((code_pointer) ucp->uc_mcontext.gpregs[CTX_EPC]);