• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Wasm Prototype Experiment Notes
2
3Here's the command I use to test:
4
5```
6LD_LIBRARY_PATH=~/nacl/v8/out/native/lib.target make -j48 \
7    -f Makefile.standalone WASM=1 && \
8LD_LIBRARY_PATH=~/nacl/v8/out/native/lib.target ./pnacl-sz -O2 -filetype=asm \
9    -target=arm32 ./torture-s2wasm-sexpr-wasm/20000112-1.c.s.wast.wasm
10```
11
12You'll probably need to adjust your `LD_LIBRARY_PATH` to point to where your v8
13libraries are.
14
15You'll need to build v8 as a shared library. Build it like this:
16
17```
18make -j48 native component=shared_library
19```
20
21`wasm-run-torture-tests.py` can be used to run all the tests, or some
22subset. Running a subset will enable verbose output. You can download the
23torture tests from the [WebAssembly waterfall](https://wasm-stat.us/console) or
24by running `./fetch-torture-tests.sh`.
25
26
27To compile and run an executable, do the following from the subzero directory.
28
29```
30./pnacl-sz -filetype=obj -o foo.o foo.wasm
31clang -m32 foo.o src/wasm-runtime.c
32./a.out
33```
34
35Other useful commands:
36
37Compile a C file to a .wasm
38```
39./wasm-install/bin/emscripten/emcc hello-wasm.c -s BINARYEN=1
40./wasm-install/bin/sexpr-wasm a.out.wast -o a.out.wasm
41```
42