diff --git a/Makefile b/Makefile index a95654df031e..78a0ae1662f8 100644 --- a/Makefile +++ b/Makefile @@ -553,7 +553,7 @@ ifdef building_out_of_srctree { echo "# this is build directory, ignore it"; echo "*"; } > .gitignore endif -ifneq ($(shell $(CC) --version 2>&1 | grep clang),) +ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),) ifneq ($(CROSS_COMPILE),) CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%)) GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit)) diff --git a/init/Kconfig b/init/Kconfig index 60b239d75b11..7bebea307eb7 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -35,7 +35,7 @@ config GCC_VERSION default 0 config CC_IS_CLANG - def_bool $(success,$(CC) --version | grep -q clang) + def_bool $(success,$(CC) --version | head -n 1 | grep -q clang) config LD_IS_LLD def_bool $(success,$(LD) -v | head -n 1 | grep -q LLD)