linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arc: Remove sometimes misleading toolchain check
@ 2017-05-25 17:24 Alexey Brodkin
  2017-06-07 16:33 ` Vineet Gupta
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Brodkin @ 2017-05-25 17:24 UTC (permalink / raw)
  To: linux-snps-arc; +Cc: linux-kernel, Vineet Gupta, Alexey Brodkin

Thinking of a toolchains for ARCompact and ARCv2 ISAs we implicitly
think about libgcc.a build for one of those ISAs which we're linking
with. And given there's no multiarch uClibc toolchain for ARC
(as probably for any other architecture) the assumption is the only way
to get libgcc.a for desired ISA is from a toolchain built right for that
same ISA.

So what we do we check what's GCC's default architecture ARC700 or not.
But generally speaking default arch makes not a lot of sense if explicit
command line option exist like "-mcpu=archs". In other words exactly the
same GCC might build executables for both ARC700 and ARC HS38.

But in real life libgcc could be easily built on a separate step
independently of the compiler and friends. And that really happens.

For example OpenEmbedded prefers to reuse the same toolchain for both
arches having libgcc built separately.

Anyways given we have plans to get rid of libgcc dependency that change
is sort of future proof.

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 44ef35d33956..d8c99fefaebb 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -22,20 +22,6 @@ cflags-y	+= -fno-common -pipe -fno-builtin -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.7.4

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

* Re: [PATCH] arc: Remove sometimes misleading toolchain check
  2017-05-25 17:24 [PATCH] arc: Remove sometimes misleading toolchain check Alexey Brodkin
@ 2017-06-07 16:33 ` Vineet Gupta
  2017-06-07 16:35   ` Alexey Brodkin
  0 siblings, 1 reply; 3+ messages in thread
From: Vineet Gupta @ 2017-06-07 16:33 UTC (permalink / raw)
  To: Alexey Brodkin, linux-snps-arc; +Cc: linux-kernel

On 05/25/2017 10:24 AM, Alexey Brodkin wrote:
> Thinking of a toolchains for ARCompact and ARCv2 ISAs we implicitly
> think about libgcc.a build for one of those ISAs which we're linking
> with. And given there's no multiarch uClibc toolchain for ARC
> (as probably for any other architecture) the assumption is the only way
> to get libgcc.a for desired ISA is from a toolchain built right for that
> same ISA.
> 
> So what we do we check what's GCC's default architecture ARC700 or not.
> But generally speaking default arch makes not a lot of sense if explicit
> command line option exist like "-mcpu=archs". In other words exactly the
> same GCC might build executables for both ARC700 and ARC HS38.
> 
> But in real life libgcc could be easily built on a separate step
> independently of the compiler and friends. And that really happens.
> 
> For example OpenEmbedded prefers to reuse the same toolchain for both
> arches having libgcc built separately.

So this is a goodness of OE. But unfortunately those of living with simpler build 
systems: Synopsys toolchain scripts or even Buildroot don't have this - right ?

So how will it help other developers avoid errors in the work flow when doing 
kernel builds for ARCompact and ARCv2.

The right solution is to kill off the libgcc dependency altogether form kernel. 
Just import math emulation code that we think is needed and build it in kernel !

> 
> Anyways given we have plans to get rid of libgcc dependency that change
> is sort of future proof.
> 
> 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 44ef35d33956..d8c99fefaebb 100644
> --- a/arch/arc/Makefile
> +++ b/arch/arc/Makefile
> @@ -22,20 +22,6 @@ cflags-y	+= -fno-common -pipe -fno-builtin -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
> 

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

* Re: [PATCH] arc: Remove sometimes misleading toolchain check
  2017-06-07 16:33 ` Vineet Gupta
@ 2017-06-07 16:35   ` Alexey Brodkin
  0 siblings, 0 replies; 3+ messages in thread
From: Alexey Brodkin @ 2017-06-07 16:35 UTC (permalink / raw)
  To: Vineet Gupta, linux-snps-arc; +Cc: linux-kernel

Hi Vineet,

On Wed, 2017-06-07 at 09:33 -0700, Vineet Gupta wrote:
> On 05/25/2017 10:24 AM, Alexey Brodkin wrote:
> > 
> > Thinking of a toolchains for ARCompact and ARCv2 ISAs we implicitly
> > think about libgcc.a build for one of those ISAs which we're linking
> > with. And given there's no multiarch uClibc toolchain for ARC
> > (as probably for any other architecture) the assumption is the only way
> > to get libgcc.a for desired ISA is from a toolchain built right for that
> > same ISA.
> > 
> > So what we do we check what's GCC's default architecture ARC700 or not.
> > But generally speaking default arch makes not a lot of sense if explicit
> > command line option exist like "-mcpu=archs". In other words exactly the
> > same GCC might build executables for both ARC700 and ARC HS38.
> > 
> > But in real life libgcc could be easily built on a separate step
> > independently of the compiler and friends. And that really happens.
> > 
> > For example OpenEmbedded prefers to reuse the same toolchain for both
> > arches having libgcc built separately.
> 
> So this is a goodness of OE. But unfortunately those of living with simpler build 
> systems: Synopsys toolchain scripts or even Buildroot don't have this - right ?
> 
> So how will it help other developers avoid errors in the work flow when doing 
> kernel builds for ARCompact and ARCv2.
> 
> The right solution is to kill off the libgcc dependency altogether form kernel. 
> Just import math emulation code that we think is needed and build it in kernel !

Right and that's on my todo list as I'm suffering the most from this issue now :)

-Alexey

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

end of thread, other threads:[~2017-06-07 16:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-25 17:24 [PATCH] arc: Remove sometimes misleading toolchain check Alexey Brodkin
2017-06-07 16:33 ` Vineet Gupta
2017-06-07 16:35   ` Alexey Brodkin

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).