Felix Singer has submitted this change. ( https://review.coreboot.org/c/coreboot/+/83377?usp=email )
Change subject: Makefile.mk: Fix int-shift-left ......................................................................
Makefile.mk: Fix int-shift-left
commit 4a8d73d6a4 ("Makefile.mk: Remove bc dependency") broke the left shift, since the expr tool does not support shifting operations.
This patch uses the left shift operator inside arithmetic expansion. Every posix shell should support this.
Tested: Build amd/birman mainboard and check that the soft-fuse parameter doesn't change.
Signed-off-by: Maximilian Brune maximilian.brune@9elements.com Change-Id: If3b29dae727875b0788100a2cb02c86736ffaf8c Reviewed-on: https://review.coreboot.org/c/coreboot/+/83377 Reviewed-by: Felix Singer service+coreboot-gerrit@felixsinger.de Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Martin L Roth gaumless@gmail.com Reviewed-by: Matt DeVillier matt.devillier@gmail.com --- M Makefile.mk 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: Felix Singer: Looks good to me, approved Martin L Roth: Looks good to me, approved Matt DeVillier: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/Makefile.mk b/Makefile.mk index 592365e..b4532c3 100644 --- a/Makefile.mk +++ b/Makefile.mk @@ -178,7 +178,7 @@ int-multiply=$(if $(filter 1,$(words $1)),$(strip $1),$(call int-multiply,$(call _int-multiply2,$(word 1,$1),$(word 2,$1)) $(wordlist 3,$(words $1),$1))) int-divide=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) / $(call _toint,$(word 2,$1)))) int-remainder=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) % $(call _toint,$(word 2,$1)))) -int-shift-left=$(shell expr $(call _toint,$(word 1, $1)) << $(call _toint,$(word 2, $1))) +int-shift-left=$(shell echo -n $$(($(call _toint,$(word 1, $1)) << $(call _toint,$(word 2, $1))))) int-lt=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) < $(call _toint,$(word 2,$1)))) int-gt=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) > $(call _toint,$(word 2,$1)))) int-eq=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) = $(call _toint,$(word 2,$1))))