From a18326f4021652cd31d5b092b1f6cf02d49f5116 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 8 Jan 2022 23:57:00 +0000 Subject: [PATCH] [TS] Configure memory setup in linker to not insta-OOM --- genbindings.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genbindings.sh b/genbindings.sh index bb14f62f..25c8ffbe 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -199,7 +199,7 @@ else cat ts/bindings.c.body >> ts/bindings.c echo "Building TS bindings..." - COMPILE="$COMMON_COMPILE -flto -Wl,--no-entry -nostdlib --target=wasm32-wasi" + COMPILE="$COMMON_COMPILE -flto -Wl,--no-entry -nostdlib --target=wasm32-wasi -Wl,-z -Wl,stack-size=$((8*1024*1024)) -Wl,--initial-memory=$((16*1024*1024)) -Wl,--max-memory=$((1024*1024*1024)) -Wl,--global-base=4096" # We only need malloc and assert/abort, but for now just use WASI for those: #EXTRA_LINK=/usr/lib/wasm32-wasi/libc.a EXTRA_LINK= -- 2.30.2