Re: klibc - another libc?

H. Peter Anvin
2006-06-07T21:17:46Z

Followup to: <44869397.4000907@tls.msk.ru>
By author: Michael Tokarev <mjt@tls.msk.ru>
In newsgroup: linux.dev.kernel
>
> After several mentions of klibc recently, I want to ask a question.
>
> I understand all the kernel-mode cleanups -- moving initialization
> from kernel to user space is a very good thing.
>
> But the question really is: why yet another libc? We already have
> dietlibc, uclibc, glibc, now klibc... With modern kernel, initramfs
> will very probably contain quite some programs linked with glibc
> (modprobe/insmod, mdadm/lvm, etc; I highly suggest putting some
> minimal text editor like nvi there too, for rescue purposes) --
> so why not have an option to use whatever libc is available on
> the host platform?
>

You have that option just fine; if you build your own initramfs you
can do whatever you want.

> In the other words, kinit/ipconfig/nfsmount/etc stuff is ok,
> no questions. But the libc itself -- what for?

To be able to *require* it, which means it can't significantly bloat
the total size of the kernel image. klibc binaries are *extremely*
small. Static kinit is only a few tens of kilobytes, a lot of which
is zlib.

> And another related question: why not dietlibc which is already
> here, for quite long time?

- Bigger by an order of magnitude
- License issues
- Platform support
- Speed of portability (klibc is fully portable to a new platform in an afternoon)
- Additional issues which you can find if look through the archives of this list

-hpa