uClibc++ version 0.1.12 released

Rob Landley rob at landley.net
Mon Dec 12 10:29:32 UTC 2005


On Sunday 11 December 2005 04:34, Peter S. Mazinger wrote:
> I don't see a good reason to split it, the lib is small enough already, My
> tests show that the apps won't get much smaller by the small lib as in
> case of uClibc (an  "incorrect" comparison: firefox 41 MB glibc+libstdc++,
> 39 MB uClibc+uClibc++) and there are not so many small C++ apps around,
> rather bigger projects where the size of this lib won't matter

C++ is a language that encourages bloat.  (Template instantiation and 
exception handling are both _designed_ to block copy trivial variations of 
the same code over and over into the resulting binary.)

That said, it is possible to produce semi-sane binaries with C++ if you pay 
attention to size.  I did it, years ago, back when I still thought C++ was a 
good idea.  (That would be about 1992-1995.)

Konqueror is a 3k executable that links to 40 shared libraries (sigh) but you 
can get the list with "ldd /usr/bin/konqueror | awk '{print $3}' | xargs ls 
-lHS", and the two main ones are libkonq (500k) and libkdeinit_konqueror 
(800k).  If you only needed the 500k that would be a pretty streamlined web 
browser.  1.3 megs is less so, but still far ahead of mozilla.

Of course the fact that Konqeuror then links to the rest of kde, which sucks 
in libqt-mt (7 megs), libkio (3.3 megs), libkdeui (2.9 megs), libkdecore (2.2 
megs), libc (1.2 megs), and so on down the list...  Well, that's deeply 
unfortunate, but probably not actually _required_.  (I'm under the impression 
Safari was Konqeror ported off of KDE and QT.  Perhaps the above figures help 
make sense why Apple would want to do that.)

Lots of people out there want to use C++ anyway, and it is possible to use C++ 
to produce reasonably sized binaries, with a little effort.  (To start with, 
don't use templates ever for anything, and disable exception handling.)

So the question to ask is, if somebody wants to write C++ apps for use in the 
embedded space, and is paying attention to size when they write the app, is 
there anything we can do to help?  (Having first ruled out psychiatric care 
or liberal application of holy water to their computer's power supply.  I 
suppose that's depending on your definition of the word "help", really...)

Rob
-- 
Steve Ballmer: Innovation!  Inigo Montoya: You keep using that word.
I do not think it means what you think it means.



More information about the uClibc mailing list