Skip to content

Support optimized builds with source maps #20462

@kripken

Description

@kripken

Right now e.g. -O3 -gsource-map is not fully optimized: we do optimize the wasm code fully, but it has some properties of a debug build, like the JS is not minified, and there is a names section. emcc.py sets the debug level to 3 when it sees -gsource-map which causes the rest of the effects.

It would be useful to optionally fully optimize. Then the source map could be used like a symbol map for crashes, to symbolize them, and not just with function names but locations as well. (edit: fully optimized builds can be symbolized using emcc --emit-symbol-map, which gives proper function names, but not line:column positions inside functions)

I'm not sure if we should do this as a breaking change. On the one hand it is on a debug build, so shrinking size wouldn't regress people's production builds, but it could interfere with debug workflows people are used to. On the other hand, adding a new flag for this is annoying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions