Update wasm app build scripts for wasi-sdk-12 and refine interpreter (#481)

Update wasm app build scripts for wasi-sdk-12.0: add --export=__main_argc_argv, remove --no-threads
Lookup function with name "__main_argc_argv" as main function besides "main"
Change module_malloc to runtime_malloc in wasi native lib
Refine classic interpreter op_block and op_br_table
Refine faster interpreter op_br_table

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
This commit is contained in:
Wenyong Huang
2020-12-27 20:46:31 -06:00
committed by GitHub
parent 13f0b2485b
commit 724858c731
19 changed files with 144 additions and 192 deletions

View File

@ -20,11 +20,11 @@ OUT_FILE=${i%.*}.wasm
-Wno-int-conversion \
-I${APP_FRAMEWORK_DIR}/include \
-I${DEPS_DIR} \
--target=wasm32 -O3 -z stack-size=4096 -Wl,--initial-memory=65536 \
--sysroot=${SDK_DIR}/app-sdk/libc-builtin-sysroot \
-L${APP_FRAMEWORK_DIR}/lib -lapp_framework \
-Wl,--allow-undefined-file=${SDK_DIR}/app-sdk/libc-builtin-sysroot/share/defined-symbols.txt \
-Wl,--no-threads,--strip-all,--no-entry -nostdlib \
-O3 -z stack-size=4096 -Wl,--initial-memory=65536 \
--sysroot=${SDK_DIR}/app-sdk/libc-builtin-sysroot \
-L${APP_FRAMEWORK_DIR}/lib -lapp_framework \
-Wl,--allow-undefined-file=${SDK_DIR}/app-sdk/libc-builtin-sysroot/share/defined-symbols.txt \
-Wl,--strip-all,--no-entry -nostdlib \
-Wl,--export=on_init -Wl,--export=on_destroy \
-Wl,--export=on_request -Wl,--export=on_response \
-Wl,--export=on_sensor_event -Wl,--export=on_timer_callback \
@ -36,4 +36,4 @@ if [ -f ${OUT_FILE} ]; then
else
echo "build ${OUT_FILE} fail"
fi
done
done