Skip to content

Commit 9951674

Browse files
committed
kbuild: remove cc-name variable
There is one more user of $(cc-name) in the top Makefile. It is supposed to detect Clang before invoking Kconfig, so it should still be there in the $(shell ...) form. All the other users of $(cc-name) have been replaced with $(CONFIG_CC_IS_CLANG). Hence, scripts/Kbuild.include does not need to define cc-name any more. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent 076f421 commit 9951674

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ ifneq ($(KBUILD_SRC),)
485485
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
486486
endif
487487

488-
ifeq ($(cc-name),clang)
488+
ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
489489
ifneq ($(CROSS_COMPILE),)
490490
CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
491491
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))

scripts/Kbuild.include

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ cc-option-yn = $(call try-run,\
140140
cc-disable-warning = $(call try-run,\
141141
$(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
142142

143-
# cc-name
144-
# Expands to either gcc or clang
145-
cc-name = $(shell $(CC) -v 2>&1 | grep -q "clang version" && echo clang || echo gcc)
146-
147143
# cc-version
148144
cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
149145

0 commit comments

Comments
 (0)