diff options
author | bloodstalker <thabogre@gmail.com> | 2018-05-28 13:55:37 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2018-05-28 13:55:37 +0000 |
commit | 0c522ec5bfee22c7de54987d316cfbf245a8826e (patch) | |
tree | 7023705e17e7d78226b436329f81841db6dfbd9b /extra-tools/llvm-wasm | |
parent | load.py is now imported bt another python module, should cut down on startup ... (diff) | |
download | mutator-0c522ec5bfee22c7de54987d316cfbf245a8826e.tar.gz mutator-0c522ec5bfee22c7de54987d316cfbf245a8826e.zip |
added test files for the wasm linker. added two scripts to extra-tools
Diffstat (limited to '')
-rwxr-xr-x | extra-tools/llvm-wasm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/extra-tools/llvm-wasm b/extra-tools/llvm-wasm new file mode 100755 index 0000000..bf31f7a --- /dev/null +++ b/extra-tools/llvm-wasm @@ -0,0 +1,17 @@ +#!/bin/bash +# needs wabt, binaryen and clang's wasm backend to work. +# https://github.com/WebAssembly/binaryen +# https://github.com/WebAssembly/wabt +# as far as i know, up to clang 6, you need to +# explicitly ask for the wasm backend to be built. +# you can look at llvm-build.sh in this directory for the +# llvm/clang build command i use. + +fullname=$1 +namelength=${#fullname} +offset=$((${#fullname} - 2)) +filename=${fullname:0:$offset} +"clang" -emit-llvm --target=wasm32 -Oz "$1" -c +"llc" -asm-verbose=false -o $filename.s $filename.bc +"s2wasm" $filename.s > $filename.wast +"wast2wasm" $filename.wast -o $filename.wasm |