This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: main() static/dynamic
- From: wmglo at dent dot med dot uni-muenchen dot de
- To: roland at redhat dot com
- Cc: stinger at drenik dot net, libc-alpha at sources dot redhat dot com
- Date: 15 Sep 2003 09:26:49 -0000
- Subject: Re: main() static/dynamic
- References: <200309122030.h8CKUk027883@magilla.sf.frob.com>
Hi,
> The big cause of static bloat I am aware of is that malloc brings in all of
> stdio because of being compiling into one file instead of several.
I have just recently worked on this, and got at least malloc_stats to
compile in a separate file. It is a rather big (although
straightforward) patch.
However, this is not yet the complete solution, because of the
debugging hooks code, which also uses stdio. One would have to cut
out functionality, i.e. use
#if SHARED
s = getenv("MALLOC_CHECK_");
if(s) {
if(s[0]) mALLOPt(M_CHECK_ACTION, (int)(s[0] - '0'));
__malloc_check_init();
}
#endif
etc., if the static version was to do completely without stdio. To
state it more clearly, debugging functionality of the shared and
static libc would differ.
Also, Uli's recent patch:
* malloc/malloc.c (_int_free): Add cheap test for some invalid
block sizes.
would have to be modified, too.
Personally, I dislike static linking, and am not yet convinced all
this is worth the effort. Or is it?
Regards,
Wolfram.