From 49fff57a097dfca9e3a090103b4c42a4f3f57a8e Mon Sep 17 00:00:00 2001 From: Jakub Czapiga Date: Wed, 2 Mar 2022 12:18:11 +0100 Subject: [PATCH] libpayload/bin/lpgcc: Make lpgcc provide TPM configuration for vboot TPM1_MODE and TPM2_MODE defines have to be added to vboot and payload cflags to make them build correctly without requiring payloads to provide defines. Signed-off-by: Jakub Czapiga Change-Id: I567a9f04d7089699840dc7e0a063cf3030fb934b Reviewed-on: https://review.coreboot.org/c/coreboot/+/62516 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- payloads/libpayload/bin/lpgcc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/payloads/libpayload/bin/lpgcc b/payloads/libpayload/bin/lpgcc index 8bc46a6580..77ceda3ed9 100755 --- a/payloads/libpayload/bin/lpgcc +++ b/payloads/libpayload/bin/lpgcc @@ -182,6 +182,14 @@ trygccoption -fno-stack-protector _CFLAGS="$_CFLAGS -include $BASE/../include/kconfig.h -include $BASE/../include/compiler.h" _CFLAGS="$_CFLAGS -I`$DEFAULT_CC $_ARCHEXTRA -print-search-dirs | head -n 1 | cut -d' ' -f2`include" +if [ "$CONFIG_LP_VBOOT_LIB" = y ]; then + if [ "$CONFIG_LP_VBOOT_TPM2_MODE" = y ]; then + _CFLAGS="$_CFLAGS -DTPM2_MODE" + else + _CFLAGS="$_CFLAGS -DTPM1_MODE" + fi +fi + _LDFLAGS="-L$_LIBDIR $_LDSCRIPT -static -Wl,--gc-sections" if [ $DOLINK -eq 0 ]; then