Provide minimal C/C++ std library to wasm external scanners

This commit is contained in:
Max Brunsfeld 2022-09-08 13:36:58 -07:00
parent 7dc81303f6
commit 98ccfcffb0
5 changed files with 2344 additions and 75 deletions

17
script/build-wasm-stdlib Executable file
View file

@ -0,0 +1,17 @@
#!/bin/bash
set -e
emcc \
-o stdlib.wasm \
-Os \
--no-entry \
-s MAIN_MODULE=2 \
-s 'EXPORTED_FUNCTIONS=@lib/src/wasm/stdlib-symbols.json' \
-fvisibility=hidden \
-fno-exceptions \
-xc \
/dev/null
xxd -C -i stdlib.wasm > lib/src/wasm/wasm-stdlib.h
mv stdlib.wasm target/