public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christophe Lyon <christophe.lyon@arm.com>
To: joel@rtems.org
Cc: gcc@gcc.gnu.org
Subject: Re: Building Single Tree for a Specific Set of CFLAGS
Date: Thu, 28 Mar 2024 10:17:36 +0100	[thread overview]
Message-ID: <858d0b8f-2922-4d26-b3c3-a04fa31aa215@arm.com> (raw)
In-Reply-To: <CAF9ehCXjbReC4UgUf7_wBOAHLgeT==pSti1H-nwHMSKuGiXDtA@mail.gmail.com>



On 3/27/24 20:07, Joel Sherrill wrote:
> 
> 
> On Wed, Mar 27, 2024 at 3:53 AM Christophe Lyon via Gcc <gcc@gcc.gnu.org 
> <mailto:gcc@gcc.gnu.org>> wrote:
> 
>     Hi!
> 
>     On 3/26/24 22:52, Joel Sherrill via Gcc wrote:
>      > Hi
>      >
>      > For RTEMS, we normally build a multilib'ed gcc+newlib, but I have
>     a case
>      > where the CPU model is something not covered by our multilibs and
>     not one
>      > we are keen to add. I've looked around but not found anything
>     that makes me
>      > feel confident.
>      >
>      > What's the magic for building a gcc+newlib with a single set of
>     libraries
>      > that are built for a specific CPU CFLAGS?
>      >
>      > I am trying --disable-multlibs on the gcc configure and adding
>      > CFLAGS_FOR_TARGET to make.
>      >
>      > Advice appreciated.
>      >
> 
>     I would configure GCC with --disable-multilibs --with-cpu=XXX
>     --with-mode=XXX --with-float=XXX [maybe --with-fpu=XXX]
>     This way GCC defaults to what you want.
> 
> 
> Thanks. Is there any documentation or even a good example? I found
> --with-mode=[arm|thumb] but am having trouble mapping the others back
> to GCC options.

I don't know of any good doc/example.
I look in gcc/config.gcc to check what is supported.

> 
> I have this for CFLAGS_FOR_TARGET
> 
> "-mcpu=cortex-m7 -mthumb -mlittle-endian -mfloat-abi=hard 
> -mfpu=fpv5-sp-d16 -march=armv7e-m+fpv5"
> 
> I think that means...
> 
> --with-mode=thumb   for -mthumb
> --with-cpu=cortex-m7 for -mcortex-m7
> --with-float=hard         for -mfloat-abi=hard
> 
> That leaves a few options I don't know how to map.
> 
You can see that for arm:
supported_defaults="arch cpu float tune fpu abi mode tls"
so there's a --with-XXX for any of the above, meaning that there's no 
--with-endian (default endianness on arm is derived from the target 
triplet eg. armeb-* vs arm-*)

Also note that config.gcc checks that you don't provide both
--with-cpu and --with-arch
or --with-cpu and --with-tune

HTH,

Christophe

> --joel
> 
> 
>     Thanks,
> 
>     Christophe
> 
> 
>      > Thanks.
>      >
>      > --joel
> 

      reply	other threads:[~2024-03-28  9:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26 21:52 Joel Sherrill
2024-03-27  8:52 ` Christophe Lyon
2024-03-27 10:35   ` Kai Ruottu
2024-03-27 19:07   ` Joel Sherrill
2024-03-28  9:17     ` Christophe Lyon [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=858d0b8f-2922-4d26-b3c3-a04fa31aa215@arm.com \
    --to=christophe.lyon@arm.com \
    --cc=gcc@gcc.gnu.org \
    --cc=joel@rtems.org \
    /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).