From a234f45601e6e85a5179ec9cc446f070b86f425b Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 3 Dec 2014 11:20:51 +0100 Subject: [PATCH] build system: fix alignment function It seriously miscomputed alignment values, always off-by-one, and off-by-an-alignment for aligned values. Change-Id: Ide3477d09d34d7728cb0666bb30dd9f7a3f1056d Reported-by: Dave Frodin Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/7635 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan Reviewed-by: Dave Frodin --- Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc index 11989d3f41..880c38d042 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -91,7 +91,7 @@ $(foreach supported_arch,$(ARCH_SUPPORTED), \ _toint=$(shell printf "%d" $1) _int-add2=$(shell expr $(call _toint,$1) + $(call _toint,$2)) int-add=$(if $(filter 1,$(words $1)),$(strip $1),$(call int-add,$(call _int-add2,$(word 1,$1),$(word 2,$1)) $(wordlist 3,$(words $1),$1))) -int-align=$(shell expr $(call _toint,$1) + $(call _toint,$2) - 1 - $(call _toint,$1) % $(call _toint,$2)) +int-align=$(shell A=$(call _toint,$1) B=$(call _toint,$2); expr $$A + \( \( $$B - \( $$A % $$B \) \) % $$B \) ) file-size=$(shell cat $1 | wc -c) #######################################################################