[PATCH] libc: arm: setjmp jmp_buf exagerated size

Richard Earnshaw Richard.Earnshaw@foss.arm.com
Wed Feb 15 16:12:04 GMT 2023



On 15/02/2023 11:09, Bernhard Krug wrote:
> Patch sets correct jmp_buf size for armv6-m conforming to implementation in setjmp.S
> 
> FYI a table of cortex architectures:
> __ARM_ARCH_6M__ cortex-m0/m0+/m1 no fpu option
> __ARM_ARCH_7M__ cortex-m3 no fpu option
> __ARM_ARCH_7EM__ cortex-m4 optional fpu
> check using __ARM_FP

I don't think it's as simple as this.  The ABI supports three variants, 
two of which are call compatible.

hard-float (where you must have hardware FP)
soft (where you haven't got any hardware FP)
softfp (where you have hardware FP but need to inter-operate with code 
that doesnt).

soft and softfp are call compatible and so any jump-bufs created need to 
support saving and restoring the FP context.

I guess a configure-time option to disable support for softfp might be 
an option, but the default needs to ensure things are compatible.

R.


More information about the Newlib mailing list