public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christophe Lyon <christophe.lyon.oss@gmail.com>
To: Gary Oblock <gary@amperecomputing.com>
Cc: Jonathan Wakely <jwakely.gcc@gmail.com>,
	Gary Oblock via Gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Anybody ever got an ARM Thumb-2 cross compiler to work?
Date: Thu, 16 Jun 2022 09:45:54 +0200	[thread overview]
Message-ID: <CAKhMtSL4bZkiEVU3CWHwyxf1KFUZJmfBawe6Ay1JpJewsbXrkQ@mail.gmail.com> (raw)
In-Reply-To: <BYAPR01MB54648970BDB00E26881C6F43C6AC9@BYAPR01MB5464.prod.exchangelabs.com>

Hi Gary,

Sorry, your request is not entirely clear to me either.
IIUC what you want to achieve has been working for decades and is certainly
not obsolete :-)

If you don't need to build such a toolchain, you can download pre-built
binary toolchains from Arm for instance:
https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain#Technical-Specifications

If you want to build a cross toolchain, it's not straightforward but very
well supported. I think there are already plenty of
documentation describing how to do that.

The important thing is to get the right target triplet when configuring
your toolchain, you want something like arm-eabi or arm-linux-gnueabi, as
opposed to aarch64*.

Once the build has completed, when using the compiler make sure to generate
code for an architecture/cpu that actually supports Thumb-2 (via
-march=XX/-mcpu=XXX), and use -mthumb, as it's generally not the default.

Christophe


On Thu, Jun 16, 2022 at 9:11 AM Gary Oblock via Gcc-help <
gcc-help@gcc.gnu.org> wrote:

> Jonathan
>
> By off the shelf, I mean not creating a new target description file.
> Something
> which I'm not at all experienced in (optimizations are my thing so I'm an
> amateur at creating a cross-compiler.)
>
> I can't seem to figure out what the binutils or the gcc target is for
> Thumb-2.
> If you know, please let me know. I suspect that is an obsolete target
> that no longer exists for the latest binutils and GCC 12.
>
> Thanks,
>
> Gary
>
> ________________________________
> From: Jonathan Wakely <jwakely.gcc@gmail.com>
> Sent: Wednesday, June 15, 2022 11:31 PM
> To: Gary Oblock <gary@amperecomputing.com>
> Cc: Gary Oblock via Gcc-help <gcc-help@gcc.gnu.org>
> Subject: Re: Anybody ever got an ARM Thumb-2 cross compiler to work?
>
> [EXTERNAL EMAIL NOTICE: This email originated from an external sender.
> Please be mindful of safe email handling and proprietary information
> protection practices.]
>
>
>
> On Thu, 16 Jun 2022, 00:18 Gary Oblock via Gcc-help, <gcc-help@gcc.gnu.org
> <mailto:gcc-help@gcc.gnu.org>> wrote:
> The subject line says it all...
>
> I'm beginning to think off the shelf gcc cross compilers are impossible
> to create because of binutils.
>
> Why?
>
> What do you mean by "off the shelf"?
>
> At other companies we for the most part
> created custom assemblers, loaders and libraries from scratch
> when we built a gcc cross compiler.
>
> Why can't you just build a cross binutils too?
>

  reply	other threads:[~2022-06-16  7:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 23:17 Gary Oblock
2022-06-16  6:31 ` Jonathan Wakely
2022-06-16  7:11   ` Gary Oblock
2022-06-16  7:45     ` Christophe Lyon [this message]
2022-06-16 21:06       ` Gary Oblock
2022-06-17  7:25         ` Christophe Lyon

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=CAKhMtSL4bZkiEVU3CWHwyxf1KFUZJmfBawe6Ay1JpJewsbXrkQ@mail.gmail.com \
    --to=christophe.lyon.oss@gmail.com \
    --cc=gary@amperecomputing.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.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).