From df7bfef8f72bb32663d3828bf096587525f09335 Mon Sep 17 00:00:00 2001 From: Cheng Shao Date: Fri, 21 Oct 2022 13:43:40 +0000 Subject: 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. --- m4/fptools_set_haskell_platform_vars.m4 | 6 ++++++ m4/ghc_convert_cpu.m4 | 3 +++ m4/ghc_convert_os.m4 | 3 +++ m4/ghc_tables_next_to_code.m4 | 2 +- m4/ghc_unregisterised.m4 | 2 +- 5 files changed, 14 insertions(+), 2 deletions(-) (limited to 'm4') 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]) ;; -- cgit v1.2.1