digitalmars.D.ldc - All symbols exported on wasm target
- Sebastiaan Koppe (11/11) Nov 03 2018 I am doing a lot of wasm [1] compilation with ldc lately, and I
- Johan Engelen (5/8) Nov 03 2018 You could testdrive this PR:
- Sebastiaan Koppe (2/10) Nov 03 2018 That is nice. Will try tonight.
- Sebastiaan Koppe (10/18) Nov 04 2018 The pull request works wonders! I just add 'export' where I need
- kinke (3/8) Nov 04 2018 Are you sure you didn't just forget -betterC?
- Sebastiaan Koppe (7/8) Nov 05 2018 I didn't, but dub did.
I am doing a lot of wasm [1] compilation with ldc lately, and I have noticed that all symbols get exported regardless of what I try. E.g. strip-all wont strip any, etc. When I strip things manually I can sometimes get something from 90kb to 9kb, so it really is substantial. According to [2], on clang you can workaround this, by adding __attribute__((visibility("default"))) to each function you want exported. Any similar solution for ldc? [1] https://github.com/skoppe/spasm [2] https://aransentin.github.io/cwasm/
Nov 03 2018
On Saturday, 3 November 2018 at 11:12:42 UTC, Sebastiaan Koppe wrote:I am doing a lot of wasm [1] compilation with ldc lately, and I have noticed that all symbols get exported regardless of what I try. E.g. strip-all wont strip any, etc.You could testdrive this PR: https://github.com/ldc-developers/ldc/pull/2894 -Johan
Nov 03 2018
On Saturday, 3 November 2018 at 12:45:25 UTC, Johan Engelen wrote:On Saturday, 3 November 2018 at 11:12:42 UTC, Sebastiaan Koppe wrote:That is nice. Will try tonight.I am doing a lot of wasm [1] compilation with ldc lately, and I have noticed that all symbols get exported regardless of what I try. E.g. strip-all wont strip any, etc.You could testdrive this PR: https://github.com/ldc-developers/ldc/pull/2894 -Johan
Nov 03 2018
On Saturday, 3 November 2018 at 12:45:25 UTC, Johan Engelen wrote:On Saturday, 3 November 2018 at 11:12:42 UTC, Sebastiaan Koppe wrote:The pull request works wonders! I just add 'export' where I need it, and voila! I did notice some other garbage though... (compared to ldc1.12.0) It might be completely unrelated to the pull request, but I noticed extra *__initZ wasm globals being generated (at least 50 extra I never saw with 1.12), as well as _d_arraybounds, some toHash's and opEquals, and more static data in the data section (probably related to the __init's). Need to check without the pull request...I am doing a lot of wasm [1] compilation with ldc lately, and I have noticed that all symbols get exported regardless of what I try. E.g. strip-all wont strip any, etc.You could testdrive this PR: https://github.com/ldc-developers/ldc/pull/2894 -Johan
Nov 04 2018
On Sunday, 4 November 2018 at 21:22:07 UTC, Sebastiaan Koppe wrote:It might be completely unrelated to the pull request, but I noticed extra *__initZ wasm globals being generated (at least 50 extra I never saw with 1.12), as well as _d_arraybounds, some toHash's and opEquals, and more static data in the data section (probably related to the __init's).Are you sure you didn't just forget -betterC?
Nov 04 2018
On Sunday, 4 November 2018 at 21:40:13 UTC, kinke wrote:Are you sure you didn't just forget -betterC?I didn't, but dub did. With dub 1.11.0, the betterC dflags I set in a dependency project got propagated to the root package. With dub 1.12.0, that is no longer the case, and I have to set the betterC flag on both projects. I went through the dub commits but couldn't find anything...
Nov 05 2018