From 691118ec5704cba0231e7de3440c557cca05bec5 Mon Sep 17 00:00:00 2001 From: Richard Musiol Date: Sun, 15 Sep 2019 11:16:07 +0200 Subject: [PATCH] add wasi/wasm Change-Id: I450230235179105aee7160ab7638387342aa6cdb --- src/cmd/dist/build.go | 2 ++ src/cmd/internal/objabi/head.go | 5 +++++ src/go/build/syslist.go | 2 +- src/runtime/internal/sys/zgoos_aix.go | 1 + src/runtime/internal/sys/zgoos_android.go | 1 + src/runtime/internal/sys/zgoos_darwin.go | 1 + src/runtime/internal/sys/zgoos_dragonfly.go | 1 + src/runtime/internal/sys/zgoos_freebsd.go | 1 + src/runtime/internal/sys/zgoos_hurd.go | 1 + src/runtime/internal/sys/zgoos_illumos.go | 1 + src/runtime/internal/sys/zgoos_js.go | 1 + src/runtime/internal/sys/zgoos_linux.go | 1 + src/runtime/internal/sys/zgoos_netbsd.go | 1 + src/runtime/internal/sys/zgoos_openbsd.go | 1 + src/runtime/internal/sys/zgoos_plan9.go | 1 + src/runtime/internal/sys/zgoos_solaris.go | 1 + src/runtime/internal/sys/zgoos_wasi.go | 25 +++++++++++++++++++++ src/runtime/internal/sys/zgoos_windows.go | 1 + src/runtime/internal/sys/zgoos_zos.go | 1 + 19 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/runtime/internal/sys/zgoos_wasi.go diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index 62e00b0856fa6..cd70876db0ed3 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -81,6 +81,7 @@ var okgoos = []string{ "dragonfly", "illumos", "js", + "wasi", "linux", "android", "solaris", @@ -1543,6 +1544,7 @@ var cgoEnabled = map[string]bool{ "android/arm": true, "android/arm64": true, "js/wasm": false, + "wasi/wasm": false, "netbsd/386": true, "netbsd/amd64": true, "netbsd/arm": true, diff --git a/src/cmd/internal/objabi/head.go b/src/cmd/internal/objabi/head.go index 6836c338c93c3..2ab18749a9e14 100644 --- a/src/cmd/internal/objabi/head.go +++ b/src/cmd/internal/objabi/head.go @@ -46,6 +46,7 @@ const ( Hopenbsd Hplan9 Hsolaris + Hwasi Hwindows Haix ) @@ -72,6 +73,8 @@ func (h *HeadType) Set(s string) error { *h = Hplan9 case "illumos", "solaris": *h = Hsolaris + case "wasi": + *h = Hwasi case "windows": *h = Hwindows default: @@ -102,6 +105,8 @@ func (h *HeadType) String() string { return "plan9" case Hsolaris: return "solaris" + case Hwasi: + return "wasi" case Hwindows: return "windows" } diff --git a/src/go/build/syslist.go b/src/go/build/syslist.go index fbfe4c46779ae..56d62dd10a3e3 100644 --- a/src/go/build/syslist.go +++ b/src/go/build/syslist.go @@ -7,5 +7,5 @@ package build // List of past, present, and future known GOOS and GOARCH values. // Do not remove from this list, as these are used for go/build filename matching. -const goosList = "aix android darwin dragonfly freebsd hurd illumos js linux nacl netbsd openbsd plan9 solaris windows zos " +const goosList = "aix android darwin dragonfly freebsd hurd illumos js linux nacl netbsd openbsd plan9 solaris wasi windows zos " const goarchList = "386 amd64 amd64p32 arm armbe arm64 arm64be ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc riscv riscv64 s390 s390x sparc sparc64 wasm " diff --git a/src/runtime/internal/sys/zgoos_aix.go b/src/runtime/internal/sys/zgoos_aix.go index d97485c43cb4f..ab13006d16098 100644 --- a/src/runtime/internal/sys/zgoos_aix.go +++ b/src/runtime/internal/sys/zgoos_aix.go @@ -20,5 +20,6 @@ const GoosNetbsd = 0 const GoosOpenbsd = 0 const GoosPlan9 = 0 const GoosSolaris = 0 +const GoosWasi = 0 const GoosWindows = 0 const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_android.go b/src/runtime/internal/sys/zgoos_android.go index eec970b0647f6..f11b316a378d4 100644 --- a/src/runtime/internal/sys/zgoos_android.go +++ b/src/runtime/internal/sys/zgoos_android.go @@ -20,5 +20,6 @@ const GoosNetbsd = 0 const GoosOpenbsd = 0 const GoosPlan9 = 0 const GoosSolaris = 0 +const GoosWasi = 0 const GoosWindows = 0 const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_darwin.go b/src/runtime/internal/sys/zgoos_darwin.go index c40819ee559d5..6f366b589a0a4 100644 --- a/src/runtime/internal/sys/zgoos_darwin.go +++ b/src/runtime/internal/sys/zgoos_darwin.go @@ -20,5 +20,6 @@ const GoosNetbsd = 0 const GoosOpenbsd = 0 const GoosPlan9 = 0 const GoosSolaris = 0 +const GoosWasi = 0 const GoosWindows = 0 const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_dragonfly.go b/src/runtime/internal/sys/zgoos_dragonfly.go index 3dc4edcc31b77..b0822a2e91b28 100644 --- a/src/runtime/internal/sys/zgoos_dragonfly.go +++ b/src/runtime/internal/sys/zgoos_dragonfly.go @@ -20,5 +20,6 @@ const GoosNetbsd = 0 const GoosOpenbsd = 0 const GoosPlan9 = 0 const GoosSolaris = 0 +const GoosWasi = 0 const GoosWindows = 0 const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_freebsd.go b/src/runtime/internal/sys/zgoos_freebsd.go index 6c98b342f9ceb..5cb5f247fb3e4 100644 --- a/src/runtime/internal/sys/zgoos_freebsd.go +++ b/src/runtime/internal/sys/zgoos_freebsd.go @@ -20,5 +20,6 @@ const GoosNetbsd = 0 const GoosOpenbsd = 0 const GoosPlan9 = 0 const GoosSolaris = 0 +const GoosWasi = 0 const GoosWindows = 0 const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_hurd.go b/src/runtime/internal/sys/zgoos_hurd.go index d6dcc7bad456b..90e1fb91a2e41 100644 --- a/src/runtime/internal/sys/zgoos_hurd.go +++ b/src/runtime/internal/sys/zgoos_hurd.go @@ -20,5 +20,6 @@ const GoosNetbsd = 0 const GoosOpenbsd = 0 const GoosPlan9 = 0 const GoosSolaris = 0 +const GoosWasi = 0 const GoosWindows = 0 const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_illumos.go b/src/runtime/internal/sys/zgoos_illumos.go index 17f4ecc34edc3..19a7a5cbe55bb 100644 --- a/src/runtime/internal/sys/zgoos_illumos.go +++ b/src/runtime/internal/sys/zgoos_illumos.go @@ -20,5 +20,6 @@ const GoosNetbsd = 0 const GoosOpenbsd = 0 const GoosPlan9 = 0 const GoosSolaris = 0 +const GoosWasi = 0 const GoosWindows = 0 const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_js.go b/src/runtime/internal/sys/zgoos_js.go index 74c9943d9bf25..de949751f75fb 100644 --- a/src/runtime/internal/sys/zgoos_js.go +++ b/src/runtime/internal/sys/zgoos_js.go @@ -20,5 +20,6 @@ const GoosNetbsd = 0 const GoosOpenbsd = 0 const GoosPlan9 = 0 const GoosSolaris = 0 +const GoosWasi = 0 const GoosWindows = 0 const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_linux.go b/src/runtime/internal/sys/zgoos_linux.go index 1d5fcb06856a4..6d1cf783b9dd7 100644 --- a/src/runtime/internal/sys/zgoos_linux.go +++ b/src/runtime/internal/sys/zgoos_linux.go @@ -21,5 +21,6 @@ const GoosNetbsd = 0 const GoosOpenbsd = 0 const GoosPlan9 = 0 const GoosSolaris = 0 +const GoosWasi = 0 const GoosWindows = 0 const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_netbsd.go b/src/runtime/internal/sys/zgoos_netbsd.go index 194fa6e4326ef..7262e4211c6c0 100644 --- a/src/runtime/internal/sys/zgoos_netbsd.go +++ b/src/runtime/internal/sys/zgoos_netbsd.go @@ -20,5 +20,6 @@ const GoosNetbsd = 1 const GoosOpenbsd = 0 const GoosPlan9 = 0 const GoosSolaris = 0 +const GoosWasi = 0 const GoosWindows = 0 const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_openbsd.go b/src/runtime/internal/sys/zgoos_openbsd.go index 210869167999d..de23d517100a3 100644 --- a/src/runtime/internal/sys/zgoos_openbsd.go +++ b/src/runtime/internal/sys/zgoos_openbsd.go @@ -20,5 +20,6 @@ const GoosNetbsd = 0 const GoosOpenbsd = 1 const GoosPlan9 = 0 const GoosSolaris = 0 +const GoosWasi = 0 const GoosWindows = 0 const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_plan9.go b/src/runtime/internal/sys/zgoos_plan9.go index e632a90b2e01b..357d19739fee1 100644 --- a/src/runtime/internal/sys/zgoos_plan9.go +++ b/src/runtime/internal/sys/zgoos_plan9.go @@ -20,5 +20,6 @@ const GoosNetbsd = 0 const GoosOpenbsd = 0 const GoosPlan9 = 1 const GoosSolaris = 0 +const GoosWasi = 0 const GoosWindows = 0 const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_solaris.go b/src/runtime/internal/sys/zgoos_solaris.go index 67b2ffbfcd950..9e3563a41b784 100644 --- a/src/runtime/internal/sys/zgoos_solaris.go +++ b/src/runtime/internal/sys/zgoos_solaris.go @@ -21,5 +21,6 @@ const GoosNetbsd = 0 const GoosOpenbsd = 0 const GoosPlan9 = 0 const GoosSolaris = 1 +const GoosWasi = 0 const GoosWindows = 0 const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_wasi.go b/src/runtime/internal/sys/zgoos_wasi.go new file mode 100644 index 0000000000000..d12e133cf238d --- /dev/null +++ b/src/runtime/internal/sys/zgoos_wasi.go @@ -0,0 +1,25 @@ +// Code generated by gengoos.go using 'go generate'. DO NOT EDIT. + +// +build wasi + +package sys + +const GOOS = `wasi` + +const GoosAix = 0 +const GoosAndroid = 0 +const GoosDarwin = 0 +const GoosDragonfly = 0 +const GoosFreebsd = 0 +const GoosHurd = 0 +const GoosIllumos = 0 +const GoosJs = 0 +const GoosLinux = 0 +const GoosNacl = 0 +const GoosNetbsd = 0 +const GoosOpenbsd = 0 +const GoosPlan9 = 0 +const GoosSolaris = 0 +const GoosWasi = 1 +const GoosWindows = 0 +const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_windows.go b/src/runtime/internal/sys/zgoos_windows.go index cf2d6f4fb08f1..683c76f1c2111 100644 --- a/src/runtime/internal/sys/zgoos_windows.go +++ b/src/runtime/internal/sys/zgoos_windows.go @@ -20,5 +20,6 @@ const GoosNetbsd = 0 const GoosOpenbsd = 0 const GoosPlan9 = 0 const GoosSolaris = 0 +const GoosWasi = 0 const GoosWindows = 1 const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_zos.go b/src/runtime/internal/sys/zgoos_zos.go index e5d79accb4c51..59065a896e85c 100644 --- a/src/runtime/internal/sys/zgoos_zos.go +++ b/src/runtime/internal/sys/zgoos_zos.go @@ -20,5 +20,6 @@ const GoosNetbsd = 0 const GoosOpenbsd = 0 const GoosPlan9 = 0 const GoosSolaris = 0 +const GoosWasi = 0 const GoosWindows = 0 const GoosZos = 1