toolchain.inc: Test for toolchain when using llvm/clang

Change-Id: I45ed5e289f9bfae90d71938243f921588b256e39
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/12676
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Martin Roth 2015-12-07 14:07:10 -07:00
parent 2ab652f606
commit a23e2ce5b7
1 changed files with 4 additions and 4 deletions

View File

@ -148,21 +148,21 @@ $(call init_stages)
# Test for coreboot toolchain (except when explicitly not requested) # Test for coreboot toolchain (except when explicitly not requested)
ifneq ($(NOCOMPILE),1) ifneq ($(NOCOMPILE),1)
# only run if we're doing a build (not for tests, kconfig, ...), using gcc # only run if we're doing a build (not for tests, kconfig, ...)
# rationale: gcc versions by Linux distributions tend to be quite messed up # rationale: gcc versions by Linux distributions tend to be quite messed up
# llvm/clang also needs patches supplied by the coreboot build
COMPILERFAIL:=0 COMPILERFAIL:=0
IASLFAIL:=0 IASLFAIL:=0
ifeq ($(CONFIG_COMPILER_GCC),y)
ifneq ($(CONFIG_ANY_TOOLCHAIN),y) ifneq ($(CONFIG_ANY_TOOLCHAIN),y)
$(foreach arch,$(sort $(foreach stage,$(COREBOOT_STANDARD_STAGES),$(ARCH-$(stage)-y))), \ $(foreach arch,$(sort $(foreach stage,$(COREBOOT_STANDARD_STAGES),$(ARCH-$(stage)-y))), \
$(if $(shell if [ -n "$(CC_$(arch))" ]; then $(CC_$(arch)) -v 2>&1 |grep -q "gcc version .*coreboot toolchain" || echo not-coreboot; else echo not-coreboot; fi), \ $(if $(shell if [ -n "$(CC_$(arch))" ]; then $(CC_$(arch)) -v 2>&1 |grep -q "coreboot toolchain" || echo not-coreboot; else echo not-coreboot; fi), \
$(eval COMPILERFAIL:=1)$(warning Please use the coreboot toolchain for '$(arch)'))) $(eval COMPILERFAIL:=1)$(warning Please use the coreboot toolchain for '$(arch)')))
#if iasl doesn't match the current coreboot version, fail the test #if iasl doesn't match the current coreboot version, fail the test
$(if $(shell if [ -n "$(IASL)" ]; then $(IASL) -v 2>&1 | grep -q "$(shell util/crossgcc/buildgcc -s iasl)" || echo not-coreboot; else echo not-coreboot; fi), \ $(if $(shell if [ -n "$(IASL)" ]; then $(IASL) -v 2>&1 | grep -q "$(shell util/crossgcc/buildgcc -s iasl)" || echo not-coreboot; else echo not-coreboot; fi), \
$(eval COMPILERFAIL:=1)$(eval IASLFAIL:=1)$(warning Please use the coreboot toolchain version of iasl - $(shell util/crossgcc/buildgcc -s iasl))) $(eval COMPILERFAIL:=1)$(eval IASLFAIL:=1)$(warning Please use the coreboot toolchain version of iasl - $(shell util/crossgcc/buildgcc -s iasl)))
endif endif
endif endif
endif
ifeq ($(COMPILERFAIL),1) ifeq ($(COMPILERFAIL),1)
ifneq ($(XGCCPATH),) ifneq ($(XGCCPATH),)
$(warning ) $(warning )