This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: static executable bloat


Andreas Schwab wrote:
> 
> --=-=-=
> 
> Zack Weinberg <zack@bitmover.com> writes:
> 
> |> I spent a lot of time today bashing at this, but there is no easy fix.
> |> I guess this is just a "libio should be smaller" whine.  Note that an
> |> awful lot of places in there know when a stream is wide; it seems to
> |> me that this ought to be hidden in the jump table.  There's no reason
> |> why not to redirect _IO_setb instead of having _IO_setb and _IO_wsetb,
> |> for example.
> 
> The wide stream stuff isn't actually that big.  I was only able to reduce
> the size by about 8.3K by leaving out the wide stream support (see the
> attached patch for how I did that).  The rest from libio is mostly the
> printf stuff that is pulled in by malloc.
> 
> A much bigger problem is the gconv stuff, which is indirectly referenced
> in strtol via btowc.  The biggest single object file that is included is
> regex.o, which is referenced by gconv_db.c.  I don't see a way to reduce
> this.

It's fairly easy to prevent strtol from referencing btowc, and I think
the change is permissible by the standard.  You just use 
_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP) directly unless compiling
wcstol and friends.

But if you do that, you find that stdio does the same sort of thing
all over the place - mainly in the wide stream support, which is why I
was grousing about them, but printf too.  You might look at
wcsmbsload.c, that seems to be the trigger for the inclusion of gconv.

zw

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]