mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-12 14:09:13 +00:00
30 lines
1.0 KiB
Bash
Executable File
30 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd -P -- "$(dirname -- "$0")"
|
|
|
|
ROOT=../../../
|
|
BINARYEN="$ROOT/tools/binaryen/bin"
|
|
WASI_SDK="$ROOT/tools/wasi-sdk/bin"
|
|
|
|
trap 'rm -f sql3parse_table.tmp' EXIT
|
|
|
|
"$WASI_SDK/clang" --target=wasm32-wasi -std=c23 -g0 -Oz \
|
|
-Wall -Wextra -Wno-unused-parameter -Wno-unused-function \
|
|
-o sql3parse_table.wasm main.c \
|
|
-I"$ROOT/sqlite3/libc" -I"$ROOT/sqlite3" \
|
|
-mexec-model=reactor \
|
|
-mmutable-globals -mnontrapping-fptoint \
|
|
-msimd128 -mbulk-memory -msign-ext \
|
|
-mreference-types -mmultivalue \
|
|
-fno-stack-protector -fno-stack-clash-protection \
|
|
-Wl,--stack-first \
|
|
-Wl,--import-undefined \
|
|
-Wl,--export=sql3parse_table
|
|
|
|
"$BINARYEN/wasm-ctor-eval" -c _initialize sql3parse_table.wasm -o sql3parse_table.tmp
|
|
"$BINARYEN/wasm-opt" --strip --strip-debug --strip-producers -c -Oz \
|
|
sql3parse_table.tmp -o sql3parse_table.wasm --low-memory-unused \
|
|
--enable-mutable-globals --enable-nontrapping-float-to-int \
|
|
--enable-simd --enable-bulk-memory --enable-sign-ext \
|
|
--enable-reference-types --enable-multivalue |