Skip to content

Commit e33ae3e

Browse files
committed
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. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]>
1 parent 081b4b5 commit e33ae3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

init/Kconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ config DEFCONFIG_LIST
99
default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
1010

1111
config 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)
1313

1414
config GCC_VERSION
1515
int
@@ -21,7 +21,7 @@ config LD_VERSION
2121
default $(shell,$(LD) --version | $(srctree)/scripts/ld-version.sh)
2222

2323
config 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)
2525

2626
config CLANG_VERSION
2727
int

0 commit comments

Comments
 (0)