emscripten-core / emscripten-core/emscripten

Larger output with -o x.wasm as opposed to -s STANDALONE_WASM

Open
#14,543 12 comments 0 reactions 0 assignees View on GitHub
wontfix
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Targetting a wasm file turns on standalone mode, but it also does more things it seems, that increase code size.

For example,
```
./emcc tests/other/metadce/minimal.c -O3 -o a.out.js --no-entry -s STANDALONE_WASM
```
emits 124 bytes, while replacing `.js` with `.wasm` leads to `266` bytes. (Can also remove `-s STANDALONE_WASM` in that mode, it doesn't matter.)

I can look into this, but I wondered if that has an obvious explanation perhaps? cc @sbc100

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.