summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorCheng Shao <astrohavoc@gmail.com>2022-10-21 13:43:40 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-11-11 00:26:55 -0500
commitdf7bfef8f72bb32663d3828bf096587525f09335 (patch)
tree93eb162e317d936659d33af1bcc0db3131a5eb56 /m4
parent3633a5f5b001c3519b78c956cff4657f5ddde445 (diff)
downloadhaskell-df7bfef8f72bb32663d3828bf096587525f09335.tar.gz
Add support for the wasm32-wasi target tuple
This patch adds the wasm32-wasi tuple support to various places in the tree: autoconf, hadrian, ghc-boot and also the compiler. The codegen logic will come in subsequent commits.
Diffstat (limited to 'm4')
-rw-r--r--m4/fptools_set_haskell_platform_vars.m46
-rw-r--r--m4/ghc_convert_cpu.m43
-rw-r--r--m4/ghc_convert_os.m43
-rw-r--r--m4/ghc_tables_next_to_code.m42
-rw-r--r--m4/ghc_unregisterised.m42
5 files changed, 14 insertions, 2 deletions
diff --git a/m4/fptools_set_haskell_platform_vars.m4 b/m4/fptools_set_haskell_platform_vars.m4
index 62563633f5..23b7fb63f9 100644
--- a/m4/fptools_set_haskell_platform_vars.m4
+++ b/m4/fptools_set_haskell_platform_vars.m4
@@ -42,6 +42,9 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS_SHELL_FUNCTIONS],
riscv64)
test -z "[$]2" || eval "[$]2=ArchRISCV64"
;;
+ wasm32)
+ test -z "[$]2" || eval "[$]2=ArchWasm32"
+ ;;
hppa|hppa1_1|ia64|m68k|nios2|riscv32|rs6000|s390|sh4|vax)
test -z "[$]2" || eval "[$]2=ArchUnknown"
;;
@@ -97,6 +100,9 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS_SHELL_FUNCTIONS],
nto-qnx)
test -z "[$]2" || eval "[$]2=OSQNXNTO"
;;
+ wasi)
+ test -z "[$]2" || eval "[$]2=OSWasi"
+ ;;
dragonfly|hpux|linuxaout|freebsd2|nextstep2|nextstep3|sunos4|ultrix)
test -z "[$]2" || eval "[$]2=OSUnknown"
;;
diff --git a/m4/ghc_convert_cpu.m4 b/m4/ghc_convert_cpu.m4
index e775c04a8f..f70114142f 100644
--- a/m4/ghc_convert_cpu.m4
+++ b/m4/ghc_convert_cpu.m4
@@ -74,6 +74,9 @@ case "$1" in
x86_64|amd64)
$2="x86_64"
;;
+ wasm32)
+ $2="wasm32"
+ ;;
*)
echo "Unknown CPU $1"
exit 1
diff --git a/m4/ghc_convert_os.m4 b/m4/ghc_convert_os.m4
index dbced12850..b104549b77 100644
--- a/m4/ghc_convert_os.m4
+++ b/m4/ghc_convert_os.m4
@@ -46,6 +46,9 @@ AC_DEFUN([GHC_CONVERT_OS],[
nto-qnx*)
$3="nto-qnx"
;;
+ wasi)
+ $3="wasi"
+ ;;
*)
echo "Unknown OS $1"
exit 1
diff --git a/m4/ghc_tables_next_to_code.m4 b/m4/ghc_tables_next_to_code.m4
index 0f262bba57..3e0ced2137 100644
--- a/m4/ghc_tables_next_to_code.m4
+++ b/m4/ghc_tables_next_to_code.m4
@@ -17,7 +17,7 @@ AC_DEFUN([GHC_TABLES_NEXT_TO_CODE],
case "$Unregisterised" in
NO)
case "$TargetArch" in
- ia64|powerpc64|powerpc64le|s390x)
+ ia64|powerpc64|powerpc64le|s390x|wasm32)
TablesNextToCodeDefault=NO
AC_MSG_RESULT([no])
;;
diff --git a/m4/ghc_unregisterised.m4 b/m4/ghc_unregisterised.m4
index ca3beb8733..b06cb41c90 100644
--- a/m4/ghc_unregisterised.m4
+++ b/m4/ghc_unregisterised.m4
@@ -5,7 +5,7 @@ AC_DEFUN([GHC_UNREGISTERISED],
[
AC_MSG_CHECKING(whether target supports a registerised ABI)
case "$TargetArch" in
- i386|x86_64|powerpc|powerpc64|powerpc64le|s390x|arm|aarch64|riscv64)
+ i386|x86_64|powerpc|powerpc64|powerpc64le|s390x|arm|aarch64|riscv64|wasm32)
UnregisterisedDefault=NO
AC_MSG_RESULT([yes])
;;