Re: Writing a custom libc
- From: "Levi Campbell" <levicc00123@xxxxxxxxx>
- Date: 31 May 2006 00:12:37 -0700
Eric Sosman wrote:
Ian Collins wrote:
Levi Campbell wrote:
where can I get the pieces needed to write a custom C library? I ask
because I'm working on a rather large set of libraries where the extra
stuff in glibc is a waste of space.
Eh? Not including stuff you don't use is the linker's job.
The linker isn't always up to the task. For example,
a program that never uses any of the <locale.h> functions
but uses <ctype.h> might drag in a whole bunch of the locale
machinery, because the <ctype.h> facilities are sensitive to
the locale changes the program will never perform. Also, the
use of shared libraries tends to make library inclusion an
all-or-nothing proposition -- although in this case, the amount
of space used in the entire system usually decreases even if
the amount "used" by a single program seems to be greater than
if it incorporated only the "necessary" functions.
If the O.P. has actually measured the amount of "extra
stuff" and found that it can't be tolerated (highly unlikely;
if he'd measured anything he'd probably have mentioned it),
there are a couple of possible strategies. First, he could
see whether his system supports "static linking," following the
model implicit in Ian Collins' post. If that's not enough, he
can get hold of the glibc source and start throwing things out
until he's got a smaller (maybe), less functional (surely), and
non-conforming (probably) library that works for his program
but for few others. And I bet it won't save him much, either.
--
Eric Sosman
esosman@xxxxxxxxxxxxxxxxxxx
You *do* realize you've given me the answer don't you? All I have to do
is write a new locale that can handle braille and patch the aclocal.m4
and Makefile to a) skip the threading and use sockets. b) use the
braille-enabled locale as the default.
thanks!
.
- References:
- Writing a custom libc
- From: Levi Campbell
- Re: Writing a custom libc
- From: Ian Collins
- Re: Writing a custom libc
- From: Eric Sosman
- Writing a custom libc
- Prev by Date: Re: Simplicity has a future
- Next by Date: Re: -Bstatic flag
- Previous by thread: Re: Writing a custom libc
- Next by thread: Re: Writing a custom libc
- Index(es):
Relevant Pages
|