The short version...
What is the best way to reduce the size of an executable and the libraries it relies on???????
The moaning version...
Here's a typical example of what I mean.
I write a little app in C.
Let's say I want the app to print a bunch of info to the screen, work out the MD5 of a file, and maybe zip a file or two.
Compile the source, cool, the executable is about 30k. Great.
But there's no way you can run it without...
libc.so
libz.so
libmd5.so
Which... brings the total size of the app up to something ridiculous.
I've tried using strip to make the libraries smaller...
Big deal, libc is still almost 1Mb in size.
I've tried statically including the libraries during compile time...
Sheeeeeesh... the executable becomes larger than 1Mb.
I've tried using UPX to shrink the exe a bit.
Yeah right... sometimes the app just refuses to work, and besides, it's still way too big.
I'd think my problems would go away by using an older kernel version and therefor a smaller libc.
But then I sit with.... yeesh... forget this one...
Why would I want an old kernel anyway.
Besides, libc is not that much smaller anyway.
To add to my pain, what if I want to set up a VESA video mode to at least make it look cool while it's doing what it should.
"Sorry sir, that will be another 300k off your limit"
And of course, there's this one...
I take my app to my buddies PC, but he has an older set of libraries than me, or he doesn't have libmd5.
Or how about, my buddy doesn't have Linux installed.
Which is mostly the case.
No problem, I'll make a quick boot disk with everything on.
Oh no, wait, I can't, 'cause it's kernel 2.4.?, and the libc file is just way too big. Sorry.
I can go on, but i've moaned enough now...
All of this is very good in one way.
It's a good system.
Why have each bit of code store it's own printf code when you can have one global printf in a library somewhere.
No waste of space and no needless repitition of code.
You may also be thinking, why would I want to run my app on any other box, linux or non linux, anyway?
Well, me, personally, it's what I do.
I moaned a lot now.
It's not frustration, i'm just asking...
If someone can teach me how to keep the size down...
I'll take back all my moaning with a smile.
I really hope there is a way, 'cause then I can move over to the latest kernel and set of libraries.