summaryrefslogtreecommitdiff
path: root/toolchain.inc
diff options
context:
space:
mode:
authorMartin Roth <martin@coreboot.org>2020-12-24 09:42:39 -0700
committerPatrick Georgi <pgeorgi@google.com>2021-02-24 11:29:39 +0000
commit8be01465286ed24b2a816a8b1cef0b20b55496f6 (patch)
treeafac2986dcc803daf7ef99977fb8578ca6ce5ebe /toolchain.inc
parent9056fde0233596b62b9e4d7b75fcfb7fdd72bc82 (diff)
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>
Diffstat (limited to 'toolchain.inc')
-rw-r--r--toolchain.inc40
1 files changed, 30 insertions, 10 deletions
diff --git a/toolchain.inc b/toolchain.inc
index b680b1c77d..18c6ab2970 100644
--- a/toolchain.inc
+++ b/toolchain.inc
@@ -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),)