Skip to content

Commit 217761e

Browse files
committed
Remove s2wasm
s2wasm is no longer used my emscripten and as far as I know now as no other users.
1 parent 487cee5 commit 217761e

File tree

1,345 files changed

+14
-191305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,345 files changed

+14
-191305
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ bin/wasm-shell
3939
bin/wasm-opt
4040
bin/asm2wasm
4141
bin/wasm2asm
42-
bin/s2wasm
4342
bin/wasm-as
4443
bin/wasm-dis
4544
lib/

CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -230,17 +230,6 @@ SET_PROPERTY(TARGET wasm2asm PROPERTY CXX_STANDARD 11)
230230
SET_PROPERTY(TARGET wasm2asm PROPERTY CXX_STANDARD_REQUIRED ON)
231231
INSTALL(TARGETS wasm2asm DESTINATION ${CMAKE_INSTALL_BINDIR})
232232

233-
SET(s2wasm_SOURCES
234-
src/tools/s2wasm.cpp
235-
src/wasm-linker.cpp
236-
)
237-
ADD_EXECUTABLE(s2wasm
238-
${s2wasm_SOURCES})
239-
TARGET_LINK_LIBRARIES(s2wasm passes wasm asmjs ir cfg support)
240-
SET_PROPERTY(TARGET s2wasm PROPERTY CXX_STANDARD 11)
241-
SET_PROPERTY(TARGET s2wasm PROPERTY CXX_STANDARD_REQUIRED ON)
242-
INSTALL(TARGETS s2wasm DESTINATION ${CMAKE_INSTALL_BINDIR})
243-
244233
SET(wasm-emscripten-finalize_SOURCES
245234
src/tools/wasm-emscripten-finalize.cpp
246235
)

README.md

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Binaryen is a compiler and toolchain infrastructure library for WebAssembly, wri
1111
Compilers built using Binaryen include
1212

1313
* [`asm2wasm`](https://github.com/WebAssembly/binaryen/blob/master/src/asm2wasm.h) which compiles asm.js to WebAssembly
14-
* [`s2wasm`](https://github.com/WebAssembly/binaryen/blob/master/src/s2wasm.h) which compiles the LLVM WebAssembly's backend `.s` output format
1514
* [`AssemblyScript`](https://github.com/AssemblyScript/assemblyscript) which compiles TypeScript to Binaryen IR
1615
* [`wasm2asm`](https://github.com/WebAssembly/binaryen/blob/master/src/wasm2asm.h) which compiles WebAssembly to asm.js
1716
* [`mir2wasm`](https://github.com/brson/mir2wasm/) which compiles Rust MIR
@@ -64,9 +63,9 @@ This repository contains code that builds the following tools in `bin/`:
6463
* **wasm-opt**: Loads WebAssembly and runs Binaryen IR passes on it.
6564
* **asm2wasm**: An asm.js-to-WebAssembly compiler, using Emscripten's asm optimizer infrastructure. This is used by Emscripten in Binaryen mode when it uses Emscripten's fastcomp asm.js backend.
6665
* **wasm2asm**: A WebAssembly-to-asm.js compiler (still experimental).
67-
* **s2wasm**: A compiler from the `.s` format emitted by the new WebAssembly backend being developed in LLVM. This is used by Emscripten in Binaryen mode when it integrates with the new LLVM backend.
6866
* **wasm-merge**: Combines wasm files into a single big wasm file (without sophisticated linking).
6967
* **wasm-ctor-eval**: A tool that can execute C++ global constructors ahead of time. Used by Emscripten.
68+
* **wasm-emscripten-finalize**: Takes a wasm binary produced by llvm+lld and performs emscripten-specific passes over it.
7069
* **wasm.js**: wasm.js contains Binaryen components compiled to JavaScript, including the interpreter, `asm2wasm`, the S-Expression parser, etc., which allow you to use Binaryen with Emscripten and execute code compiled to WASM even if the browser doesn't have native support yet. This can be useful as a (slow) polyfill.
7170
* **binaryen.js**: A standalone JavaScript library that exposes Binaryen methods for [creating and optimizing WASM modules](https://github.com/WebAssembly/binaryen/blob/master/test/binaryen.js/hello-world.js).
7271

@@ -179,31 +178,6 @@ Pass `--debug` on the command line to see debug info, about asm.js functions as
179178

180179
When using `emcc` with the `BINARYEN` option, it will use Binaryen to build to WebAssembly. This lets you compile C and C++ to WebAssembly, with emscripten using asm.js internally as a build step. Since emscripten's asm.js generation is very stable, and asm2wasm is a fairly simple process, this method of compiling C and C++ to WebAssembly is usable already. See the [emscripten wiki](https://github.com/kripken/emscripten/wiki/WebAssembly) for more details about how to use it.
181180

182-
### C/C++ Source ⇒ WebAssembly LLVM backend ⇒ s2wasm ⇒ WebAssembly
183-
184-
Binaryen's `s2wasm` tool can translate the `.s` output from the LLVM WebAssembly backend into WebAssembly. You can receive `.s` output from `llc`, and then run `s2wasm` on that:
185-
186-
```
187-
llc code.ll -mtriple=wasm32-unknown-unknown-elf -filetype=asm -o code.s
188-
s2wasm code.s > code.wat
189-
```
190-
191-
You can also use Emscripten, which will do those steps for you (as well as link to system libraries, etc.). You can use either normal Emscripten, including it's "fastcomp" fork of LLVM, or you can use "vanilla" LLVM, that is, pure upstream LLVM without Emscripten's additions. With Vanilla LLVM, you can build with
192-
193-
```
194-
./emcc input.cpp -s BINARYEN=1
195-
```
196-
197-
With normal Emscripten, you will need to tell it to use the WebAssembly backend, since its default is asm.js, by setting an env var,
198-
199-
```
200-
EMCC_WASM_BACKEND=1 ./emcc input.cpp -s BINARYEN=1
201-
```
202-
203-
(without the env var, the `BINARYEN` option will make it use the asm.js backend, then `asm2wasm`).
204-
205-
For more details, see the [emscripten wiki](https://github.com/kripken/emscripten/wiki/WebAssembly).
206-
207181
## Testing
208182

209183
```
@@ -212,10 +186,6 @@ For more details, see the [emscripten wiki](https://github.com/kripken/emscripte
212186

213187
(or `python check.py`) will run `wasm-shell`, `wasm-opt`, `asm2wasm`, `wasm.js`, etc. on the testcases in `test/`, and verify their outputs.
214188

215-
It will also run `s2wasm` through the last known good LLVM output from the [build waterfall][].
216-
217-
[build waterfall]: https://build.chromium.org/p/client.wasm.llvm/console
218-
219189
The `check.py` script supports some options:
220190

221191
```

auto_update_tests.py

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from scripts.test.support import run_command, split_wast, node_test_glue, node_has_webassembly
2323
from scripts.test.shared import (
24-
ASM2WASM, MOZJS, NODEJS, S2WASM, WASM_OPT, WASM_AS, WASM_DIS,
24+
ASM2WASM, MOZJS, NODEJS, WASM_OPT, WASM_AS, WASM_DIS,
2525
WASM_CTOR_EVAL, WASM_MERGE, WASM_REDUCE, WASM2ASM, WASM_METADCE,
2626
WASM_EMSCRIPTEN_FINALIZE, BINARYEN_INSTALL_DIR,
2727
files_with_pattern, has_shell_timeout)
@@ -69,35 +69,6 @@ def update_asm_js_tests():
6969
run_command(cmd)
7070

7171

72-
def update_dot_s_tests():
73-
extension_arg_map = {
74-
'.wast': [],
75-
'.clamp.wast': ['--trap-mode=clamp'],
76-
'.js.wast': ['--trap-mode=js'],
77-
'.jscall.wast': ['--emscripten-reserved-function-pointers=3'],
78-
}
79-
for dot_s_dir in ['dot_s', 'llvm_autogenerated']:
80-
for s in sorted(os.listdir(os.path.join('test', dot_s_dir))):
81-
if not s.endswith('.s'):
82-
continue
83-
print '..', s
84-
for ext, ext_args in extension_arg_map.iteritems():
85-
wasm = s.replace('.s', ext)
86-
expected_file = os.path.join('test', dot_s_dir, wasm)
87-
if ext != '.wast' and not os.path.exists(expected_file):
88-
continue
89-
90-
full = os.path.join('test', dot_s_dir, s)
91-
stack_alloc = ['--allocate-stack=1024'] if dot_s_dir == 'llvm_autogenerated' else []
92-
cmd = S2WASM + [full, '--emscripten-glue'] + stack_alloc + ext_args
93-
if s.startswith('start_'):
94-
cmd.append('--start')
95-
actual = run_command(cmd, stderr=subprocess.PIPE, expected_err='')
96-
97-
with open(expected_file, 'w') as o:
98-
o.write(actual)
99-
100-
10172
def update_lld_tests():
10273
print '\n[ checking wasm-emscripten-finalize testcases... ]\n'
10374

@@ -435,7 +406,6 @@ def update_reduce_tests():
435406

436407
def main():
437408
update_asm_js_tests()
438-
update_dot_s_tests()
439409
update_lld_tests()
440410
update_wasm_opt_tests()
441411
update_bin_fmt_tests()

check.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
import scripts.test.asm2wasm as asm2wasm
3333
import scripts.test.lld as lld
34-
import scripts.test.s2wasm as s2wasm
3534
import scripts.test.wasm2asm as wasm2asm
3635

3736
if options.interpreter:
@@ -632,8 +631,6 @@ def main():
632631

633632
run_spec_tests()
634633
run_binaryen_js_tests()
635-
s2wasm.test_s2wasm()
636-
s2wasm.test_linker()
637634
lld.test_wasm_emscripten_finalize()
638635
wasm2asm.test_wasm2asm()
639636
run_validator_tests()

scripts/test/s2wasm.py

Lines changed: 0 additions & 134 deletions
This file was deleted.

scripts/test/shared.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ def is_exe(fpath):
170170
WASM_CTOR_EVAL = [os.path.join(options.binaryen_bin, 'wasm-ctor-eval')]
171171
WASM_SHELL = [os.path.join(options.binaryen_bin, 'wasm-shell')]
172172
WASM_MERGE = [os.path.join(options.binaryen_bin, 'wasm-merge')]
173-
S2WASM = [os.path.join(options.binaryen_bin, 's2wasm')]
174173
WASM_REDUCE = [os.path.join(options.binaryen_bin, 'wasm-reduce')]
175174
WASM_METADCE = [os.path.join(options.binaryen_bin, 'wasm-metadce')]
176175
WASM_EMSCRIPTEN_FINALIZE = [os.path.join(options.binaryen_bin,
@@ -192,7 +191,6 @@ def wrap_with_valgrind(cmd):
192191
WASM_DIS = wrap_with_valgrind(WASM_DIS)
193192
ASM2WASM = wrap_with_valgrind(ASM2WASM)
194193
WASM_SHELL = wrap_with_valgrind(WASM_SHELL)
195-
S2WASM = wrap_with_valgrind(S2WASM)
196194

197195
os.environ['BINARYEN'] = os.getcwd()
198196

0 commit comments

Comments
 (0)