ldc2 -Isrc -mtriple=wasm32-unknown-unknown-wasm -betterC src/main.d \
--of main.d.wasm \
-L--import-memory -L-zstack-size=8096 -L--initial-memory=65536 \
-L--max-memory=65536 -L--global-base=6560 -L--lto-O3 -L--gc-sections \
-L--strip-all -L--no-entry -L--allow-undefined
Nim (see also this repo):
TODO
Odin (see also this gist):
odin build src \
-target:freestanding_wasm32 -no-entry-point -extra-linker-flags:"\
--import-memory -zstack-size=8096 --initial-memory=65536 \
--max-memory=65536 --global-base=6560 --lto-O3 --gc-sections \
--strip-all \
"
Zig 0.9.0
zig build-lib src/main.zig -I src -target wasm32-freestanding -O ReleaseSmall \
-dynamic --global-base=6560 --import-memory --initial-memory=65536 \
--max-memory=65536 --stack 8192
Zig 0.8.0
zig build-obj src/main.zig -I src -target wasm32-freestanding -O ReleaseSmall
wasm-ld --no-entry --export-all --allow-undefined -zstack-size=8192 \
--global-base=6560 --max-memory=65536 --initial-memory=65536 \
--import-memory -o main.wasm main.o