-
Notifications
You must be signed in to change notification settings - Fork 192
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
Huge code bloat with wasi-sdk-23 #460
Comments
i think the recent migration to cmake effectively added |
Ah, that would make sense. Was it an intended change? |
@alexcrichton From your commit, I assume that the libraries should not have been built with debug? |
This was an intentional change in #422 pre-cmake. The assumption was that this is useful information that cannot otherwise be generated and it's relatively easy to strip through various CLI tools or the |
Okay... It was somewhat surprising though, I presume this is a change to make life more easier fo wasi-sdk devs? When I'm building wasi-sdk myself, is there a rune/build target I can use to revert to the old behaviour? |
While I'm not sure what a rune is when you're building the sysroot from this repository you can configure what's build with |
Whatever wask-sdk does, I would recommend explicitly stripping your release binaries using strip/llvm-strip, on all platforms. |
Thanks! That has worked, though I'm still unsure why this the default for a distributed release build.
Noted. Is there a document somewhere that lays out the recommended developer flow? I'm used to invoking a compiler and that being it :) |
Sorry, I'm certainly doing something silly and would appreciate some pointers. On sdk 24, with int printf(const char *, ...); int main(){printf("hello world!\n");} Compiled with:
I get a WASM component file that if I plop into http://wa2.dev shows imports for lots of things I don't use (tcp, udp, etc) and tons of wat. Sounds like strip/llvm-strip is expected to help with that? If I try to run the cli tool it doesn't seem to handle the wasm (which I'm not super clear on what tooling I should expect handles wasm modules / components in llvm):
In this trivial setup know how I can get strip to work / have a more reasonable component output? Attached are the |
@rajsite looks like you're building a component with the The Otherwise the "strip" functionality is primarily centered around removing custom sections, so the strip tool will not be suitable for what you're trying to achieve which is to remove imports. If you're interested in that I'd recommend opening a separate issue as I believe it's unrelated to this one about debuginfo. |
Gotcha, I see the difference. I'll create a separate issue to discuss the import behavior. Thanks for clarifying! In the context of this issue, is there an expected workflow for stripping debug info when using |
The comment above of using |
Appreciate it! On the clang cli
Stripping out the debug sections reduced the size quite a bit:
I'll keep poking at handling the unused imports and create a separate issue for that. |
I've been trying to find docs like this and the closet I have seen is this PR to the component-model docs repo: bytecodealliance/component-docs#66 But it doesn't cover the expected workflow of stripping release release binaries either. |
Hi,
I've just updated my benchmark binaries to compile with 23, instead of 22. I'm seeing code size changes that I don't understand, maybe changes in how the libraries are built? Has anyone noticed similar changes? Below is my
git pull
log which caught my attention!cheers,
Sam
The text was updated successfully, but these errors were encountered: