[MLton] MLton on arm64 (AArch64)

Edmund Grimley Evans <[email protected]> Wed, 8 Jul 2015 19:01:16 +0100
Newsgroups gmane.comp.lang.ml.mlton.devel
Message-ID <[email protected]>
I found I needed the following patch to build it on arm64 Debian
unstable. Here's a log message, in case someone wants to commit it:

Add further support for arm64 (aarch64).

diff --git a/lib/stubs/mlton-stubs/mlton.sml b/lib/stubs/mlton-stubs/mlton.sml
index f494ff2..602806a 100644
--- a/lib/stubs/mlton-stubs/mlton.sml
+++ b/lib/stubs/mlton-stubs/mlton.sml
@@ -158,12 +158,13 @@ structure MLton: MLTON =
 
             structure Arch =
                struct
-                  datatype t = Alpha | AMD64 | ARM | HPPA | IA64 | m68k |
+                  datatype t = Alpha | AMD64 | ARM | ARM64 | HPPA | IA64 | m68k |
                                MIPS | PowerPC | PowerPC64 | S390 | Sparc | X86
 
                   val all = [(Alpha, "Alpha"),
                              (AMD64, "AMD64"),
                              (ARM, "ARM"),
+                             (ARM64, "ARM64"),
                              (HPPA, "HPPA"),
                              (IA64, "IA64"),
                              (m68k, "m68k"),
diff --git a/lib/stubs/mlton-stubs/platform.sig b/lib/stubs/mlton-stubs/platform.sig
index 507a8dd..f962656 100644
--- a/lib/stubs/mlton-stubs/platform.sig
+++ b/lib/stubs/mlton-stubs/platform.sig
@@ -9,7 +9,7 @@ signature MLTON_PLATFORM =
    sig
       structure Arch:
          sig
-            datatype t = Alpha | AMD64 | ARM | HPPA | IA64 | m68k |
+            datatype t = Alpha | AMD64 | ARM | ARM64 | HPPA | IA64 | m68k |
                          MIPS | PowerPC | PowerPC64 | S390 | Sparc | X86
 
             val fromString: string -> t option
diff --git a/mlton/main/main.fun b/mlton/main/main.fun
index 78dce8d..6b897ad 100644
--- a/mlton/main/main.fun
+++ b/mlton/main/main.fun
@@ -193,6 +193,7 @@ fun defaultAlignIs8 () =
          Alpha => true
        | AMD64 => true
        | ARM => true
+       | ARM64 => true
        | HPPA => true
        | IA64 => true
        | MIPS => true
diff --git a/runtime/platform/arm64.h b/runtime/platform/arm64.h
new file mode 100644
index 0000000..d056da7
--- /dev/null
+++ b/runtime/platform/arm64.h
@@ -0,0 +1 @@
+#define MLton_Platform_Arch_host "arm64"

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/