From c3032660c9e2e1fd5a188c6ac54902637a77b975 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 21 Jun 2021 14:50:24 +0200 Subject: [PATCH] wasi: remove wasm build tag The wasm build tag together with GOARCH=arm was causing problems in the internal/cpu package. In general, I think having two architecture build tag will only cause problems (in this case, wasm and arm) so I've removed the wasm build tag and replaced it with tinygo.wasm. This is similar to the tinygo.riscv build tag, which is used for older Go versions that don't yet have RISC-V support in the standard library (and therefore pretend to be GOARCH=arm instead). --- compileopts/config.go | 2 +- src/runtime/arch_arm.go | 2 +- src/runtime/{arch_wasm.go => arch_tinygowasm.go} | 2 +- src/runtime/gc_globals_conservative.go | 2 +- src/runtime/gc_globals_precise.go | 2 +- src/runtime/gc_stack_portable.go | 2 +- src/runtime/gc_stack_raw.go | 2 +- src/runtime/{runtime_wasm.go => runtime_tinygowasm.go} | 2 +- src/runtime/runtime_wasm_wasi.go | 2 +- targets/wasi.json | 2 +- targets/wasm.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) rename src/runtime/{arch_wasm.go => arch_tinygowasm.go} (98%) rename src/runtime/{runtime_wasm.go => runtime_tinygowasm.go} (98%) diff --git a/compileopts/config.go b/compileopts/config.go index 0bb839ff..821aa831 100644 --- a/compileopts/config.go +++ b/compileopts/config.go @@ -89,7 +89,7 @@ func (c *Config) NeedsStackObjects() bool { switch c.GC() { case "conservative", "extalloc": for _, tag := range c.BuildTags() { - if tag == "wasm" { + if tag == "tinygo.wasm" { return true } } diff --git a/src/runtime/arch_arm.go b/src/runtime/arch_arm.go index e2dc4b5b..19caa619 100644 --- a/src/runtime/arch_arm.go +++ b/src/runtime/arch_arm.go @@ -1,4 +1,4 @@ -// +build arm,!baremetal,!wasm arm,arm7tdmi +// +build arm,!baremetal,!tinygo.wasm arm,arm7tdmi package runtime diff --git a/src/runtime/arch_wasm.go b/src/runtime/arch_tinygowasm.go similarity index 98% rename from src/runtime/arch_wasm.go rename to src/runtime/arch_tinygowasm.go index 00dd0deb..0ee3afd3 100644 --- a/src/runtime/arch_wasm.go +++ b/src/runtime/arch_tinygowasm.go @@ -1,4 +1,4 @@ -// +build wasm +// +build tinygo.wasm package runtime diff --git a/src/runtime/gc_globals_conservative.go b/src/runtime/gc_globals_conservative.go index bee55a88..56476551 100644 --- a/src/runtime/gc_globals_conservative.go +++ b/src/runtime/gc_globals_conservative.go @@ -1,5 +1,5 @@ // +build gc.conservative gc.extalloc -// +build baremetal wasm +// +build baremetal tinygo.wasm package runtime diff --git a/src/runtime/gc_globals_precise.go b/src/runtime/gc_globals_precise.go index 2d6c8c14..f79b71fd 100644 --- a/src/runtime/gc_globals_precise.go +++ b/src/runtime/gc_globals_precise.go @@ -1,5 +1,5 @@ // +build gc.conservative gc.extalloc -// +build !baremetal,!wasm +// +build !baremetal,!tinygo.wasm package runtime diff --git a/src/runtime/gc_stack_portable.go b/src/runtime/gc_stack_portable.go index d48b2497..d4a04637 100644 --- a/src/runtime/gc_stack_portable.go +++ b/src/runtime/gc_stack_portable.go @@ -1,5 +1,5 @@ // +build gc.conservative gc.extalloc -// +build wasm +// +build tinygo.wasm package runtime diff --git a/src/runtime/gc_stack_raw.go b/src/runtime/gc_stack_raw.go index 74be7fe8..01b07d9b 100644 --- a/src/runtime/gc_stack_raw.go +++ b/src/runtime/gc_stack_raw.go @@ -1,5 +1,5 @@ // +build gc.conservative gc.extalloc -// +build !wasm +// +build !tinygo.wasm package runtime diff --git a/src/runtime/runtime_wasm.go b/src/runtime/runtime_tinygowasm.go similarity index 98% rename from src/runtime/runtime_wasm.go rename to src/runtime/runtime_tinygowasm.go index 1146f578..989fbb80 100644 --- a/src/runtime/runtime_wasm.go +++ b/src/runtime/runtime_tinygowasm.go @@ -1,4 +1,4 @@ -// +build wasm +// +build tinygo.wasm package runtime diff --git a/src/runtime/runtime_wasm_wasi.go b/src/runtime/runtime_wasm_wasi.go index 76d0a452..4f0432f7 100644 --- a/src/runtime/runtime_wasm_wasi.go +++ b/src/runtime/runtime_wasm_wasi.go @@ -1,4 +1,4 @@ -// +build wasm,wasi +// +build tinygo.wasm,wasi package runtime diff --git a/targets/wasi.json b/targets/wasi.json index c24ed8f1..b80b77d1 100644 --- a/targets/wasi.json +++ b/targets/wasi.json @@ -1,6 +1,6 @@ { "llvm-target": "wasm32--wasi", - "build-tags": ["wasm", "wasi"], + "build-tags": ["tinygo.wasm", "wasi"], "goos": "linux", "goarch": "arm", "linker": "wasm-ld", diff --git a/targets/wasm.json b/targets/wasm.json index 6208eb27..eb03eb8c 100644 --- a/targets/wasm.json +++ b/targets/wasm.json @@ -1,6 +1,6 @@ { "llvm-target": "wasm32--wasi", - "build-tags": ["js", "wasm"], + "build-tags": ["tinygo.wasm"], "goos": "js", "goarch": "wasm", "linker": "wasm-ld",