Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1343900 > unrolled thread

[PATCH] ARC Build system tweak

Started byVineet Gupta <Vineet.Gupta1@synopsys.com>
First post2016-02-26 09:30 +0100
Last post2016-02-26 09:40 +0100
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] ARC Build system tweak Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-02-26 09:30 +0100
    [PATCH] ARC: build: Better way to detect ISA compatible toolchain Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-02-26 09:40 +0100

#1343900 — [PATCH] ARC Build system tweak

FromVineet Gupta <Vineet.Gupta1@synopsys.com>
Date2016-02-26 09:30 +0100
Subject[PATCH] ARC Build system tweak
Message-ID<r6lWG-lR-9@gated-at.bofh.it>
Hi Michal,

Here's a ARC build system quirk that we are trying to change.
I would appreciate if you could take a glance and suggest if that is silly
or better way. Would we be inducing more shell invocations now for build ?
Also I could not find an existing construct in /scripts/Kbuild.include
so opencoded the pre-processor check.

Thx,
-Vineet

Vineet Gupta (1):
  ARC: build: Better way to detect ISA compatible toolchain

 arch/arc/Makefile              | 14 ++++++++++++++
 arch/arc/include/asm/arcregs.h |  6 ------
 2 files changed, 14 insertions(+), 6 deletions(-)

-- 
2.5.0

[toc] | [next] | [standalone]


#1343905 — [PATCH] ARC: build: Better way to detect ISA compatible toolchain

FromVineet Gupta <Vineet.Gupta1@synopsys.com>
Date2016-02-26 09:40 +0100
Subject[PATCH] ARC: build: Better way to detect ISA compatible toolchain
Message-ID<r6m6l-q0-1@gated-at.bofh.it>
In reply to#1343900
ARC architecture has 2 instruction sets: ARCompact/ARCv2.
While same gcc supports compiling for either (using appropriate toggles),
we can't use the same toolchain to build kernel because libgcc needs
to be unique and the toolchian (uClibc based) is not multilibed.

uClibc toolchain is convenient since it allows all userspace and
kernel to be built with a single install for an ISA.

This however means 2 gnu installs (with same triplet prefix) are needed
for building for 2 ISA and need to be in PATH.
As developers we keep switching the builds, but would occassionally fail
to update the PATH leading to usage of wrong tools. And this would only
show up at the end of kernel build when linking incompatible libgcc.

So the initial solution was to have gcc define a special preprocessor macro
DEFAULT_CPU_xxx which is unique for default toolchain configuration.
Claudiu proposed using grep for an existing preprocessor macro which is
again uniquely defined per ISA.

Cc: Michal Marek <mmarek@suse.cz>
Suggested-by: Claudiu Zissulescu <claziss@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
 arch/arc/Makefile              | 14 ++++++++++++++
 arch/arc/include/asm/arcregs.h |  6 ------
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index c8230f3395f2..21682e047c00 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -18,6 +18,20 @@ 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
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index f9f4c6f59fdb..7fbaea00a336 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -381,12 +381,6 @@ static inline int is_isa_arcompact(void)
 	return IS_ENABLED(CONFIG_ISA_ARCOMPACT);
 }
 
-#if defined(CONFIG_ISA_ARCOMPACT) && !defined(_CPU_DEFAULT_A7)
-#error "Toolchain not configured for ARCompact builds"
-#elif defined(CONFIG_ISA_ARCV2) && !defined(_CPU_DEFAULT_HS)
-#error "Toolchain not configured for ARCv2 builds"
-#endif
-
 #endif /* __ASEMBLY__ */
 
 #endif /* _ASM_ARC_ARCREGS_H */
-- 
2.5.0

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web