Skip to content

Commit 89a8a85

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 89a8a85

File tree

14 files changed

+12
-2725
lines changed

14 files changed

+12
-2725
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: 0 additions & 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,7 +63,6 @@ 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.
7068
* **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.
@@ -179,31 +177,6 @@ Pass `--debug` on the command line to see debug info, about asm.js functions as
179177

180178
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.
181179

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-
207180
## Testing
208181

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

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

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-
219188
The `check.py` script supports some options:
220189

221190
```

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 & 1 deletion
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,

0 commit comments

Comments
 (0)