aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authordeadprogram <[email protected]>2024-02-15 18:46:24 +0100
committerRon Evans <[email protected]>2024-02-17 10:18:00 +0100
commitad30085b93542490a4b24bf3b934aafcf1208243 (patch)
tree5081df2991c5726086597f31a79e7f4625a0e623
parente9ca41735ad16111fd756235c1516ef988746cea (diff)
downloadtinygo-ad30085b93542490a4b24bf3b934aafcf1208243.tar.gz
tinygo-ad30085b93542490a4b24bf3b934aafcf1208243.zip
targets/wasm_unknown: use proper defaults for GC
Signed-off-by: deadprogram <[email protected]>
-rw-r--r--GNUmakefile2
-rw-r--r--src/runtime/runtime_wasm_unknown.go2
-rw-r--r--targets/wasm-unknown.json4
3 files changed, 5 insertions, 3 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 9df6c41aa..e2a34a558 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -773,7 +773,7 @@ endif
ifneq ($(WASM), 0)
$(TINYGO) build -size short -o wasm.wasm -target=wasm examples/wasm/export
$(TINYGO) build -size short -o wasm.wasm -target=wasm examples/wasm/main
- $(TINYGO) build -size short -o wasm.wasm -target=wasm-unknown -gc=leaking -no-debug examples/hello-wasm-unknown
+ $(TINYGO) build -size short -o wasm.wasm -target=wasm-unknown examples/hello-wasm-unknown
endif
# test various compiler flags
$(TINYGO) build -size short -o test.hex -target=pca10040 -gc=none -scheduler=none examples/blinky1
diff --git a/src/runtime/runtime_wasm_unknown.go b/src/runtime/runtime_wasm_unknown.go
index 5ba832116..2d1ef9cca 100644
--- a/src/runtime/runtime_wasm_unknown.go
+++ b/src/runtime/runtime_wasm_unknown.go
@@ -16,7 +16,7 @@ func _start() {
// These need to be initialized early so that the heap can be initialized.
heapStart = uintptr(unsafe.Pointer(&heapStartSymbol))
heapEnd = uintptr(wasm_memory_size(0) * wasmPageSize)
- run()
+ initAll()
}
func init() {
diff --git a/targets/wasm-unknown.json b/targets/wasm-unknown.json
index aefc6047e..903afa49e 100644
--- a/targets/wasm-unknown.json
+++ b/targets/wasm-unknown.json
@@ -1,13 +1,14 @@
{
"llvm-target": "wasm32-unknown-unknown",
"cpu": "generic",
- "features": "+mutable-globals,+nontrapping-fptoint,+sign-ext",
+ "features": "+mutable-globals,+nontrapping-fptoint,+sign-ext,-bulk-memory",
"build-tags": ["tinygo.wasm", "wasm_unknown"],
"goos": "linux",
"goarch": "arm",
"linker": "wasm-ld",
"rtlib": "compiler-rt",
"scheduler": "none",
+ "gc": "leaking",
"default-stack-size": 4096,
"cflags": [
"-mno-bulk-memory",
@@ -15,6 +16,7 @@
"-msign-ext"
],
"ldflags": [
+ "--stack-first",
"--no-demangle",
"--no-entry",
"--import-memory"