Compiler: Size of generated executable file

retard re at tard.com.invalid
Tue Jan 12 19:07:43 PST 2010


Tue, 12 Jan 2010 21:57:06 -0500, Adam D. Ruppe wrote:

> On Tue, Jan 12, 2010 at 10:09:01PM -0300, Leandro Lucarella wrote:
>> In Linux, using a distribution, you have a pretty good change that
>> dynamic libraries are used by more than one program.
> 
> That's actually not true. I ran a program on my system a long time ago
> that ran ldd against everything in /bin, /lib, and all the various
> variants.
> 
> http://arsdnet.net/lib-data-sorted.txt
> 
> Notice that the *vast* majority of those libraries are used by only a
> handful of binaries on the system. Half has five or fewer users.
> 
> This is slightly biased by not counting dynamically loaded things; ldd
> only does statically requested shared libs. But I doubt that changes
> things significantly.
> 
> 
> Also note how at the bottom of the list, users go up quickly - the basic
> system libraries are used by a great many apps. Most everything else is
> pretty specialized though.

Yes, that's a bit unfortunate. The freedom of choice in Linux often leads 
to too many libraries. I have several libraries in my system that are 
basically rivaling technology. A monoculture sometimes feels more 
natural, but nobody likes it unless it suits their needs.

A more flexible option for distributing executables would be to allow 
both static and dynamic linking. Use dynamic libraries unless the use 
fails, in which case fallback to the statically provided library code. I 
don't know if this can be done with currently available tools.



More information about the Digitalmars-d mailing list