aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/Makefile
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2016-02-25 11:34:38 -0500
committerVineet Gupta <vgupta@synopsys.com>2016-03-12 01:28:30 -0500
commit20d780374c81cf237834af2202c26df2100ddd69 (patch)
tree8c070c2a8208097db31a4fc954881df44c2b2382 /arch/arc/Makefile
parent7cab91b87dd8eeee5911ec34be8bb0288ebba18b (diff)
ARC: build: Better way to detect ISA compatible toolchain
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>
Diffstat (limited to 'arch/arc/Makefile')
-rw-r--r--arch/arc/Makefile14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index babc09c61c6c..fed12f39d8ce 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -22,6 +22,20 @@ cflags-y += -fno-common -pipe -fno-builtin -D__linux__
22cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7 22cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7
23cflags-$(CONFIG_ISA_ARCV2) += -mcpu=archs 23cflags-$(CONFIG_ISA_ARCV2) += -mcpu=archs
24 24
25is_700 = $(shell $(CC) -dM -E - < /dev/null | grep -q "ARC700" && echo 1 || echo 0)
26
27ifdef CONFIG_ISA_ARCOMPACT
28ifeq ($(is_700), 0)
29 $(error Toolchain not configured for ARCompact builds)
30endif
31endif
32
33ifdef CONFIG_ISA_ARCV2
34ifeq ($(is_700), 1)
35 $(error Toolchain not configured for ARCv2 builds)
36endif
37endif
38
25ifdef CONFIG_ARC_CURR_IN_REG 39ifdef CONFIG_ARC_CURR_IN_REG
26# For a global register defintion, make sure it gets passed to every file 40# For a global register defintion, make sure it gets passed to every file
27# We had a customer reported bug where some code built in kernel was NOT using 41# We had a customer reported bug where some code built in kernel was NOT using