Linux vs. libio

Geoff Keating geoffk@envy.cygnus.com
Sun Dec 19 21:53:00 GMT 1999


Mark Mitchell <mark@codesourcery.com> writes:

> Folks --
> 
>   Does anyone know how, on Linux, to build the libio (in CVS with GCC)
> in such a way as to be entirely disentangled from the C library?
> (Except in the ways that libio would normally be entangled with the C
> library on any non-glibc system.)
> 
>   In particular, we're working on the new C++ ABI.  That requires some
> changes to libio to deal with different class layouts, etc.  That's
> mostly working, but the stdio functions in glibc have a bad tendency
> to call functions in the modified libio as callbacks, and those
> functions now behave differently than glibc expects.

I think this is a sign that you cannot change libio like that.  These
routines are interfaces between glibc and libio.  Yes, I know, it's
evil, but it's no worse than libgcc which is the same (ever heard of
__register_frame_pointer?).

It may be that you will have to change glibc to be compatible with the
new layout.  You've already changed glibc to be compatible with the
new EH so you will be requiring a new version of glibc anyway.

>   In other words, what I'm looking to do is to have two distinct,
> disentangled, copies of libio: one in libc, to handle stdio, and one
> in libstdc++ to handle iostreams.  How can this be done?

You don't want to do that.  It would cause C stdio and C++ iostreams
to be buffered separately causing output to be interleaved wrongly.
It would also break the nice stdio/iostreams interface that took so
much work to get right.

-- 
- Geoffrey Keating <geoffk@cygnus.com>


More information about the Libc-alpha mailing list