public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Building Single Tree for a Specific Set of CFLAGS
@ 2024-03-26 21:52 Joel Sherrill
  2024-03-27  8:52 ` Christophe Lyon
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Sherrill @ 2024-03-26 21:52 UTC (permalink / raw)
  To: GCC

[-- Attachment #1: Type: text/plain, Size: 489 bytes --]

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.

Thanks.

--joel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Building Single Tree for a Specific Set of CFLAGS
  2024-03-26 21:52 Building Single Tree for a Specific Set of CFLAGS Joel Sherrill
@ 2024-03-27  8:52 ` Christophe Lyon
  2024-03-27 10:35   ` Kai Ruottu
  2024-03-27 19:07   ` Joel Sherrill
  0 siblings, 2 replies; 5+ messages in thread
From: Christophe Lyon @ 2024-03-27  8:52 UTC (permalink / raw)
  To: gcc

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,

Christophe


> Thanks.
> 
> --joel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Building Single Tree for a Specific Set of CFLAGS
  2024-03-27  8:52 ` Christophe Lyon
@ 2024-03-27 10:35   ` Kai Ruottu
  2024-03-27 19:07   ` Joel Sherrill
  1 sibling, 0 replies; 5+ messages in thread
From: Kai Ruottu @ 2024-03-27 10:35 UTC (permalink / raw)
  To: Christophe Lyon, gcc

[-- Attachment #1: Type: text/plain, Size: 792 bytes --]

Christophe Lyon via Gcc kirjoitti 27.3.2024 klo 10.52:
> On 3/26/24 22:52, Joel Sherrill via Gcc wrote:
>> I am trying --disable-multlibs on the gcc configure and adding
>> CFLAGS_FOR_TARGET to make.
>>
> 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.
>
The "multilibs" is a typo, actually the option is :

------ clip -----------

|--disable-multilib|

    Specify that multiple target libraries to support different target
    variants, calling conventions, etc. should not be built. The default
    is to build a predefined set of them.
    Some targets provide finer-grained control over which multilibs are
    built (e.g., --disable-softfloat):

------ clip -----------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Building Single Tree for a Specific Set of CFLAGS
  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
  1 sibling, 1 reply; 5+ messages in thread
From: Joel Sherrill @ 2024-03-27 19:07 UTC (permalink / raw)
  To: Christophe Lyon; +Cc: gcc

[-- Attachment #1: Type: text/plain, Size: 1445 bytes --]

On Wed, Mar 27, 2024 at 3:53 AM Christophe Lyon via Gcc <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 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.

--joel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Building Single Tree for a Specific Set of CFLAGS
  2024-03-27 19:07   ` Joel Sherrill
@ 2024-03-28  9:17     ` Christophe Lyon
  0 siblings, 0 replies; 5+ messages in thread
From: Christophe Lyon @ 2024-03-28  9:17 UTC (permalink / raw)
  To: joel; +Cc: gcc



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
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-28  9:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-26 21:52 Building Single Tree for a Specific Set of CFLAGS 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 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).