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 <dave.frodin@se-eng.com>
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/7635
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Dave Frodin <dave.frodin@se-eng.com>
This commit is contained in:
Patrick Georgi 2014-12-03 11:20:51 +01:00
parent b6435610f5
commit a234f45601
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ $(foreach supported_arch,$(ARCH_SUPPORTED), \
_toint=$(shell printf "%d" $1) _toint=$(shell printf "%d" $1)
_int-add2=$(shell expr $(call _toint,$1) + $(call _toint,$2)) _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-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) file-size=$(shell cat $1 | wc -c)
####################################################################### #######################################################################