Compiler: Size of generated executable file

Leandro Lucarella llucax at gmail.com
Tue Jan 12 17:13:36 PST 2010


Adam D. Ruppe, el 12 de enero a las 18:29 me escribiste:
> On Tue, Jan 12, 2010 at 11:12:33PM +0000, retard wrote:
> > If they all used static linking, I'm afraid I would have to 
> > buy another 32 GB ssd disk only for the binaries.
> 
> Yes, for large numbers of application, shared libraries save a lot of space.
> 
> Though, what I was saying is if you have only one application using the
> library, static linking actually saves space. A shared lib needs to keep
> functions around just in case - a static link doesn't.
> 
> I'm generally for static linking anything that isn't part of the base OS
> install, just to ease the process for end users. I'd ideally like to see
> a statically linked application that is also small - improvements to the
> compiler and linker still have some potential here.

What about security updates. If you, for example, use OpenSSL in
a program, an you link it statically, then the user is condemned to have
a vulnerable program when an OpenSSL security bug is found until you give
him a new binary. That is a lot of trouble for you and the user.

If you use dynamic linking, the user just need to keep its system updated
to avoid this kind of issues, and you only need to care about new release
when the bugs are really from your program, not third-party libraries.

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Sometimes you got to suffer a little in your youth to motivate you to
succeed later in life. Do you think if Bill Gates got laid in high
school, do you think there'd be a Microsoft? Of course not. You gotta
spend a lot of time stuffin your own locker with your underwear wedged
up your arse before you think "I'm gona take over the world with
computers! You'll see I'll show them."



More information about the Digitalmars-d mailing list