[coreboot-gerrit] New patch to review for coreboot: Makefile: Replace the way to test if a string is empty

Zheng Bao (zheng.bao@amd.com) gerrit at coreboot.org
Wed Sep 9 09:53:05 CET 2015


Zheng Bao (zheng.bao at amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11600

-gerrit

commit 7d9a5b2e34a59c836690037b68a90a940005dec5
Author: zbao <fishbaozi at gmail.com>
Date:   Wed Sep 9 05:27:53 2015 -0400

    Makefile: Replace the way to test if a string is empty
    
    The output of command below,
    has different result on MacOS, which output 0.
    
    It is misleading to search an empty string in a empty string.
    We just test if the string is empty.
    
    Change-Id: Ie4b8fe1fb26df092e2985937251a49feadc61eb0
    Signed-off-by: Zheng Bao <zheng.bao at amd.com>
    Signed-off-by: Zheng Bao <fishbaozi at gmail.com>
---
 src/arch/x86/Makefile.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index 3a8d8d5..f7fa387 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -209,7 +209,7 @@ $(objcbfs)/romstage_null.debug: $$(romstage-objs) $(objgenerated)/romstage_null.
 	$(LD_romstage) --gc-sections -nostdlib -nostartfiles -static -o $@ -L$(obj) $(COMPILER_RT_FLAGS_romstage) --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) $(romstage-libs) --no-whole-archive $(COMPILER_RT_romstage) --end-group -T $(objgenerated)/romstage_null.ld --oformat $(romstage-oformat)
 	LANG=C LC_ALL= $(OBJCOPY_romstage) --only-section .illegal_globals $(@) $(objcbfs)/romstage_null.offenders 2>&1 | \
 	grep -v "Empty loadable segment detected" && \
-	$(NM_romstage) $(objcbfs)/romstage_null.offenders | grep -q ""; if [ $$? -eq 0 ]; then \
+	if [ -n "`$(NM_romstage) $(objcbfs)/romstage_null.offenders 2>/dev/null`" ]; then \
 		echo "Forbidden global variables in romstage:"; \
 		$(NM_romstage) $(objcbfs)/romstage_null.offenders; false; \
 		else true; fi



More information about the coreboot-gerrit mailing list