On 2010-12-03, Alan McKinnon <[email protected]> wrote: > Apparently, though unproven, at 00:37 on Saturday 04 December 2010, Grant > Edwards did opine thusly: > >> On 2010-12-03, David W Noon <[email protected]> wrote: >> > What you are seeing is a lot of glibc routines being included by the >> > linkage editor. These handle all sorts of conditions that will >> > likely never occur in your program. >> > >> > Try using a smaller C library, like uclibc or klibc. They might not >> > work as well, but they will give you a smaller executable. >> > >> > Alternatively, try rewriting your code in assembler. >> >> For various reasons (which I doubt anybody cares about), gritting my >> teeth and living with the 520K per application looks like a more >> practical solution that either using assembler or a different libc. >> >> In practice, I'm sure nobody but me will ever even notice (or care >> even if they did notice) the wasted 2MB on a 25MB liveCD. But it will >> still bug me. :/ > > That's 8% of your space resources.
It's closer to 0.5%. My space resources are 700MB on the CD and probably at least 512MB of RAM. Right now I'm using up about 22MB of the space on the CD, and less than that in RAM. By the time I'm done, it will probably be around 25MB. Anything that boots from a single CD in under 15 seconds and runs in 512MB of RAM or more will be fine. The difference between 23MB and 25MB really won't be noticable. > Many more than just you will notice and care and whinge loudly. > Probably including me. Well, I think you'd find it pretty useless no matter how small/fast it was. The only thing it's able to do is production test and diagnostics for a family of PCI boards I support. > It might be worth the effort to switch to a libc designed for the > sort of task you want to accomplish. I assume you already made the > effort with busybox or similar, it's much the same viewpoint. Sort of. I'm using busybox, but the "base" of my CD is generated by a shellscript that strips down a systemrescuecd ISO image to the bare essesntials (basically just what's required to run a 7MB initrd image containing busybox). Then I add my three or four static applications to that. We used to build our own CD from scratch, but that build process was fragile and hard to maintain. The CD doesn't even have network support or drivers for any block devices except a ramdisk (no SCSI, SATA, ATA, and so on). The only filesystem it supports is cramfs. I ripped out USB support also, but then had to put enough of it back in for the USB keyboards on some of the machines where it'll be used. It'll still bug me that those static apps are 90% bloat, but it's just not worth the effort to switch to uClibc or mess with putting my own dynamic libraries onto the CD. -- Grant

