From c98770ee2ac98808fc058b1a419472de2279ba86 Mon Sep 17 00:00:00 2001 From: matm Date: Wed, 11 Dec 2024 16:17:34 +0100 Subject: [PATCH] fix: working tinygo target.json Works with Go 1.23.3 and tinygo 0.34.0 (linux/amd64) --- cli/assets/templates/go/target.json | 49 ++++++++++++++++------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/cli/assets/templates/go/target.json b/cli/assets/templates/go/target.json index 4e04addd..24509e0d 100644 --- a/cli/assets/templates/go/target.json +++ b/cli/assets/templates/go/target.json @@ -1,24 +1,29 @@ { - "llvm-target": "wasm32--wasi", - "build-tags": [ "tinygo.wasm" ], - "goos": "js", - "goarch": "wasm", - "linker": "wasm-ld", - "libc": "wasi-libc", - "cflags": [ - "--target=wasm32--wasi", - "--sysroot={root}/lib/wasi-libc/sysroot", - "-Oz" - ], - "ldflags": [ - "--allow-undefined", - "--no-demangle", - "--import-memory", - "--initial-memory=65536", - "--max-memory=65536", - "--stack-first", - "-zstack-size=14752", - "--strip-all" - ], - "wasm-abi": "js" + "llvm-target": "wasm32-unknown-unknown", + "cpu": "generic", + "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", + "cflags": [ + "-mno-bulk-memory", + "-mnontrapping-fptoint", + "-msign-ext" + ], + "ldflags": [ + "--allow-undefined", + "--no-demangle", + "--import-memory", + "--initial-memory=65536", + "--max-memory=65536", + "--stack-first", + "--no-entry", + "-zstack-size=14752" + ] }