[RFC] Proof-of-concept for netlink listener for mdev -i
Laurent Bercot
ska-dietlibc at skarnet.org
Sun Mar 15 00:22:35 UTC 2015
On 14/03/2015 20:23, Rich Felker wrote:
> Could you elaborate on how you measure that? With musl only the parts
> of stdio you actually use will be linked, and use of exit does not
> result in linking of any additional code, since the startup code has
> to call exit(main(...)) anyway. In any case exit and its dependencies
> are tiny.
The die(), edie() and dbg() functions/macros in the example use printf
format strings and variable arguments, I assumed they are built around
a function of the printf family.
gcc 4.8.1, musl from 2014-12-23, Linux 3.10, x86_64.
$ cat nostdio.c
#include <unistd.h>
int main (void)
{
write(1, "Hello World!\n", 13) ;
return 0 ;
}
$ gcc -O2 -static -o nostdio nostdio.c && strip nostdio
$ wc -c nostdio
2952 nostdio
$ cat stdio.c
#include <stdio.h>
int main (void)
{
printf("%s!\n", "Hello World") ; /* avoids gcc magic */
return 0 ;
}
$ gcc -O2 -static -o stdio stdio.c && strip stdio
$ wc -c stdio
15224 stdio
That's almost 3 pages.
--
Laurent
More information about the busybox
mailing list