This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


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: Problems with Newlib built with Clang for Cortex-M


"Richard Earnshaw (lists)" <Richard.Earnshaw@arm.com> writes:

> These sound like your stack is not correctly aligned: a common symptom
> of failing to do this is that calls to the printf family fail when
> 64-bit sized items (like double) are passed.  The EABI requires 64-bit
> alignment at all function boundaries (and 32-bit alignment at all other
> times).

I ran into this with one embedded platform that wasn't aligning the
initial thread stack on 64-bit boundaries. The compiler was carefully
counting pushes/pops for non-varargs functions, but varargs was
computing the rounding and because the initial stack point was
mis-aligned, everything "worked" except for 64-bit (double) values to
printf which got fetched from the wrong address.

-- 
-keith

Attachment: signature.asc
Description: PGP signature


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