Skip to content

Support --emit-symbol-map in the wasm backend and metadce#8724

Merged
kripken merged 7 commits intoincomingfrom
esm
Jun 12, 2019
Merged

Support --emit-symbol-map in the wasm backend and metadce#8724
kripken merged 7 commits intoincomingfrom
esm

Conversation

@kripken
Copy link
Copy Markdown
Member

@kripken kripken commented May 31, 2019

To solve this, we emit -g on all intermediate operations on the wasm, preserving the function names. We then emit the symbol map at the very end, and also remove names from the binary if they are not needed there (doesn't make much sense to have names in both the binary and out, but we don't disallow that).

Fixes #8686

Depends on WebAssembly/binaryen#2155

@juj
Copy link
Copy Markdown
Collaborator

juj commented Jun 1, 2019

Great, thanks for working on this!

@kripken kripken merged commit 12bb430 into incoming Jun 12, 2019
@kripken kripken deleted the esm branch June 12, 2019 21:52
Comment thread emscripten.py
# tell binaryen to look at the features section, and if there isn't one, to use MVP
# (which matches what llvm+lld has given us)
cmd += ['--detect-features']
if shared.Settings.DEBUG_LEVEL >= 2 or shared.Settings.PROFILING_FUNCS:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we find a way to make options available outside of emcc.py to avoid the need to all these extra settings in Settings.js?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps. But a lot of the time we do need to use the new option inside the JS compiler too, and the settings.js mechanism is our current way to synchronize that world with python.

belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
…-core#8724)

To solve this, we emit -g on all intermediate operations on the wasm, preserving the function names. We then emit the symbol map at the very end, and also remove names from the binary if they are not needed there (doesn't make much sense to have names in both the binary and out, but we don't disallow that).

Fixes emscripten-core#8686

Depends on WebAssembly/binaryen#2155
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.

Feature request: support minifying wasm imports with --emit-symbol-map

3 participants