From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110800 invoked by alias); 15 Sep 2015 11:52:06 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 110777 invoked by uid 89); 15 Sep 2015 11:52:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.5 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: smtprelay-h31.telenor.se Received: from smtprelay-h31.telenor.se (HELO smtprelay-h31.telenor.se) (213.150.131.4) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 15 Sep 2015 11:52:04 +0000 Received: from ipb5.telenor.se (ipb5.telenor.se [195.54.127.168]) by smtprelay-h31.telenor.se (Postfix) with ESMTP id 5A83E24348 for ; Tue, 15 Sep 2015 13:52:00 +0200 (CEST) X-SENDER-IP: [85.230.101.174] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BODQAJBfhVPK5l5lVEGhkBgwlUab9ThS1KAoFBPRABAQEBAQEBBgEBAQFBP0EFg14BAQQjDwEjMwgDDgoCAiYCAi0MChQGAYhEAQg7tGuULwEBCAIggSKFEAWFOYUUgmmBQwWHMosCgyiHfYZSh1SKFodNOIQuPDMBhS+EegEBAQ X-IPAS-Result: A2BODQAJBfhVPK5l5lVEGhkBgwlUab9ThS1KAoFBPRABAQEBAQEBBgEBAQFBP0EFg14BAQQjDwEjMwgDDgoCAiYCAi0MChQGAYhEAQg7tGuULwEBCAIggSKFEAWFOYUUgmmBQwWHMosCgyiHfYZSh1SKFodNOIQuPDMBhS+EegEBAQ Received: from c-ae65e655.125-1-64736c10.cust.bredbandsbolaget.se (HELO tor-desktop) ([85.230.101.174]) by ipb5.telenor.se with ESMTP; 15 Sep 2015 13:51:59 +0200 Received: from localhost (localhost [127.0.0.1]) by tor-desktop (Postfix) with ESMTP id BAF454C00AC; Tue, 15 Sep 2015 13:51:58 +0200 (CEST) Message-ID: <1442317918.3927.23.camel@openproducts.com> Subject: Re: libffi on Cortex M4? From: Tor Krill To: Richard Henderson , libffi-discuss@sourceware.org Date: Tue, 15 Sep 2015 11:52:00 -0000 In-Reply-To: <55F71AEE.50004@redhat.com> References: <1442256188.3397.27.camel@openproducts.com> <55F71AEE.50004@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2015/txt/msg00088.txt.bz2 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