New target for libgloss

Paulo Eduardo Ferreira de Castro
Wed May 1 12:19:00 GMT 2002

Hello, all.

I intend to add support for the Leon processor in libgloss.
Leon is a MMU-less Sparc V8 compatible processor, similar to the
ERC32 processor which seems to be already supported by libgloss.
(More info about Leon in Adding support
for Leon means to include startup code to properly initialize
the on-chip UARTs, interrupt and memory controllers, as well as
providing inbyte() and outbyte() for I/O (maybe these functions
could be same as those already existent for ERC32 - I still have
to check that).

For now, my question is about the appropriate way of selecting
the Leon target in configure scripts. The first possibilities
that came to my mind were:

A.  ../configure --target=leon-elf
B.  ../configure --target=sparc-leon-elf
C.  ../configure --target=sparc-elf --with-cpu=leon

In all of the cross compiling FAQs and examples I've seen up to now,
the "--target" specification was the same for binutils, gcc and newlib.
So the possibilities A and B above would require proper treatment in
binutils and gcc packages, which is something I didn't want to bother

Hence it seems option C would be better. Am I right? Is that the
proper use for the "--with-cpu" option?

Looking at the "" file in the libgloss/sparc directory,
I've seen this comment:

# This is set to one of SPARC, SLITE, or SPLET by configure.
# It's not clear what to do here.
# One could certainly build everything.  The assembler supports all cpu
# variants (via runtime switches).  However, the compiler [currently] doesn't.
# Of course, it may be the case that there isn't any cpu specific code in
# C source files, but there might be in the future.

Does the value of that "CPU" variable come from the "--with-cpu" string?

If you have any other hints or advices to help me in the process of
porting libgloss to Leon, they will be extremely welcome.

Thanks a lot.

Paulo E. F. Castro
State University of Campinas, Brazil

More information about the Newlib mailing list