Skip to content

Commit

Permalink
kbuild: use $(CC_VERSION_TEXT) to evaluate CC_IS_GCC and CC_IS_CLANG
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
masahir0y committed May 12, 2020
1 parent 081b4b5 commit e33ae3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ config DEFCONFIG_LIST
default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"

config CC_IS_GCC
def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
def_bool $(success,echo "$(CC_VERSION_TEXT)" | grep -q gcc)

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

config CC_IS_CLANG
def_bool $(success,$(CC) --version | head -n 1 | grep -q clang)
def_bool $(success,echo "$(CC_VERSION_TEXT)" | grep -q clang)

config CLANG_VERSION
int
Expand Down

0 comments on commit e33ae3e

Please sign in to comment.