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>
This commit is contained in:
Michal Marek
2015-08-19 17:36:41 +02:00
förälder d179e22762
incheckning 5631d9c429
4 ändrade filer med 10 tillägg och 13 borttagningar

Visa fil

@@ -56,7 +56,7 @@ endif
KBUILD_CFLAGS += $(warning)
else
ifeq ($(COMPILER),clang)
ifeq ($(cc-name),clang)
KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-value)
KBUILD_CFLAGS += $(call cc-disable-warning, format)