aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-10-30 09:26:33 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-11-02 09:49:00 -0400
commit076f421da5d4594d0a3e60c032ccf02ba55e868a (patch)
treef9e534cbf76b4fd8e47ff8690caf132d439f9310
parent2cd3faf87d2d8f6123adf34741b9a7b98828a76f (diff)
kbuild: replace cc-name test with CONFIG_CC_IS_CLANG
Evaluating cc-name invokes the compiler every time even when you are not compiling anything, like 'make help'. This is not efficient. The compiler type has been already detected in the Kconfig stage. Use CONFIG_CC_IS_CLANG, instead. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Acked-by: Paul Burton <paul.burton@mips.com> (MIPS) Acked-by: Joel Stanley <joel@jms.id.au>
-rw-r--r--Makefile2
-rw-r--r--arch/mips/Makefile2
-rw-r--r--arch/mips/vdso/Makefile2
-rw-r--r--arch/powerpc/Makefile4
-rw-r--r--scripts/Makefile.extrawarn2
5 files changed, 6 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 9aa352b38815..8d6529c371e1 100644
--- a/Makefile
+++ b/Makefile
@@ -702,7 +702,7 @@ stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG) := -fstack-protector-strong
702 702
703KBUILD_CFLAGS += $(stackp-flags-y) 703KBUILD_CFLAGS += $(stackp-flags-y)
704 704
705ifeq ($(cc-name),clang) 705ifdef CONFIG_CC_IS_CLANG
706KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) 706KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
707KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) 707KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
708KBUILD_CFLAGS += $(call cc-disable-warning, gnu) 708KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 15a84cfd0719..68410490e12f 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -128,7 +128,7 @@ cflags-y += -ffreestanding
128# clang's output will be based upon the build machine. So for clang we simply 128# clang's output will be based upon the build machine. So for clang we simply
129# unconditionally specify -EB or -EL as appropriate. 129# unconditionally specify -EB or -EL as appropriate.
130# 130#
131ifeq ($(cc-name),clang) 131ifdef CONFIG_CC_IS_CLANG
132cflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB 132cflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB
133cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -EL 133cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -EL
134else 134else
diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile
index 34605ca21498..58a0315ad743 100644
--- a/arch/mips/vdso/Makefile
+++ b/arch/mips/vdso/Makefile
@@ -10,7 +10,7 @@ ccflags-vdso := \
10 $(filter -march=%,$(KBUILD_CFLAGS)) \ 10 $(filter -march=%,$(KBUILD_CFLAGS)) \
11 -D__VDSO__ 11 -D__VDSO__
12 12
13ifeq ($(cc-name),clang) 13ifdef CONFIG_CC_IS_CLANG
14ccflags-vdso += $(filter --target=%,$(KBUILD_CFLAGS)) 14ccflags-vdso += $(filter --target=%,$(KBUILD_CFLAGS))
15endif 15endif
16 16
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 17be664dafa2..8a2ce14d68d0 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -96,7 +96,7 @@ aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1)
96aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mabi=elfv2 96aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mabi=elfv2
97endif 97endif
98 98
99ifneq ($(cc-name),clang) 99ifndef CONFIG_CC_IS_CLANG
100 cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mno-strict-align 100 cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mno-strict-align
101endif 101endif
102 102
@@ -175,7 +175,7 @@ endif
175# Work around gcc code-gen bugs with -pg / -fno-omit-frame-pointer in gcc <= 4.8 175# Work around gcc code-gen bugs with -pg / -fno-omit-frame-pointer in gcc <= 4.8
176# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44199 176# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44199
177# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52828 177# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52828
178ifneq ($(cc-name),clang) 178ifndef CONFIG_CC_IS_CLANG
179CC_FLAGS_FTRACE += $(call cc-ifversion, -lt, 0409, -mno-sched-epilog) 179CC_FLAGS_FTRACE += $(call cc-ifversion, -lt, 0409, -mno-sched-epilog)
180endif 180endif
181endif 181endif
diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index 24b2fb1d1297..800a10f1b4f3 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -64,7 +64,7 @@ endif
64KBUILD_CFLAGS += $(warning) 64KBUILD_CFLAGS += $(warning)
65else 65else
66 66
67ifeq ($(cc-name),clang) 67ifdef CONFIG_CC_IS_CLANG
68KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides) 68KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides)
69KBUILD_CFLAGS += $(call cc-disable-warning, unused-value) 69KBUILD_CFLAGS += $(call cc-disable-warning, unused-value)
70KBUILD_CFLAGS += $(call cc-disable-warning, format) 70KBUILD_CFLAGS += $(call cc-disable-warning, format)