Re: Problems with Newlib built with Clang for Cortex-M

"Keith Packard" <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
"Richard Earnshaw (lists)" <[email protected]> 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
signature.asc (application/pgp-signature, 832 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAlvZvsQACgkQ2yIaaQAA
ABGFVA/8CrIrgHQvpB6RQv6cFoHfPLXftz2WzZ8dF/mW9sahQEL8OnNr4GuoPhR0
FB5FzEGVbJMdO9R6pouvOahtiH8CmVEU1mU2xEU9H4mEoDy2QIzHlT6r4SnYwv0J
NVCnLvC/m3qKiZYCsNr7OFp2xI/9NfiNfdMcX+ZHWNbTD6chIg1WzxkvKgFz+Rh+
Qa5Mzi/PT4sMzoBenn2UVnwMyOcfUAHzY+kzvv8T/EjhBU/nQ4Igb33MFW3lfOEF
zLKB6tG0y7qykHn15AwXKsmPSo7+O/29LdprBjaWERA1NzD+bg+ulmoD+iI7Gk06
e1V71iTaLW2bdG/P96BAqvLirGzK647uSEKFGgkzl+vyyDg+Ql3Og+bieoTlLDUs
ShJd9/whm2fg9ocY3wU+NJ8+USewYm0qLBwTgBIHrtQHeVKEz57wXdtKUhX1KKfb
NLQBvsJCvyXqT8ND1dRikpCFbqLBmQFtfsYGgy4wUM7L/4KCjyGfYZATe16Vhupq
82ZXuULoy0Fh0qycc/uS7HHgfKOEiF1vfxnLEKblLVdrwakkAOWSHbDPA/T7NZt3
4EhVqPZEgMUOFJR9+ZO2T4EepruCBBJCHMUTNy1j6wlmkKRONlYZ1lU/NKeDuUZO
unen/0LLSQ2GInapyMOGQBBlLp76U9/KnlBR3USqeuGQBd4or1w=
=7asu
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.