diff options
author | Michal Marek <mmarek@suse.com> | 2015-08-19 17:36:41 +0200 |
---|---|---|
committer | Michal Marek <mmarek@suse.com> | 2015-09-04 13:14:10 +0200 |
commit | 5631d9c429857194bd55d7bcd8fa5bdd1a9899a3 (patch) | |
tree | f0424c4fe42eb83bf35a0cda4204aff097a8b192 /Makefile | |
parent | d179e22762fd38414c4108acedd5feca4cf7e0d8 (diff) | |
download | linux-stable-5631d9c429857194bd55d7bcd8fa5bdd1a9899a3.tar.gz linux-stable-5631d9c429857194bd55d7bcd8fa5bdd1a9899a3.tar.bz2 linux-stable-5631d9c429857194bd55d7bcd8fa5bdd1a9899a3.zip |
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-- | Makefile | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -661,14 +661,7 @@ endif endif KBUILD_CFLAGS += $(stackp-flag) -ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1) -COMPILER := clang -else -COMPILER := gcc -endif -export COMPILER - -ifeq ($(COMPILER),clang) +ifeq ($(cc-name),clang) KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,) KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) |