public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Maxim Kuvyrkov <maxim@codesourcery.com>
To: Jan K <jprofesorek@o2.pl>
Cc: <gcc-help@gcc.gnu.org>
Subject: Re: Bare metal ARM Cross compiler - aeabi auto-generated functions for cortex-m0 use wrong instruction set
Date: Tue, 04 Dec 2012 02:54:00 -0000	[thread overview]
Message-ID: <86414196-D2BC-4DFC-A25D-DF3DFD007898@codesourcery.com> (raw)
In-Reply-To: <500b56a9.5ca9268d.50bb722e.3c885@o2.pl>

On 3/12/2012, at 4:22 AM, Jan K wrote:

> Hi!
> I'm trying to get the cross-toolchain for cortex-m0 working. The target is arm-none-eabi.
> The gcc has no problem compiling my code using allowed instructions only. As long as I do not try to use / or % my code runs as expected.
> When I try to divide, GCC uses and appends ARM runtime ABI functions (which is correct, since m0 has no hardware division op).
> The problem is that included functions (in particular: __aeabi_idiv) use instructions that are _not_ part of the cortex-m0 instructions set (like lsleq, movne, rsbmi).
> I compile and link the code with '-mcpu=cortex-m0 -mthumb' flags.
> What I want to is to force gcc to include the ARM runtime ABI functions that work with cortex-m0.
> How can I get it working? Am I missing something? Is it anyhow possible?

How libgcc (and other GCC libraries) are compiled is defined by multilib flags.  It appears that the default multilib for the compiler that you built is not "-mcpu=cortex-m0" (probably, it's something ARMv4-ish).

For a quick fix try adding --with-arch=cortex-m0 to GCC configure line.

--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics

  parent reply	other threads:[~2012-12-04  2:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-02 15:22 Jan K
2012-12-03  0:00 ` Chris Johns
2012-12-04  2:54 ` Maxim Kuvyrkov [this message]
2012-12-04 15:26   ` jprofesorek

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=86414196-D2BC-4DFC-A25D-DF3DFD007898@codesourcery.com \
    --to=maxim@codesourcery.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jprofesorek@o2.pl \
    /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).