[coreboot-gerrit] New patch to review for coreboot: a67942f build system: Test gccs that are actually used

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Thu Mar 26 22:15:06 CET 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9055

-gerrit

commit a67942f6065d78efbc83b18751b23c673ffe845c
Author: Patrick Georgi <pgeorgi at google.com>
Date:   Thu Mar 26 21:39:12 2015 +0100

    build system: Test gccs that are actually used
    
    Test that the compilers used for the target are
    built by our buildgcc utility. Users can override
    this test with the ANY_TOOLCHAIN Kconfig variable.
    
    Change-Id: I24adf2c9b83667fd34ce8eb103327c9376765f6d
    Signed-off-by: Patrick Georgi <pgeorgi at google.com>
---
 Makefile.inc  | 15 ---------------
 toolchain.inc | 17 +++++++++++++++++
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/Makefile.inc b/Makefile.inc
index 8d732ea..2877a62 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -26,21 +26,6 @@ export KERNELVERSION := $(strip $(if $(GIT),\
 	4.0$(KERNELREVISION)))
 
 #######################################################################
-# Test for coreboot toolchain (except when explicitely not requested)
-ifneq ($(NOCOMPILE),1)
-# only run if we're doing a build (not for tests, kconfig, ...), using gcc
-# rationale: gcc versions by Linux distributions tend to be quite messed up
-ifeq ($(CONFIG_COMPILER_GCC),y)
-ifneq ($(CONFIG_ANY_TOOLCHAIN),y)
-_toolchain=$(shell $(CC_x86_32) -v 2>&1 |grep -q "gcc version .*coreboot toolchain" && echo coreboot)
-ifneq ($(_toolchain),coreboot)
-$(error Please use the coreboot toolchain (or prove that your toolchain works))
-endif
-endif
-endif
-endif
-
-#######################################################################
 # Basic component discovery
 MAINBOARDDIR=$(call strip_quotes,$(CONFIG_MAINBOARD_DIR))
 export MAINBOARDDIR
diff --git a/toolchain.inc b/toolchain.inc
index d69fe26..86dd89d 100644
--- a/toolchain.inc
+++ b/toolchain.inc
@@ -136,3 +136,20 @@ init_stages = \
 $(eval $(call toolchain_to_dir))
 
 $(call init_stages)
+
+# Test for coreboot toolchain (except when explicitely not requested)
+ifneq ($(NOCOMPILE),1)
+# only run if we're doing a build (not for tests, kconfig, ...), using gcc
+# rationale: gcc versions by Linux distributions tend to be quite messed up
+COMPILERFAIL:=0
+ifeq ($(CONFIG_COMPILER_GCC),y)
+ifneq ($(CONFIG_ANY_TOOLCHAIN),y)
+$(foreach arch,$(sort $(foreach stage,$(COREBOOT_STANDARD_STAGES),$(ARCH-$(stage)-y))), \
+	$(if $(shell $(CC_$(arch)) -v 2>&1 |grep -q "gcc version .*coreboot toolchain" || echo not-coreboot), \
+		$(eval COMPILERFAIL:=1)$(warning Please use the coreboot toolchain for '$(arch)' (or prove that your toolchain works))))
+endif
+endif
+endif
+ifeq ($(COMPILERFAIL),1)
+$(error consider building our compilers: make crossgcc)
+endif



More information about the coreboot-gerrit mailing list