Browse Source

targets/wasm_unknown: use proper defaults for GC

Signed-off-by: deadprogram <ron@hybridgroup.com>
pull/4105/head
deadprogram 9 months ago
committed by Ron Evans
parent
commit
ad30085b93
  1. 2
      GNUmakefile
  2. 2
      src/runtime/runtime_wasm_unknown.go
  3. 4
      targets/wasm-unknown.json

2
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

2
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() {

4
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"

Loading…
Cancel
Save