tinygo/targets/wasm.json
Ayke van Laethem 00cc486619 wasm: set the stack at the start of linear memory
This makes sure that a stack overflow will cause a "memory access out of
bounds" error instead of a corruption of a global variable.

Here is more background on a very similar stack overflow protection:
https://blog.japaric.io/stack-overflow-protection/
2019-07-08 00:09:59 +02:00

21 строка
429 Б
JSON

{
"llvm-target": "wasm32-unknown-unknown-wasm",
"build-tags": ["js", "wasm"],
"goos": "js",
"goarch": "wasm",
"compiler": "clang",
"linker": "wasm-ld",
"cflags": [
"--target=wasm32",
"-nostdlibinc",
"-Wno-macro-redefined",
"-Oz"
],
"ldflags": [
"--allow-undefined",
"--no-threads",
"--stack-first",
"--export-all"
],
"emulator": ["node", "targets/wasm_exec.js"]
}