Skip to content

Commit e006d5e

Browse files
authored
Merge pull request #110 from Lind-Project/migrate-binaryen
upload modified Binaryen binary
2 parents 1747e9f + b71c17e commit e006d5e

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

lindtool.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
#!/bin/bash
2+
LIND_WASM_BASE="${LIND_WASM_BASE:-/home/lind/lind-wasm}"
23

3-
glibc_base="$PWD/src/glibc"
4-
wasmtime_base="$PWD/src/wasmtime"
5-
rustposix_base="$PWD/src/safeposix-rust"
6-
rawposix_base="$PWD/src/RawPOSIX"
4+
glibc_base="$LIND_WASM_BASE/src/glibc"
5+
wasmtime_base="$LIND_WASM_BASE/src/wasmtime"
6+
rustposix_base="$LIND_WASM_BASE/src/safeposix-rust"
7+
rawposix_base="$LIND_WASM_BASE/src/RawPOSIX"
78

8-
CC="${CLANG:=/home/lind-wasm/clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04}/bin/clang"
9+
wasm_opt_base="$LIND_WASM_BASE/tools/binaryen/bin/wasm-opt"
10+
11+
CC="${CLANG:=/home/lind/lind-wasm/clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04}/bin/clang"
912

1013
export_cmd="export LD_LIBRARY_PATH=$wasmtime_base/crates/rustposix:\$LD_LIBRARY_PATH"
1114

12-
compile_test_cmd_fork="$CC --target=wasm32-unknown-wasi --sysroot $glibc_base/sysroot -Wl,--export="__stack_pointer",--export=__stack_low [input] -g -O0 -o [output] && wasm-opt --asyncify --debuginfo [output] -o [output]"
15+
compile_test_cmd_fork="$CC --target=wasm32-unknown-wasi --sysroot $glibc_base/sysroot -Wl,--export="__stack_pointer",--export=__stack_low [input] -g -O0 -o [output] && $wasm_opt_base --epoch-injection --asyncify --debuginfo [output] -o [output]"
1316
compile_test_cmd_noshared="$CC --target=wasm32-unknown-wasi --sysroot $glibc_base/sysroot -Wl,--export="__stack_pointer",--export=__stack_low [input] -g -O0 -o [output]"
1417
compile_test_cmd="$CC -pthread --target=wasm32-unknown-wasi --sysroot $glibc_base/sysroot -Wl,--import-memory,--export-memory,--max-memory=67108864,--export=__stack_low [input] -g -O0 -o [output]"
1518
precompile_wasm="$wasmtime_base/target/debug/wasmtime compile [input] -o [output]"
1619

17-
compile_test_cmd_fork_test="$CC -pthread --target=wasm32-unknown-wasi --sysroot $glibc_base/sysroot -Wl,--import-memory,--export-memory,--max-memory=67108864,--export="__stack_pointer",--export=__stack_low [input] -g -O0 -o [output] && wasm-opt --asyncify --debuginfo [output] -o [output]"
20+
compile_test_cmd_fork_test="$CC -pthread --target=wasm32-unknown-wasi --sysroot $glibc_base/sysroot -Wl,--import-memory,--export-memory,--max-memory=67108864,--export="__stack_pointer",--export=__stack_low [input] -g -O0 -o [output] && $wasm_opt_base --epoch-injection --asyncify --debuginfo [output] -o [output]"
1821

1922
run_cmd="$wasmtime_base/target/debug/wasmtime run --wasi threads=y --wasi preview2=n [target]"
2023
run_cmd_precompile="$wasmtime_base/target/debug/wasmtime run --allow-precompiled --wasi threads=y --wasi preview2=n [target]"
@@ -24,6 +27,8 @@ compile_wasmtime_cmd="cd $wasmtime_base && cargo build"
2427
compile_rustposix_cmd="cd $rustposix_base && cargo build && cp $rustposix_base/target/debug/librustposix.so $wasmtime_base/crates/rustposix"
2528
compile_rawposix_cmd="cd $rawposix_base && cargo build && cp $rawposix_base/target/debug/librustposix.so $wasmtime_base/crates/rustposix"
2629

30+
compile_binaryen_cmd="cd $binaryen_base && cmake . && make"
31+
2732
compile_pthread_create="$CC --target=wasm32-unkown-wasi -v -Wno-int-conversion pthread_create.c -c -std=gnu11 -fgnu89-inline -matomics -mbulk-memory -O0 -g -Wall -Wwrite-strings -Wundef -fmerge-all-constants -ftrapping-math -fno-stack-protector -fno-common -Wp,-U_FORTIFY_SOURCE -Wstrict-prototypes -Wold-style-definition -fmath-errno -fPIE -ftls-model=local-exec -I../include -I$glibc_base/build/nptl -I$glibc_base/build -I../sysdeps/lind -I../lind_syscall -I../sysdeps/unix/sysv/linux/i386/i686 -I../sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/x86/include -I../sysdeps/unix/sysv/linux/x86 -I../sysdeps/x86/nptl -I../sysdeps/i386/nptl -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux -I../sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/fpu -I../sysdeps/x86/fpu -I../sysdeps/i386 -I../sysdeps/x86/include -I../sysdeps/x86 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/float128 -I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic -I.. -I../libio -I. -nostdinc -isystem $CLANG/lib/clang/16/include -isystem /usr/i686-linux-gnu/include -D_LIBC_REENTRANT -include $glibc_base/build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h -DPIC -DTOP_NAMESPACE=glibc -o $glibc_base/build/nptl/pthread_create.o -MD -MP -MF $glibc_base/build/nptl/pthread_create.o.dt -MT $glibc_base/build/nptl/pthread_create.o"
2833
compile_wasi_thread_start="$CC --target=wasm32-wasi-threads -matomics -o $glibc_base/build/csu/wasi_thread_start.o -c $glibc_base/csu/wasm32/wasi_thread_start.s"
2934
make_cmd="cd $glibc_base && rm -rf build && ./wasm-config.sh && cd build && make -j8 --keep-going 2>&1 THREAD_MODEL=posix | tee check.log && cd ../nptl && $compile_pthread_create && cd ../ && $compile_wasi_thread_start && ./gen_sysroot.sh"

tools/binaryen/bin/wasm-opt

1.64 MB
Binary file not shown.

tools/binaryen/lib/libbinaryen.so

28.5 MB
Binary file not shown.

0 commit comments

Comments
 (0)