Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ILStrip+wasm_opt pass when using WasmSingleFileBundle #95478

Open
Tracked by #94803
lewing opened this issue Nov 30, 2023 · 13 comments
Open
Tracked by #94803

Add ILStrip+wasm_opt pass when using WasmSingleFileBundle #95478

lewing opened this issue Nov 30, 2023 · 13 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm
Milestone

Comments

@lewing
Copy link
Member

lewing commented Nov 30, 2023

When using WasmSingleFileBundle+AOT we should be able to run ILStrip + wasm-opt which we think would optimize out the zero'd out memory. We should test this hypothesis on browser-wasm and implement it on wasi-wasm if it is true

cc @fanyang-mono @SamMonoRT

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Nov 30, 2023
@ghost
Copy link

ghost commented Nov 30, 2023

Tagging subscribers to this area: @agocke, @vitek-karas, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: lewing
Assignees: -
Labels:

area-Single-File

Milestone: -

@lewing lewing added arch-wasm WebAssembly architecture and removed area-Single-File labels Nov 30, 2023
@ghost
Copy link

ghost commented Nov 30, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: lewing
Assignees: -
Labels:

arch-wasm, untriaged

Milestone: -

@lewing lewing added this to the 9.0.0 milestone Nov 30, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Nov 30, 2023
@radical
Copy link
Member

radical commented Nov 30, 2023

For browser-wasm the SingleFileBundle support is missing - #95480 .

@lewing
Copy link
Member Author

lewing commented Nov 30, 2023

We can run ilstrip by hand to test first but we should add it to the build anyway

@fanyang-mono
Copy link
Member

I am not sure how to do WasmSingleFileBundle @radical Could you show me?

@radical
Copy link
Member

radical commented Dec 1, 2023

This is covered by some other changes that I'm working on.

@radical radical self-assigned this Dec 1, 2023
@fanyang-mono
Copy link
Member

@radical If you are hitting any issues using it, feel free to let me know.

@lewing
Copy link
Member Author

lewing commented Dec 12, 2023

@radical what is the state of this, ILStrip is in, what is the state of wasm-opt?

@radical
Copy link
Member

radical commented Dec 12, 2023

@radical what is the state of this, ILStrip is in, what is the state of wasm-opt?

It's not a separate step. I can extract that into one though.

<Exec Command="wasm-opt$(_ExeExt) --enable-simd --enable-exception-handling @(WasmOptConfigurationFlags, ' ') --strip-dwarf &quot;$(_WasmIntermediateOutputPath)dotnet.native.wasm&quot; -o &quot;$(_WasmIntermediateOutputPath)dotnet.native.wasm&quot;"
Condition="'$(WasmNativeStrip)' == 'true'"
IgnoreStandardErrorWarningFormat="true"
EnvironmentVariables="@(EmscriptenEnvVars)" />

What arguments do we want to run that with?

@lewing
Copy link
Member Author

lewing commented Dec 12, 2023

The discussion in https://github.com/dotnet/runtime/issues/94804 is relevant here. And https://github.com/emscripten-core/emscripten/blob/c54ebd73e383742e1e94729d863f97f23cfa8ff0/tools/link.py#L369 and if the section is indeed missing in the wasi build I assume clang is doing something similar in the final link step

@radical
Copy link
Member

radical commented Dec 13, 2023

WIP - #95900

@radical
Copy link
Member

radical commented Dec 18, 2023

The build has support for this now, but not all of it is working for example - browser-wasm+singlefilebundle .

@radical radical removed their assignment Dec 18, 2023
@ilonatommy ilonatommy added the os-browser Browser variant of arch-wasm label Jun 3, 2024
@lewing lewing modified the milestones: 9.0.0, 10.0.0 Jul 30, 2024
@pavelsavara
Copy link
Member

Note that because we now produce WASI components, wasm-opt can't be used on those until WebAssembly/binaryen#6728

But I think we il-strip on publish ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm
Projects
None yet
Development

No branches or pull requests

6 participants