digitalmars.D.learn - whats happening to my binary file size?
- Israel (7/7) Aug 26 2014 I wasnt paying any attention to the file size of my binaries when
- Messenger (4/14) Aug 26 2014 Conjecture: your binary has its imports statically linked in, and
- Israel (6/22) Aug 26 2014 I see, thanks man. From what i understand is that this is a
- "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> (5/15) Aug 27 2014 You could try using LDC. The latest version 0.14.0 already uses
- Israel (7/26) Aug 27 2014 Yea i saw that thread in the LDC section and thats actually
- "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> (8/20) Aug 27 2014 I'm not too familiar with DUB, so I'll pass on this one, but a
- Mike Parker (7/10) Aug 27 2014 You can pass compiler-specific flags by adding a "dflags" entry to your
- Vladimir Panteleev (3/13) Aug 26 2014 You can see what's taking up space by upload a .map file here:
I wasnt paying any attention to the file size of my binaries when i started using D. My first program is simple and compiles at 486kb, which honestly, is kind of absurd but anyways, after i start adding other imports it ran all the way up to 4.5mb. what i want to ask is, what exactly is happening to my binary when all i do is import various modules?
Aug 26 2014
On Tuesday, 26 August 2014 at 23:36:44 UTC, Israel wrote:I wasnt paying any attention to the file size of my binaries when i started using D. My first program is simple and compiles at 486kb, which honestly, is kind of absurd but anyways, after i start adding other imports it ran all the way up to 4.5mb. what i want to ask is, what exactly is happening to my binary when all i do is import various modules?Conjecture: your binary has its imports statically linked in, and your linker doesn't remove unused code (--gc-sections). https://issues.dlang.org/show_bug.cgi?id=879
Aug 26 2014
On Wednesday, 27 August 2014 at 01:41:51 UTC, Messenger wrote:On Tuesday, 26 August 2014 at 23:36:44 UTC, Israel wrote:I see, thanks man. From what i understand is that this is a "unintended" "feature" rather than a direct bug in order to make my life easier? I know that object files are stored in .a libraries but all this seems too advanced for me to understand...I wasnt paying any attention to the file size of my binaries when i started using D. My first program is simple and compiles at 486kb, which honestly, is kind of absurd but anyways, after i start adding other imports it ran all the way up to 4.5mb. what i want to ask is, what exactly is happening to my binary when all i do is import various modules?Conjecture: your binary has its imports statically linked in, and your linker doesn't remove unused code (--gc-sections). https://issues.dlang.org/show_bug.cgi?id=879
Aug 26 2014
On Wednesday, 27 August 2014 at 02:16:37 UTC, Israel wrote:On Wednesday, 27 August 2014 at 01:41:51 UTC, Messenger wrote:You could try using LDC. The latest version 0.14.0 already uses --gc-sections automatically. (But it is based on DMD 2.065, so you cannot (yet) use all of the newest features like nogc that are in DMD 2.066.)Conjecture: your binary has its imports statically linked in, and your linker doesn't remove unused code (--gc-sections). https://issues.dlang.org/show_bug.cgi?id=879I see, thanks man. From what i understand is that this is a "unintended" "feature" rather than a direct bug in order to make my life easier? I know that object files are stored in .a libraries but all this seems too advanced for me to understand...
Aug 27 2014
On Wednesday, 27 August 2014 at 09:23:57 UTC, Marc Schütz wrote:On Wednesday, 27 August 2014 at 02:16:37 UTC, Israel wrote:Yea i saw that thread in the LDC section and thats actually pretty cool that he produced an 88kb file. Im not too worried about the GC since ive been working with it my entire time from beginner till now. But, how would i configure dub and my dub.json to automatically use those LDC switches if it isnt automatically built into dub?On Wednesday, 27 August 2014 at 01:41:51 UTC, Messenger wrote:You could try using LDC. The latest version 0.14.0 already uses --gc-sections automatically. (But it is based on DMD 2.065, so you cannot (yet) use all of the newest features like nogc that are in DMD 2.066.)Conjecture: your binary has its imports statically linked in, and your linker doesn't remove unused code (--gc-sections). https://issues.dlang.org/show_bug.cgi?id=879I see, thanks man. From what i understand is that this is a "unintended" "feature" rather than a direct bug in order to make my life easier? I know that object files are stored in .a libraries but all this seems too advanced for me to understand...
Aug 27 2014
On Wednesday, 27 August 2014 at 16:24:23 UTC, Israel wrote:On Wednesday, 27 August 2014 at 09:23:57 UTC, Marc Schütz wrote:I'm not too familiar with DUB, so I'll pass on this one, but a clarification: --gc-sections isn't referring to D's builtin GC, but tells the linker to remove "garbage sections" in the executable, i.e. those that aren't referenced from anywhere. Apart from the name (and that the underlying ideas are similar), those two have nothing to do with each other.You could try using LDC. The latest version 0.14.0 already uses --gc-sections automatically. (But it is based on DMD 2.065, so you cannot (yet) use all of the newest features like nogc that are in DMD 2.066.)Yea i saw that thread in the LDC section and thats actually pretty cool that he produced an 88kb file. Im not too worried about the GC since ive been working with it my entire time from beginner till now. But, how would i configure dub and my dub.json to automatically use those LDC switches if it isnt automatically built into dub?
Aug 27 2014
On 8/28/2014 1:24 AM, Israel wrote:On Wednesday, 27 August 2014 at 09:23:57 UTC, Marc Schütz wrote:But, how would i configure dub and my dub.json to automatically use those LDC switches if it isnt automatically built into dub?You can pass compiler-specific flags by adding a "dflags" entry to your dub.json. Likewise, "lflags" is for the linker. See [1]. [1] http://code.dlang.org/package-format#build-settings --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com
Aug 27 2014
On Tuesday, 26 August 2014 at 23:36:44 UTC, Israel wrote:I wasnt paying any attention to the file size of my binaries when i started using D. My first program is simple and compiles at 486kb, which honestly, is kind of absurd but anyways, after i start adding other imports it ran all the way up to 4.5mb. what i want to ask is, what exactly is happening to my binary when all i do is import various modules?You can see what's taking up space by upload a .map file here: http://thecybershadow.net/d/mapview/
Aug 26 2014