Do I need modify newlib code for endian changed?

Wed Jul 27 14:48:00 GMT 2011

On Mon, Jul 25, 2011 at 7:00 PM, Schwarz, Konrad
<> wrote:
>> > 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.

Schwarz and Ralf, thanks for your answer.
It sounds I need to check out the Openrisc newlib port, and I need to
study on ARM newlib port for endian-support implementation.


More information about the Newlib mailing list