From: Matt Corallo Date: Tue, 28 Jun 2022 21:55:27 +0000 (+0000) Subject: [TS] Link wasm32-wasi libc as rustc no longer does by default X-Git-Tag: v0.0.108.0^2~6 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=123939f3549c6e96d381fd92ca409a317a03c1f6;p=ldk-java [TS] Link wasm32-wasi libc as rustc no longer does by default --- diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5bad5ef8..f4d683bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: run: | apt-get update apt-get -y dist-upgrade - apt-get -y install cargo libstd-rust-dev-wasm32 lld git g++ clang curl node-typescript npm python3 + apt-get -y install cargo libstd-rust-dev-wasm32 lld git g++ clang curl node-typescript npm python3 wasi-libc echo "int main() {}" > genbindings_wasm_test_file.c clang -nostdlib -o /dev/null --target=wasm32-wasi -Wl,--no-entry genbindings_wasm_test_file.c rm genbindings_wasm_test_file.c diff --git a/genbindings.sh b/genbindings.sh index cd926a4b..a78e57ed 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -203,8 +203,7 @@ else echo "Building TS bindings..." 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= + EXTRA_LINK=/usr/lib/wasm32-wasi/libc.a [ "$3" != "false" ] && COMPILE="$COMPILE -Wl,-wrap,calloc -Wl,-wrap,realloc -Wl,-wrap,reallocarray -Wl,-wrap,malloc -Wl,-wrap,aligned_alloc -Wl,-wrap,free" if [ "$3" = "true" ]; then WASM_FILE=liblightningjs_debug.wasm