This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Simple cross-compiler for PowerPC


Rosetti:

On Mon, May 06, 2002 at 03:08:13PM +0200, Rosetti Andrea wrote:
> We use "vsprintf" function defined in libc.a (newlib) and we need
> need also "isatty" function that is called from vsprintf().
> This function is defined in various library (i.e. libads.a, libnosys.a,
> libyk.a,..). Which of them is correct one?
> Is there anywhere any document about these libraries and
> differences between them?

Honestly, I lose track of them myself.  :^)

I have an article at billgatliff.com that talks about porting newlib,
maybe that'll help make it easier to navigate the sources.

The idea with all those libraries is that they're pre-port work for
various newlib-supported targets.  Libnosys tries to provide a
do-nothing layer that lets newlib be as functional as possible with no
additional work on your part.  In the SH version, for example, most of
the libnosys implementations call __trap34; I include a trap34 handler
in my code to catch.  The ARM version uses the SWI opcode, which on an
unadorned, Angel-compliant system will invoke the debugging agent and
make things like printf() et al show up on the debugging console
instead of somewhere else (or nowhere).

If you want to see what's going on in a library, use objdump:

$ powerpc-eabi-objdump --source (or --disassemble) <libname> | less

If a preexisting implementation of the newlib stubs (libnosys, libads,
etc.) doesn't do what you want, then you just roll your own as
described in the aforementioned article.  The only exception is that I
usually just hook into whatever facilities the libnosys-style
implementation provides (trap34, SWI) instead of coding directly up to
the newlib interface.


HTH,

b.g.
-- 
Bill Gatliff
bgat@billgatliff.com

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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