[uClibc]compiling lshw with uClibc

Roland Nagtegaal roland at lorentz.leidenuniv.nl
Mon Mar 24 15:21:28 UTC 2003

On Fri, Mar 21, 2003 at 12:51:58PM -0700, Erik Andersen wrote:
> If you _really_ want to compile your own C++ toolchain, go here
>     http://uclibc.org/cgi-bin/cvsweb/toolchain/
> click on "Download tarball" and then you can compile your own.
> Unless you really know what you are doing though, I do not
> recommend you make your own.  I think you should grab
>     http://www.uclibc.org/downloads/root_fs-i386.bz2
> and compile the things you need using that, which will let you
> easily see how big things are with uClibc.

I already did that, but lshw does not compile with the toolchain
that comes with root_fs-i386.bz2 .
So, the libstd++ in root_fs-i386.bz2 is not good to compile lshw. So
my question really is where do I get libstd++ (gnu.org ?) and how do I
compile it within root_fs-i386.bz2 ?

> The Linux kernel does not use any C library.  But you can use a
> uClibc toolchain to compile the kernel.
> You probably did not strip your ls binary to remove debugging
> symbols.  Generally, binaries compiled with uClibc are either
> the same size or smaller than when compiled using glibc.

It is stripped, I checked that of course. But the redhat library dependancies
are much heavier.

This is when I'm chrooted in "root_fs-i386.bz2":

[root at bosch /]# ls -al /bin/ls
-rwxr-xr-x    1 root     root        77196 Mar 21 05:33 /bin/ls*
[root at bosch /]# strip /bin/ls
[root at bosch /]# ls -al /bin/ls
-rwxr-xr-x    1 root     root        77196 Mar 24 07:57 /bin/ls*

... and this is in plain redhat 7.3:

[root at bosch roland]# ls -al /bin/ls
-rwxr-xr-x    1 root     root        46888 Mar 25  2002 /bin/ls

the uClibc compiled /bin/ls depends on:
[root at bosch /]# ls -al /lib/libuClibc-0.9.19.so /lib/ld-uClibc-0.9.19.so 
-rwxr-xr-x    1 root     root        16844 Mar  6 11:34 /lib/ld-uClibc-0.9.19.so*
-rw-r--r--    1 root     root       244300 Mar  6 11:34 /lib/libuClibc-0.9.19.so

... and the redhat 7.3 one depends on:

[root at bosch roland]# ls -al /lib/libtermcap.so.2.0.8 /lib/libc-2.2.5.so /lib/ld-2.2.5.so 
-rwxr-xr-x    1 root     root        89547 Oct 10 16:58 /lib/ld-2.2.5.so
-rwxr-xr-x    1 root     root      1260480 Mar 24 16:00 /lib/libc-2.2.5.so
-rwxr-xr-x    1 root     root        11832 Jul 10  2001 /lib/libtermcap.so.2.0.8

So, the uClibc version of ls is actually bigger, but the redhat version depends
on much bigger libraries. So the uClibc version would use 5 times less space
on my disk.

-- Roland Nagtegaal

More information about the uClibc mailing list