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) 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/export
$(TINYGO) build -size short -o wasm.wasm -target=wasm examples/wasm/main $(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 endif
# test various compiler flags # test various compiler flags
$(TINYGO) build -size short -o test.hex -target=pca10040 -gc=none -scheduler=none examples/blinky1 $(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. // These need to be initialized early so that the heap can be initialized.
heapStart = uintptr(unsafe.Pointer(&heapStartSymbol)) heapStart = uintptr(unsafe.Pointer(&heapStartSymbol))
heapEnd = uintptr(wasm_memory_size(0) * wasmPageSize) heapEnd = uintptr(wasm_memory_size(0) * wasmPageSize)
run() initAll()
} }
func init() { func init() {

4
targets/wasm-unknown.json

@ -1,13 +1,14 @@
{ {
"llvm-target": "wasm32-unknown-unknown", "llvm-target": "wasm32-unknown-unknown",
"cpu": "generic", "cpu": "generic",
"features": "+mutable-globals,+nontrapping-fptoint,+sign-ext", "features": "+mutable-globals,+nontrapping-fptoint,+sign-ext,-bulk-memory",
"build-tags": ["tinygo.wasm", "wasm_unknown"], "build-tags": ["tinygo.wasm", "wasm_unknown"],
"goos": "linux", "goos": "linux",
"goarch": "arm", "goarch": "arm",
"linker": "wasm-ld", "linker": "wasm-ld",
"rtlib": "compiler-rt", "rtlib": "compiler-rt",
"scheduler": "none", "scheduler": "none",
"gc": "leaking",
"default-stack-size": 4096, "default-stack-size": 4096,
"cflags": [ "cflags": [
"-mno-bulk-memory", "-mno-bulk-memory",
@ -15,6 +16,7 @@
"-msign-ext" "-msign-ext"
], ],
"ldflags": [ "ldflags": [
"--stack-first",
"--no-demangle", "--no-demangle",
"--no-entry", "--no-entry",
"--import-memory" "--import-memory"

Loading…
Cancel
Save