Building an old uClibc version with gcc

Lennart Sorensen lsorense at csclub.uwaterloo.ca
Tue Aug 23 13:10:25 UTC 2011


On Tue, Aug 23, 2011 at 07:12:39AM +0200, Laurent Bercot wrote:
> > I understand about static/dynamic linking, but would prefer dynamic to keep
> > memory usage down
> 
>  You are falling for a widespread myth.
> 
> 1. Build a static tcpsvd+httpd busybox with an Aboriginal Linux toolchain.
> 2. Run it, with 40 simultaneous client connections to the web server.
> 3. Use the 'memstat' utility to report how much memory you are using.
> 4. Be amazed at your low memory usage.
> 
>  If you insist on linking your applications dynamically to save memory,
> fine, but you *will* have to link them against the version of uClibc that
> is on your system, so you *will* have to manually build a toolchain for
> that version. That is a lot more effort for a very small benefit.

Yeah certainly with busybox and other multicall binaries, once you have
one in memory the rest only need a new copy of the read/write data,
not the code.

I remember years ago working on HP-UX 9, which didn't have dynamic
libraries.  Everything to do with X11 on the system was linked into
one binary.  Took quite a while to load X at boot, but starting xterm's
and calling other X utilities were instant and took practically no memory
since the X server was already loaded and was the same binary.  Too bad
for other applications that wanted to use X.  They got to pay the full
price for the X libraries themselves.

On the uclibc system I work with I have been combining related binaries
into single binaries to same memory.  Works rather well.

-- 
Len Sorensen


More information about the uClibc mailing list