History

kbuild: use $(CC_VERSION_TEXT) to evaluate CC_IS_GCC and CC_IS_CLANG

The result of '$(CC) --version | head -n 1' has already been computed by the top Makefile, and stored in the environment variable, CC_VERSION_TEXT. 'echo' is cheaper than the two commands $(CC) and 'head' although this optimization is not noticeable level.

Masahiro Yamada committed 6 years ago

Commit e33ae3e1 parent 081b4b51 file · +2 −2Browse files

Unified · Split

init/Kconfig+2−2
@@ -9,7 +9,7 @@ config DEFCONFIG_LIST · 8 unmodified lines
9 default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"9 default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
10 10
11config CC_IS_GCC11config CC_IS_GCC
12 def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)12 def_bool $(success,echo "$(CC_VERSION_TEXT)" | grep -q gcc)
13 13
14config GCC_VERSION14config GCC_VERSION
15 int15 int
@@ -21,7 +21,7 @@ config LD_VERSION · 5 unmodified lines
21 default $(shell,$(LD) --version | $(srctree)/scripts/ld-version.sh)21 default $(shell,$(LD) --version | $(srctree)/scripts/ld-version.sh)
22 22
23config CC_IS_CLANG23config CC_IS_CLANG
24 def_bool $(success,$(CC) --version | head -n 1 | grep -q clang)24 def_bool $(success,echo "$(CC_VERSION_TEXT)" | grep -q clang)
25 25
26config CLANG_VERSION26config CLANG_VERSION
27 int27 int