[phobos] large object files and binaries

Walter Bright walter at digitalmars.com
Tue May 3 15:13:18 PDT 2011



On 5/3/2011 1:32 PM, Michel Fortin wrote:
>
> DMD emits code in a special "multiobj" mode when using the -lib switch. I had to disable this in my Objective-C-aware branch of the compiler because it didn't play well with Objective-C class definitions (maybe I could make it work, but I have more pressing things to do).
>
> Now, I observe that Phobos compiled with my modified DMD makes 2501452 bytes, whereas the one that comes bundled with DMD makes 6646800 bytes... Granted, it's not exactly the same version of Phobos and druntime (I'm probably a little behind but with a few things added to my druntime branch), but the stunning difference leads me to believe "multiobj" might be the cause for this difference in size.

The size of libphobos.a has *nothing* to do with the size of an executable 
linked with Phobos.

Multiobj will increase the size of the library simply because there's a lot of 
bookkeeping overhead for each .o file - overhead that does not go into the 
executable.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20110503/d951f2e4/attachment.html>


More information about the phobos mailing list