Do I need modify newlib code for endian changed?

Schwarz, Konrad
Mon Jul 25 11:28:00 GMT 2011

> > Liu is asking if *newlib* needs to be modified, not if his
> > *own* code needs adaptation.
> Generally speaking: yes, there are piece in newlib which 
> require to be modified for endianness when adding a new target.
> Whether and how *he* will have to modify newlib would depend 
> up his target and how it is implemented.
> > I expect newlib source code to be cogniziant of endianess.
> Most pieces of newlib are independent of a target's 
> endianess, but there are (few) pieces which need to know 
> about endianness.
> In most occasions, these pieces receive their setting through 
> preprocessor defines emitted by GCC.

Isn't that what I just wrote?  Liu doesn't need to change
any source code in *newlib* but does need to recompile it with
the proper configuration -- just as he recompiled gcc and binutils.

He is not adding a new target, otherwise he wouldn't be asking
this question (after adding a new target to gcc and binutils),
merely switching from one existing target to a different one.

More information about the Newlib mailing list