Skip to content

Commit 50ecbe1

Browse files
mvogelsangangerman
authored andcommitted
add support for Webassembly OS/arch
WebGHC uses the target 'triple' wasm32-unknown-unknown-wasm. While aclocal.m4 already does have some provisions for wasm32, it and config.sub need changes for successful build configuration when cross-compiling GHC to target WebAssembly. We would expect similar changes to eventually be made in upstream GNU aclocal.m4 and config.sub.
1 parent 31cd867 commit 50ecbe1

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

aclocal.m4

+8-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
217217
mipsel)
218218
test -z "[$]2" || eval "[$]2=ArchMipsel"
219219
;;
220-
hppa|hppa1_1|ia64|m68k|nios2|rs6000|s390|s390x|sh4|vax)
220+
hppa|hppa1_1|ia64|m68k|nios2|rs6000|s390|s390x|sh4|vax|wasm32)
221221
test -z "[$]2" || eval "[$]2=ArchUnknown"
222222
;;
223223
*)
@@ -272,7 +272,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
272272
nto-qnx)
273273
test -z "[$]2" || eval "[$]2=OSQNXNTO"
274274
;;
275-
dragonfly|hpux|linuxaout|freebsd2|nextstep2|nextstep3|sunos4|ultrix)
275+
dragonfly|hpux|linuxaout|freebsd2|nextstep2|nextstep3|sunos4|ultrix|unknown-wasm)
276276
test -z "[$]2" || eval "[$]2=OSUnknown"
277277
;;
278278
aix)
@@ -1902,6 +1902,9 @@ case "$1" in
19021902
x86_64|amd64)
19031903
$2="x86_64"
19041904
;;
1905+
wasm32)
1906+
$2="wasm32"
1907+
;;
19051908
*)
19061909
echo "Unknown CPU $1"
19071910
exit 1
@@ -2009,6 +2012,9 @@ AC_DEFUN([GHC_CONVERT_OS],[
20092012
nto-qnx*)
20102013
$3="nto-qnx"
20112014
;;
2015+
unknown-wasm)
2016+
$3="unknown-wasm"
2017+
;;
20122018
*)
20132019
echo "Unknown OS $1"
20142020
exit 1

config.sub

+3-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ case $maybe_os in
118118
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
119119
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
120120
kopensolaris*-gnu* | cloudabi*-eabi* | \
121-
storm-chaos* | os2-emx* | rtmk-nova*)
121+
storm-chaos* | os2-emx* | rtmk-nova* | unknown-wasm)
122122
os=-$maybe_os
123123
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
124124
;;
@@ -1551,6 +1551,8 @@ case $os in
15511551
;;
15521552
-ios)
15531553
;;
1554+
-unknown-wasm)
1555+
;;
15541556
-none)
15551557
;;
15561558
*)

0 commit comments

Comments
 (0)