From 395f5b3129ad046a220aa4cf975279bfdebc19df Mon Sep 17 00:00:00 2001 From: Jakub Czapiga Date: Wed, 12 Jan 2022 09:59:39 +0000 Subject: libpayload: Install vboot headers and add include paths to lpgcc New CBFS API uses commonlib/bsd/cbfs_serialized.h, which includes vboot's vb2_sha.h. And, because vboot's includes are not available in libpayload's installation directory nor in lpgcc paths, it was causing compilation errors. This patch fixes this issue. lpgcc will look for `vboot` directory like it is doing for `include` directory to create correct paths. However, if payload will be built using libpayload's build dir as a base, then vboot headers from 3rdparty/vboot will be used, as there is no way to pass VBOOT_SOURCE from makefile to lpgcc. Moreover, this patch moves VBOOT_SOURCE to the main Makefile to make it available for installation target, to install headers from vboot directory provided by caller. Change-Id: I68dd7e1545cfcaf24547d8a9fe289447c79da222 Signed-off-by: Jakub Czapiga Reported-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/coreboot/+/61032 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Julius Werner --- payloads/libpayload/bin/lp.functions | 6 ++++++ payloads/libpayload/bin/lpgcc | 3 +++ 2 files changed, 9 insertions(+) (limited to 'payloads/libpayload/bin') diff --git a/payloads/libpayload/bin/lp.functions b/payloads/libpayload/bin/lp.functions index fd26956243d5..d641e699911d 100644 --- a/payloads/libpayload/bin/lp.functions +++ b/payloads/libpayload/bin/lp.functions @@ -63,3 +63,9 @@ if [ -d $BASE/../include ]; then else _INCDIR=$LIBPAYLOAD_PREFIX/include fi + +if [ -d $BASE/../vboot ]; then + _VBOOTINCDIR=$BASE/../vboot/include +else + _VBOOTINCDIR=$LIBPAYLOAD_PREFIX/../vboot/include +fi diff --git a/payloads/libpayload/bin/lpgcc b/payloads/libpayload/bin/lpgcc index a0b736b5e353..2ad9ef525a88 100755 --- a/payloads/libpayload/bin/lpgcc +++ b/payloads/libpayload/bin/lpgcc @@ -169,6 +169,9 @@ if [ $_LIBDIR = $_OBJ ]; then fi _CFLAGS="$_CFLAGS -I$BASE/../../../src/commonlib/bsd/include" + _CFLAGS="$_CFLAGS -I$BASE/../../../3rdparty/vboot/firmware/include" +else + _CFLAGS="$_CFLAGS -I$_VBOOTINCDIR" fi # Check for the -fno-stack-protector silliness -- cgit v1.2.3