[coreboot-gerrit] New patch to review for coreboot: toolchain.inc: verify tool variable validity before using it.

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Fri Dec 4 22:30:47 CET 2015


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12649

-gerrit

commit 4400d3ddb809354725f9accce595fe28fedac722
Author: Martin Roth <martinroth at google.com>
Date:   Fri Dec 4 14:29:37 2015 -0700

    toolchain.inc: verify tool variable validity before using it.
    
    If the toolchain for a stage/architecture wasn't present, we'd call the
    shell with '-v', generating an ugly warning:
    
    /bin/sh: - : invalid option
    Usage:  /bin/sh [GNU long option] [option] ...
            /bin/sh [GNU long option] [option] script-file ...
    GNU long options:
    ...
    
    Change-Id: Icd6d7a00083ee1695591ff96da36b7868be0c2f0
    Signed-off-by: Martin Roth <martinroth at google.com>
---
 toolchain.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/toolchain.inc b/toolchain.inc
index 1b73ce9..541dc1a 100644
--- a/toolchain.inc
+++ b/toolchain.inc
@@ -155,10 +155,10 @@ IASLFAIL:=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), \
+	$(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), \
 		$(eval COMPILERFAIL:=1)$(warning Please use the coreboot toolchain for '$(arch)')))
 #if iasl doesn't match the current coreboot version, fail the test
-$(if $(shell $(IASL) -v 2>&1 | grep -q "$(shell util/crossgcc/buildgcc -s iasl)" || echo not-coreboot), \
+$(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)))
 endif
 endif



More information about the coreboot-gerrit mailing list