Patch "ARC: build: Better way to detect ISA compatible toolchain" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
ARC: build: Better way to detect ISA compatible toolchain
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
arc-build-better-way-to-detect-isa-compatible-toolchain.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
20d780374c81cf237834af2202c26df2100ddd69Mon Sep 17 00:00:00 2001
From: Vineet Gupta <[email protected]>
Date: Thu, 25 Feb 2016 22:04:38 +0530
Subject: ARC: build: Better way to detect ISA compatible toolchain
From: Vineet Gupta <[email protected]>
commit 20d780374c81cf237834af2202c26df2100ddd69 upstream.
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.
--- arch/arc/Makefile | 14 ++++++++++++++ arch/arc/include/asm/arcregs.h | 6 ------ 2 files changed, 14 insertions(+), 6 deletions(-)
arch/arc/Makefile +14 -0
@@ -18,6 +18,20 @@ cflags-y += -fno-common -pipe -fno-built 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
arch/arc/include/asm/arcregs.h +0 -6
@@ -374,12 +374,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 */
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/arc-build-better-way-to-detect-isa-compatible-toolchain.patch queue-4.4/arc-elide-redundant-setup-of-dma-callbacks.patch queue-4.4/arc-call-trace_hardirqs_on-before-enabling-irqs.patch queue-4.4/arc-use-correct-offset-in-pt_regs-for-saving-restoring-user-mode-r25.patch