-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Webassembly and --export-dynamic causes too much bloat #3122
Comments
I guess we need some more insight into this. Please correct me if I'm wrong, just trying to recap this: Before LLD 8, everything was fine, using implicit Then there came LLD 8, stripping everything except for the
But that's now leading to extreme bloat even with Expecting the user to export the functions manually in the linker cmdline would be a pretty ugly regression IMO. In the meantime, it was apparently decided to (ab)use the |
Correct. Although all the Ldc 1.15 got rid of them, but required you to explicitly mark those functions you wanted to keep via the
I forgot to put a If I look at the wasm binary I see a lot of
I have to try and find out. I will link with lld 8.0.1 as well as 7 and see what it gives. Expect a few days before I have time for it.
Yeah, I think that is a good long term solution. |
Wrt. to the |
Ok. If we can fix the visibility issue and use the I will first figure out why I have the object symbols in my wasm binary. If I can get rid of them then at least I will have a runnable wasm binary again. As for the bloat I can wait until the visibility issue is fixed. |
Currently, I depend on the linker to not export everything so I cannot use |
Same here.
Yeah, kinke said something similar. Good idea. |
@kinke I found the reason why the app.d
outputs:
|
Yeah well extern(D) classes aren't supported with |
I know, it happened to be inside a dependency I used. The point is that without |
Alright then, but so the same thing should happen with LLD < 8 too, so the culprit isn't |
I see your point. Removing (btw I checked, ldc 1.14 also exports the symbols). Cool. Two birds with one stone then. |
First of all, I am sorry, since I was probably the reason
--export-dynamic
got put in by default, but it is causing too much bloat.It will actually export all symbols, including things which aren't even used. In the case of the todo-mvc example in spasm, as a consequence the binary grows from 62Kb to 4Mb.
I know I can remove the switch from
ldc2.conf
, but this doesn't scale well to end users.Again, I am sorry for not noticing this earlier. Next beta's I will definitely check. Probably will setup my CI to do the tests for me.
I would prefer if we can remove
--export-dynamic
again. Then if people want to export functions they need to annotate the function withextern(C) export @assumeUsed
(when https://reviews.llvm.org/D57869 is released), or alternatively they can drop the@assumeUsed
attribute and add--export=funcname
to the linker invocation.The text was updated successfully, but these errors were encountered: