From e02a19a6c26259c40d655665e990cc4dbee46dc1 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Tue, 17 Jan 2017 16:36:34 -0800 Subject: vboot: fix compiling with DEBUG=1 If FOR_TEST is defined, 2common.h defines VB2_DEBUG() to be printf(); it should include stdio.h as well. The HOSTLIB extern linktest links against the vboot1 stub functions, but not the vboot2 stub functions, so it couldn't find vb2ex_printf(). BUG=chromium:682058 BRANCH=none TEST=DEBUG=1 make runtests; DEBUG=1 emerge-reef vboot_reference depthcharge Change-Id: Ibf981a70ca4087ce3d86b02d76e03063b2cfc9e5 Signed-off-by: Randall Spangler Reviewed-on: https://chromium-review.googlesource.com/429310 Commit-Ready: Shelley Chen Reviewed-by: Shelley Chen --- Makefile | 1 + firmware/2lib/include/2common.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Makefile b/Makefile index a84c477b..29cba202 100644 --- a/Makefile +++ b/Makefile @@ -493,6 +493,7 @@ HOSTLIB_SRCS = \ cgpt/cgpt_create.c \ cgpt/cgpt_prioritize.c \ firmware/2lib/2crc8.c \ + firmware/2lib/2stub.c \ firmware/lib/cgptlib/cgptlib_internal.c \ firmware/lib/cgptlib/crc32.c \ firmware/lib/gpt_misc.c \ diff --git a/firmware/2lib/include/2common.h b/firmware/2lib/include/2common.h index 39c8caff..4ce6f6f8 100644 --- a/firmware/2lib/include/2common.h +++ b/firmware/2lib/include/2common.h @@ -31,6 +31,7 @@ struct vb2_public_key; /* Debug output printf() for tests. Otherwise, it's platform-dependent. */ #if defined(VBOOT_DEBUG) # if defined(FOR_TEST) +# include # define VB2_DEBUG(format, args...) printf(format, ## args) # else # define VB2_DEBUG(format, args...) vb2ex_printf(__func__, format, ## args) -- cgit v1.2.1