This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: libffi on Cortex M4?
- From: Richard Henderson <rth at redhat dot com>
- To: Tor Krill <tor at openproducts dot com>, libffi-discuss at sourceware dot org
- Date: Mon, 14 Sep 2015 12:07:26 -0700
- Subject: Re: libffi on Cortex M4?
- Authentication-results: sourceware.org; auth=none
- References: <1442256188 dot 3397 dot 27 dot camel at openproducts dot com>
On 09/14/2015 11:43 AM, Tor Krill wrote:
> Dear list,
>
> I'm trying to crosscompile libffi for a Cortex-M4 platform running
> uClinux but this fails miserably during compilation with a:
>
> ../src/arm/sysv.S: Assembler messages:
> ../src/arm/sysv.S:152: Error: selected processor does not support ARM
> opcodes
> ../src/arm/sysv.S:154: Error: attempt to use an ARM instruction on a
> Thumb-only processor -- `stmfd sp!,{r0-r3,fp,lr}'
> ../src/arm/sysv.S:156: Error: attempt to use an ARM instruction on a
> Thumb-only processor -- `mov fp,sp'
> ../src/arm/sysv.S:161: Error: attempt to use an ARM instruction on a
> Thumb-only processor -- `sub sp,fp,r2'
>
> My question is simply, is thumb2 on a cortex m4 supported by libffi?
> I.e. is it my build setup that is faulty and this should work or is this
> unsupported?
Thumb2 is supported, but I think you'll find that the M4 is thumb1, which isn't.
We normally expect to have the assembly bits for libffi compiled for arm32 and
use interworking to let the C bits be built for thumb1. In order to support a
thumb1 only core would require significant work.
r~