linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARC: Get rid of toolchain check
@ 2018-09-13 20:24 Alexey Brodkin
  2018-09-13 21:04 ` Rob Herring
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Brodkin @ 2018-09-13 20:24 UTC (permalink / raw)
  To: linux-snps-arc; +Cc: linux-kernel, Vineet Gupta, Alexey Brodkin

This check is very naive: we simply test if GCC invoked without
"-mcpu=XXX" has ARC700 define set. In that case we think that GCC
was built with "--with-cpu=arc700" and has libgcc built for ARC700.

Otherwise if ARC700 is not defined we think that everythng was built
for ARCv2.

But in reality our life is much more interesting.

1. Regardless of GCC configuration (i.e. what we pass in "--with-cpu"
   it may generate code for any ARC core).

2. libgcc might be built with explicitly specified "--mcpu=YYY"

That's exactly what happens in case of multilibbed toolchains:
 - GCC is configured with default settings
 - All the libs built for many different CPU flavors

I.e. that check gets in the way of usage of multilibbed
toolchains. And even non-multilibbed toolchains are affected.
OpenEmbedded also builds GCC without "--with-cpu" because
each and every target component later is compiled with explicitly
set "-mcpu=ZZZ".

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
---
 arch/arc/Makefile | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index 6c1b20dd76ad..16ae8675116e 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -20,20 +20,6 @@ cflags-y	+= -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
 cflags-$(CONFIG_ISA_ARCOMPACT)	+= -mA7
 cflags-$(CONFIG_ISA_ARCV2)	+= -mcpu=archs
 
-is_700 = $(shell $(CC) -dM -E - < /dev/null | grep -q "ARC700" && echo 1 || echo 0)
-
-ifdef CONFIG_ISA_ARCOMPACT
-ifeq ($(is_700), 0)
-    $(error Toolchain not configured for ARCompact builds)
-endif
-endif
-
-ifdef CONFIG_ISA_ARCV2
-ifeq ($(is_700), 1)
-    $(error Toolchain not configured for ARCv2 builds)
-endif
-endif
-
 ifdef CONFIG_ARC_CURR_IN_REG
 # For a global register defintion, make sure it gets passed to every file
 # We had a customer reported bug where some code built in kernel was NOT using
-- 
2.17.1


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

* Re: [PATCH] ARC: Get rid of toolchain check
  2018-09-13 20:24 [PATCH] ARC: Get rid of toolchain check Alexey Brodkin
@ 2018-09-13 21:04 ` Rob Herring
  2018-10-17 14:28   ` Alexey Brodkin
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2018-09-13 21:04 UTC (permalink / raw)
  To: Alexey.Brodkin; +Cc: linux-snps-arc, Linux Kernel Mailing List, Vineet.Gupta1

On Thu, Sep 13, 2018 at 3:24 PM Alexey Brodkin
<Alexey.Brodkin@synopsys.com> wrote:
>
> This check is very naive: we simply test if GCC invoked without
> "-mcpu=XXX" has ARC700 define set. In that case we think that GCC
> was built with "--with-cpu=arc700" and has libgcc built for ARC700.
>
> Otherwise if ARC700 is not defined we think that everythng was built
> for ARCv2.
>
> But in reality our life is much more interesting.
>
> 1. Regardless of GCC configuration (i.e. what we pass in "--with-cpu"
>    it may generate code for any ARC core).
>
> 2. libgcc might be built with explicitly specified "--mcpu=YYY"
>
> That's exactly what happens in case of multilibbed toolchains:
>  - GCC is configured with default settings
>  - All the libs built for many different CPU flavors
>
> I.e. that check gets in the way of usage of multilibbed
> toolchains. And even non-multilibbed toolchains are affected.
> OpenEmbedded also builds GCC without "--with-cpu" because
> each and every target component later is compiled with explicitly
> set "-mcpu=ZZZ".
>
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> ---
>  arch/arc/Makefile | 14 --------------
>  1 file changed, 14 deletions(-)

+1 for this. Removing it also helps with my work to be able to build
all the .dts files with only a host compiler. That also needs the hunk
setting CROSS_COMPILE removed and not having a built-in dtb by
default, but this is a step in the right direction.

Acked-by: Rob Herring <robh@kernel.org>

Rob

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

* RE: [PATCH] ARC: Get rid of toolchain check
  2018-09-13 21:04 ` Rob Herring
@ 2018-10-17 14:28   ` Alexey Brodkin
  2018-10-18 12:44     ` gregkh
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Brodkin @ 2018-10-17 14:28 UTC (permalink / raw)
  To: stable
  Cc: linux-snps-arc, Linux Kernel Mailing List, Rob Herring,
	Vineet Gupta, gregkh

Hello,

> -----Original Message-----
> From: Rob Herring [mailto:robh@kernel.org]
> Sent: Friday, September 14, 2018 12:04 AM
> To: Alexey.Brodkin@synopsys.com
> Cc: linux-snps-arc@lists.infradead.org; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>; Vineet.Gupta1@synopsys.com
> Subject: Re: [PATCH] ARC: Get rid of toolchain check
> 
> On Thu, Sep 13, 2018 at 3:24 PM Alexey Brodkin
> <Alexey.Brodkin@synopsys.com> wrote:
> >
> > This check is very naive: we simply test if GCC invoked without
> > "-mcpu=XXX" has ARC700 define set. In that case we think that GCC
> > was built with "--with-cpu=arc700" and has libgcc built for ARC700.
> >
> > Otherwise if ARC700 is not defined we think that everythng was built
> > for ARCv2.
> >
> > But in reality our life is much more interesting.
> >
> > 1. Regardless of GCC configuration (i.e. what we pass in "--with-cpu"
> >    it may generate code for any ARC core).
> >
> > 2. libgcc might be built with explicitly specified "--mcpu=YYY"
> >
> > That's exactly what happens in case of multilibbed toolchains:
> >  - GCC is configured with default settings
> >  - All the libs built for many different CPU flavors
> >
> > I.e. that check gets in the way of usage of multilibbed
> > toolchains. And even non-multilibbed toolchains are affected.
> > OpenEmbedded also builds GCC without "--with-cpu" because
> > each and every target component later is compiled with explicitly
> > set "-mcpu=ZZZ".
> >
> > Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> > ---
> >  arch/arc/Makefile | 14 --------------
> >  1 file changed, 14 deletions(-)
> 
> +1 for this. Removing it also helps with my work to be able to build
> all the .dts files with only a host compiler. That also needs the hunk
> setting CROSS_COMPILE removed and not having a built-in dtb by
> default, but this is a step in the right direction.
> 
> Acked-by: Rob Herring <robh@kernel.org>

May we get this one back-ported to stable trees?

Upstream commit in Linus' tree is
615f64458ad8 ("ARC: build: Get rid of toolchain check").

This fixes kernel configuration for ARC in case of missing
ARC cross-tools in current PATH.

-Alexey

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

* Re: [PATCH] ARC: Get rid of toolchain check
  2018-10-17 14:28   ` Alexey Brodkin
@ 2018-10-18 12:44     ` gregkh
  0 siblings, 0 replies; 4+ messages in thread
From: gregkh @ 2018-10-18 12:44 UTC (permalink / raw)
  To: Alexey Brodkin
  Cc: stable, linux-snps-arc, Linux Kernel Mailing List, Rob Herring,
	Vineet Gupta

On Wed, Oct 17, 2018 at 02:28:41PM +0000, Alexey Brodkin wrote:
> Hello,
> 
> > -----Original Message-----
> > From: Rob Herring [mailto:robh@kernel.org]
> > Sent: Friday, September 14, 2018 12:04 AM
> > To: Alexey.Brodkin@synopsys.com
> > Cc: linux-snps-arc@lists.infradead.org; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>; Vineet.Gupta1@synopsys.com
> > Subject: Re: [PATCH] ARC: Get rid of toolchain check
> > 
> > On Thu, Sep 13, 2018 at 3:24 PM Alexey Brodkin
> > <Alexey.Brodkin@synopsys.com> wrote:
> > >
> > > This check is very naive: we simply test if GCC invoked without
> > > "-mcpu=XXX" has ARC700 define set. In that case we think that GCC
> > > was built with "--with-cpu=arc700" and has libgcc built for ARC700.
> > >
> > > Otherwise if ARC700 is not defined we think that everythng was built
> > > for ARCv2.
> > >
> > > But in reality our life is much more interesting.
> > >
> > > 1. Regardless of GCC configuration (i.e. what we pass in "--with-cpu"
> > >    it may generate code for any ARC core).
> > >
> > > 2. libgcc might be built with explicitly specified "--mcpu=YYY"
> > >
> > > That's exactly what happens in case of multilibbed toolchains:
> > >  - GCC is configured with default settings
> > >  - All the libs built for many different CPU flavors
> > >
> > > I.e. that check gets in the way of usage of multilibbed
> > > toolchains. And even non-multilibbed toolchains are affected.
> > > OpenEmbedded also builds GCC without "--with-cpu" because
> > > each and every target component later is compiled with explicitly
> > > set "-mcpu=ZZZ".
> > >
> > > Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> > > ---
> > >  arch/arc/Makefile | 14 --------------
> > >  1 file changed, 14 deletions(-)
> > 
> > +1 for this. Removing it also helps with my work to be able to build
> > all the .dts files with only a host compiler. That also needs the hunk
> > setting CROSS_COMPILE removed and not having a built-in dtb by
> > default, but this is a step in the right direction.
> > 
> > Acked-by: Rob Herring <robh@kernel.org>
> 
> May we get this one back-ported to stable trees?
> 
> Upstream commit in Linus' tree is
> 615f64458ad8 ("ARC: build: Get rid of toolchain check").
> 
> This fixes kernel configuration for ARC in case of missing
> ARC cross-tools in current PATH.

Now queued up, thanks.

greg k-h

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

end of thread, other threads:[~2018-10-18 12:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-13 20:24 [PATCH] ARC: Get rid of toolchain check Alexey Brodkin
2018-09-13 21:04 ` Rob Herring
2018-10-17 14:28   ` Alexey Brodkin
2018-10-18 12:44     ` gregkh

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 NNTP newsgroup(s).