[uClibc]compiling lshw with uClibc

Allan Clark allanc at sco.com
Fri Mar 21 17:19:49 UTC 2003


Roland;

When comparing the "size" of a binary, such as "ls", add up the things
it needs to run.  uClibc gains from being a small SHARED LIBRARY.

1) ls -al your ls command

> rabbit:~ # ls -al /bin/ls
> -rwxr-xr-x    1 root     root        68524 Oct 16 09:01 /bin/ls

2) ldd your ls command, see the libraries it needs

> rabbit:~ # ldd /bin/ls
>         librt.so.1 => /lib/librt.so.1 (0x40024000)
>         libacl.so.1 => /lib/libacl.so.1 (0x40035000)
>         libc.so.6 => /lib/libc.so.6 (0x4003c000)
>         libpthread.so.0 => /lib/libpthread.so.0 (0x4015c000)
>         libattr.so.1 => /lib/libattr.so.1 (0x40171000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

3) add up all those sizes -- all of them are needed to use "ls"

> ls -al /bin/ls /lib/libc.so.6 /lib/librt.so.1 /lib/libacl.so.1.0.3 /lib/libpthread.so.0 /lib/libattr.so.1.0.1 /lib/ld-2.2.5.so | \
> awk '{print $5" "$9; sum += $5} END {print sum}'
> 68524 /bin/ls
> 86441 /lib/ld-2.2.5.so
> 25238 /lib/libacl.so.1.0.3
> 9429 /lib/libattr.so.1.0.1
> 1321674 /lib/libc.so.6
> 106013 /lib/libpthread.so.0
> 33743 /lib/librt.so.1
> 1651062

So we show that it takes 1.6 MB to run "ls"; that can't even fit on a
floppy.

repeat on a uClibc version

Allan


Roland Nagtegaal wrote:
> 
> Hello,
> 
> as I'm new to uClibc, let me introduce myself:
> I am Roland Nagtegaal, and I work as a system admin at the university of
> Leiden, Netherlands (physics department).
> 
> I was working on a mini-linux distro, to fit on a floppy.
> 
> It must contain the kernel, busybox, scp, and lshw, and possibly enough
> of the uClibc libraries to make them run.
> 
> My problem is that I can't compile lshw under uClibc. For that, I need
> to compile libstd++ first.
> 
> 1. So, my first question is: is there a simple way to compile libstd++ ?
>    I searched the mailinglist, but that did not help me much...
> 
> 2. How do I compile the linux kernel with uClibc ? I ran make bzImage,
>    but the executable was only 16KB. Too small, even with uClibc
>    (and it didn't run of course). make zImage also fails, and make
>    vmlinux works, but gives a 2.5MB file.
> 
> 3. uClibc compiled binaries are not always smaller, it seems. For
>    instance: /bin/ls in the buildroot environment is 76KB, but on
>    redhat 7.3 it is 46KB (I did check it is not actaully a link to
>    busybox, it isn't). That is not a question, but what is the
>    norm? How much smaller are uClibc binaries usually?
> 
> Thank you,
> 
> Roland Nagtegaal
> 
>   ------------------------------------------------------------------------
>                        Name: signature.asc
>    signature.asc       Type: application/pgp-signature
>                 Description: This is a digitally signed message part
-------------- next part --------------
A non-text attachment was scrubbed...
Name: allanc.vcf
Type: text/x-vcard
Size: 318 bytes
Desc: Card for Allan Clark
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20030321/4f92efba/attachment.vcf 


More information about the uClibc mailing list