Skip to content

Add a --standalone-wasm flag to wasm-emscripten-finalize#2333

Merged
kripken merged 9 commits intomasterfrom
wasi2
Sep 18, 2019
Merged

Add a --standalone-wasm flag to wasm-emscripten-finalize#2333
kripken merged 9 commits intomasterfrom
wasi2

Conversation

@kripken
Copy link
Copy Markdown
Member

@kripken kripken commented Sep 6, 2019

The flag indicates that we want to run the wasm by itself, without JS support. In that case we don't emit JS dynCalls etc., and we also emit a wasi _start if there is a main, i.e., we try to use the current conventions in the wasm-only space.

…S stuff wasi doesn't need like dynCalls, and emits a wasi _start if relevant.
Comment thread src/tools/wasm-emscripten-finalize.cpp Outdated
Comment thread src/tools/wasm-emscripten-finalize.cpp
Comment thread src/tools/wasm-emscripten-finalize.cpp
@kripken kripken changed the title Add a --wasi flag to wasm-emscripten-finalize Add a --pure-wasm flag to wasm-emscripten-finalize Sep 17, 2019
@kripken
Copy link
Copy Markdown
Member Author

kripken commented Sep 17, 2019

Ok, I renamed the flag from wasi to pure-wasm. The flag basically means we don't want to depend on JS, so no dynCalls etc., and we want to run in wasm-only environments, so we use wasi etc. conventions, which for now means using a wasi _start. I agree in the future we can look for a nicer way to set up that function in emscripten (but atm it seems to be like we'd need something even messier on that side).

@kripken kripken changed the title Add a --pure-wasm flag to wasm-emscripten-finalize Add a --standalone-wasm flag to wasm-emscripten-finalize Sep 18, 2019
@kripken
Copy link
Copy Markdown
Member Author

kripken commented Sep 18, 2019

Renamed again, to --standalone-wasm. Based on offline discussion that seems to have the most support. We may tweak the emscripten flag, but for the binaryen side I think this is good enough?

@kripken kripken merged commit 159e9a4 into master Sep 18, 2019
@kripken kripken deleted the wasi2 branch September 18, 2019 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants