toolchain.inc: Update and fix the test-toolchain target

Due to some change, the test-toolchain was no longer working, and was
always reporting that the toolchain is out of date.

This fixes the failure, and prints both the expected versions of Clang,
GCC, and IASL on failures.

Additional changes fix some indentation issues and skip trying to update
submodules when the test is run.

Signed-off-by: Martin Roth <martin@coreboot.org>
Change-Id: Ia350f279c3fd3533523996327cc6b2304e0bead4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48903
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Martin Roth 2020-12-24 09:42:39 -07:00 committed by Patrick Georgi
parent 9056fde023
commit 8be0146528
1 changed files with 30 additions and 10 deletions

View File

@ -219,23 +219,37 @@ ifneq ($(MAKECMDGOALS),)
ifneq ($(filter test-toolchain,$(MAKECMDGOALS)),)
$(foreach arch, $(ARCH_SUPPORTED), \
$(if $(shell if [ -n "$(GCC_CC_$(arch))" ]; then \
$(GCC_CC_$(arch)) -v 2>&1 | \
grep -q "$(shell util/crossgcc/buildgcc -s gcc)" || \
$(GCC_CC_$(arch)) --version 2>&1 | head -n1 | rev | \
cut -d ' ' -f 1 | rev | \
grep -q "$$(util/crossgcc/buildgcc -s gcc)" || \
echo not-current; fi), \
$(eval COMPILER_OUT_OF_DATE:=1) \
$(warning The coreboot toolchain version of gcc for '$(arch)' \
architecture is not the current version.)) \
architecture is not the current version.) \
$(warning $(arch) gcc version from buildgcc: \
$(shell util/crossgcc/buildgcc -s gcc)) \
$(warning $(arch) version of gcc executable: \
$(shell $(GCC_CC_$(arch)) --version | head -n1 | \
rev | cut -d ' ' -f 1 | rev))) \
$(if $(shell if [ -n "$(CLANG_CC_$(arch))" ]; then \
$(CLANG_CC_$(arch)) -v 2>&1 | \
$(CLANG_CC_$(arch)) --version 2>&1 | \
sed 's/.*clang version/clang version/' | \
head -n1 | cut -d ' ' -f 3 | \
grep -q "$(shell util/crossgcc/buildgcc -s clang)" || \
echo not-current; fi), \
$(eval COMPILER_OUT_OF_DATE:=1)\
$(eval COMPILER_OUT_OF_DATE:=1) \
$(warning The coreboot toolchain version of clang for \
'$(arch)' architecture is not the current version.)) \
'$(arch)' architecture is not the current version.) \
$(warning $(arch) clang version from buildgcc: \
$(shell util/crossgcc/buildgcc -s clang)) \
$(warning $(arch) version of clang executable: \
$(shell $(CLANG_CC_$(arch)) --version 2>&1 | \
sed 's/.*clang version/clang version/' | \
head -n1 | cut -d ' ' -f 3))) \
$(if $(shell if [ "$(OBJDUMP_$(arch))" != "invalidobjdump" ]; then \
$(OBJDUMP_$(arch)) -v 2>&1 | \
grep -q "$(shell util/crossgcc/buildgcc -s binutils)" || \
echo not-current; fi), \
$(OBJDUMP_$(arch)) -v 2>&1 | \
grep -q "$(shell util/crossgcc/buildgcc -s binutils)" || \
echo not-current; fi), \
$(eval COMPILER_OUT_OF_DATE:=1)\
$(warning The coreboot toolchain version of binutils for \
'$(arch)' architecture is not the current version.)) \
@ -245,6 +259,12 @@ $(if $(shell if [ -n "$(IASL)" ]; then $(IASL) -v 2>&1 | \
echo not-coreboot; fi), \
$(eval COMPILER_OUT_OF_DATE:=1)\
$(warning The coreboot toolchain version of iasl \
is not the current version))
is not the current version) \
$(warning $(arch) iasl version from buildgcc: \
$(shell util/crossgcc/buildgcc -s iasl)) \
$(warning $(arch) version of iasl executable: \
$(shell $(IASL) -v 2>&1 | \
grep ASL+ | rev | cut -f 1 -d ' ' | rev)))
$(eval UPDATED_SUBMODULES:=1)
endif #($(filter crossgcc_check%,$(MAKECMDGOALS)),)
endif #($(MAKECMDGOALS),)