public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Tor Krill <tor@openproducts.com>
To: Richard Henderson <rth@redhat.com>, libffi-discuss@sourceware.org
Subject: Re: libffi on Cortex M4?
Date: Tue, 15 Sep 2015 11:52:00 -0000	[thread overview]
Message-ID: <1442317918.3927.23.camel@openproducts.com> (raw)
In-Reply-To: <55F71AEE.50004@redhat.com>

Hi Richard and others,

Thank you for a prompt and good answer!

On mån, 2015-09-14 at 12:07 -0700, Richard Henderson wrote:
> 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}'
----8<----------------------
> > 
> > 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.

Now i actually get a bit confused. Excuse me for my lack of low level
arm core knowledge. But Arm says that the Cortex M4 should be Thumb2,
albeit Thumb2 only if i understand correctly.

http://www.arm.com/products/processors/cortex-m/cortex-m4-processor.php

Further more, when i read up on the Cortex M4 users manual it seems like
the assembler instructions i get an error on during build is actually
supported by the cpu. I.e. the stmfd.

Could it be that i have a toolchain problem? (I use a somewhat old gcc
from "Sourcery", Sourcery G++ Lite 2010q1-189 4.4.1)

Best!

/Tor


      reply	other threads:[~2015-09-15 11:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-14 18:43 Tor Krill
2015-09-14 19:08 ` Richard Henderson
2015-09-15 11:52   ` Tor Krill [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442317918.3927.23.camel@openproducts.com \
    --to=tor@openproducts.com \
    --cc=libffi-discuss@sourceware.org \
    --cc=rth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).