Skip to content

Strip symbols from produced .wasm #6904

Closed
@vedadkajtaz

Description

@vedadkajtaz

Hello,
not sure whether this is actually an emscripten or clang issue, but here it goes.

I cannot manage to find a consistent way of stripping the symbols from the produced .wasm file. Basically, we end up with all the namespace, class and function names publicly visible.

I've created a mini project to reproduce the issue (3 classes w/virtual methods).
Basically, providing -Os, -O2 or higher on one hand, and --llvm-lto 2 on the other, strips the symbols away.

However, it does not work for my actual project. Varying -O option somehow makes the number of visible symbols vary by couple of hundreds, but most of them still end up in the .wasm.

I have also tried -g0, --llvm-opts "['-strip-debug']", postprocessing with wasm-opt, but haven't found the way to strip those symbols.

Any ideas?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions