summaryrefslogtreecommitdiff
path: root/payloads/libpayload/bin/lpgcc
diff options
context:
space:
mode:
authorJakub Czapiga <jacz@semihalf.com>2022-03-02 12:18:11 +0100
committerJulius Werner <jwerner@chromium.org>2022-03-03 22:38:59 +0000
commit49fff57a097dfca9e3a090103b4c42a4f3f57a8e (patch)
tree3f89feacfefbe3d09ae6b9cdd49513f6aa1f3493 /payloads/libpayload/bin/lpgcc
parentafaee235fa0b35ac7272c3dab3a74d272bc1bd8c (diff)
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 <jacz@semihalf.com> Change-Id: I567a9f04d7089699840dc7e0a063cf3030fb934b Reviewed-on: https://review.coreboot.org/c/coreboot/+/62516 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'payloads/libpayload/bin/lpgcc')
-rwxr-xr-xpayloads/libpayload/bin/lpgcc8
1 files changed, 8 insertions, 0 deletions
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