]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.135/arc-build-get-rid-of-toolchain-check.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.9.135 / arc-build-get-rid-of-toolchain-check.patch
1 From 615f64458ad890ef94abc879a66d8b27236e733a Mon Sep 17 00:00:00 2001
2 From: Alexey Brodkin <abrodkin@synopsys.com>
3 Date: Thu, 13 Sep 2018 23:24:28 +0300
4 Subject: ARC: build: Get rid of toolchain check
5
6 From: Alexey Brodkin <abrodkin@synopsys.com>
7
8 commit 615f64458ad890ef94abc879a66d8b27236e733a upstream.
9
10 This check is very naive: we simply test if GCC invoked without
11 "-mcpu=XXX" has ARC700 define set. In that case we think that GCC
12 was built with "--with-cpu=arc700" and has libgcc built for ARC700.
13
14 Otherwise if ARC700 is not defined we think that everythng was built
15 for ARCv2.
16
17 But in reality our life is much more interesting.
18
19 1. Regardless of GCC configuration (i.e. what we pass in "--with-cpu"
20 it may generate code for any ARC core).
21
22 2. libgcc might be built with explicitly specified "--mcpu=YYY"
23
24 That's exactly what happens in case of multilibbed toolchains:
25 - GCC is configured with default settings
26 - All the libs built for many different CPU flavors
27
28 I.e. that check gets in the way of usage of multilibbed
29 toolchains. And even non-multilibbed toolchains are affected.
30 OpenEmbedded also builds GCC without "--with-cpu" because
31 each and every target component later is compiled with explicitly
32 set "-mcpu=ZZZ".
33
34 Acked-by: Rob Herring <robh@kernel.org>
35 Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
36 Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
37 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
38
39 ---
40 arch/arc/Makefile | 14 --------------
41 1 file changed, 14 deletions(-)
42
43 --- a/arch/arc/Makefile
44 +++ b/arch/arc/Makefile
45 @@ -22,20 +22,6 @@ cflags-y += -fno-common -pipe -fno-built
46 cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7
47 cflags-$(CONFIG_ISA_ARCV2) += -mcpu=archs
48
49 -is_700 = $(shell $(CC) -dM -E - < /dev/null | grep -q "ARC700" && echo 1 || echo 0)
50 -
51 -ifdef CONFIG_ISA_ARCOMPACT
52 -ifeq ($(is_700), 0)
53 - $(error Toolchain not configured for ARCompact builds)
54 -endif
55 -endif
56 -
57 -ifdef CONFIG_ISA_ARCV2
58 -ifeq ($(is_700), 1)
59 - $(error Toolchain not configured for ARCv2 builds)
60 -endif
61 -endif
62 -
63 ifdef CONFIG_ARC_CURR_IN_REG
64 # For a global register defintion, make sure it gets passed to every file
65 # We had a customer reported bug where some code built in kernel was NOT using