aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Kbuild.include
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 /scripts/Kbuild.include
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 'scripts/Kbuild.include')
-rw-r--r--scripts/Kbuild.include4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index d3437b82ac25..3523df613391 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -128,6 +128,10 @@ cc-option-align = $(subst -functions=0,,\
128cc-disable-warning = $(call try-run,\ 128cc-disable-warning = $(call try-run,\
129 $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) 129 $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
130 130
131# cc-name
132# Expands to either gcc or clang
133cc-name = $(shell $(CC) -v 2>&1 | grep -q "clang version" && echo clang || echo gcc)
134
131# cc-version 135# cc-version
132cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) 136cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
133 137