aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.com>2015-08-19 11:36:41 -0400
committerMichal Marek <mmarek@suse.com>2015-09-04 07:14:10 -0400
commit5631d9c429857194bd55d7bcd8fa5bdd1a9899a3 (patch)
treef0424c4fe42eb83bf35a0cda4204aff097a8b192 /Makefile
parentd179e22762fd38414c4108acedd5feca4cf7e0d8 (diff)
kbuild: Fix clang detection
We cannot detect clang before including the arch Makefile, because that can set the default cross compiler. We also cannot detect clang after including the arch Makefile, because powerpc wants to know about clang. Solve this by using an deferred variable. This costs us a few shell invocations, but this is only a constant number. Reported-by: Behan Webster <behanw@converseincode.com> Reported-by: Anton Blanchard <anton@samba.org> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 1 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 13270c0a9336..5ccbb58553ab 100644
--- a/Makefile
+++ b/Makefile
@@ -661,14 +661,7 @@ endif
661endif 661endif
662KBUILD_CFLAGS += $(stackp-flag) 662KBUILD_CFLAGS += $(stackp-flag)
663 663
664ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1) 664ifeq ($(cc-name),clang)
665COMPILER := clang
666else
667COMPILER := gcc
668endif
669export COMPILER
670
671ifeq ($(COMPILER),clang)
672KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) 665KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
673KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,) 666KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,)
674KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) 667KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)