Stdio redirection?

Thu Oct 5 16:05:00 GMT 2000

When doing a newlib build for h8300-hms, it says something like libgloss
is not supported for h8300-hms, and so does not install any libgloss
stuff. Being the first micro i've used with gcc, i didn't know what
should happen. I traced thru all the configure(.in) and makefiles
to work out how to add libgloss for the h8300-hms, but it was all
too complicated, even after reading porting.texi which looks like
a rough first attempt. I looked at other libgloss directories so
i could put the same thing in a hitachi libgloss directory, but
all the other micros had different files to each other, and i
couldn't work out how/if a should be modified to
get the new entries. Its also not obvious from looking at the
other libgloss directories what files are really required and
what aren't. To compound all that, i tried to work out if the
existing functions would need to be modified/deleted. I'll
have another go in a months time.

"Aaron J. Grier" wrote:
> On Thu, Oct 05, 2000 at 09:31:10PM +1000, Russ.Shaw wrote:
> > Kai Ruottu wrote:
> > >  Why you should care about this?  Just remove the low-level routines
> > > from all your libc.a's and provide your own glue libs with them inside.
> >
> > If i knew what the right low-level functions were, i would. However,
> > looking at stdio.h and the newlib sources, there's too many
> > conditional compilations controlled by variables from unknown places,
> > compounded by all the extra re-entrant library functions.
> all the bare-bones low-level interfacing is done in libgloss.  no need
> to wade through all of newlib.  I went through this routine when I
> started with a bare m68k-elf compiler for an in-house embedded system.
> it took me a while to get oriented, too.
> all the details are laid out in libgloss/doc/porting.texi.  stubs can be
> found in libgloss/libnosys.
> > I was going to add to libgloss myself, but there was not sufficient
> > information in the source docs, on the web, from newsgroups, or
> > mail-lists.
> after reading the "Embed with GNU" document, what's left?
> > I had not found anywhere that definitely said that those functions
> > were at the bottom level with all higher functions using them. A
> > message by j.johnston referred to a build-time way that suggests these
> > functions, by modifying etc (i'm still getting around to
> > trying it).
> I never worried about it at build time -- since it's easy enough to
> change linker scripts to link in whatever you need, and you can drive
> yourself crazy dealing with autoconf / automake.  I built an external
> libgloss and crt0, and linked 'em in by hand/makefile.
> > I wire-wrapped my own system and didn't want to add more variables by
> > using a monitor. I'd be completely happy if there was a
> > straight-forward obvious method for doing the low-level functions,
> > knowing that nothing will get broken. And it should be stated
> > prominantly in docs such as 'using gcc' or similar.
> all there in libgloss/doc/porting.texi.  even information on writing a
> gdb back end.  I'm surprised nobody's mentioned it.  it was one of the
> first documents I stumbled upon.
> here's an online version:
> of special interest to you will be the section on porting newlib:
> happy hacking.

*   Russell Shaw, B.Eng, M.Eng(Research)  *
*      email:          *
*      Victoria, Australia                *

More information about the Newlib mailing list