summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2017-07-13 11:47:19 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-07-14 09:44:37 -0700
commitcb7e26c99399e1655c574adb2ab5dfdacf70193c (patch)
treea63a86e68190f22deea74ccbf38cbe565a217052 /util
parent98a1d2f9c731968e0258d8614b0a83d34391f222 (diff)
downloadchrome-ec-cb7e26c99399e1655c574adb2ab5dfdacf70193c.tar.gz
genvif: Prevent undefined referencer when using APIs not provided by genvif
Problem was detected while using ccprintf to debug a data role swap requests issue. To prevent errors similar to this, surround the API call as follows: ifndef VIF_BUILD ccprints("I won't generate an undefined reference when building genvif"); endif BUG=b:63664511 BRANCH=None TEST=`make -j buildall` Change-Id: Ieab9eaa638320cae67995a67c843d08b54acfbcb Signed-off-by: Sam Hurst <shurst@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/570820 Commit-Ready: Sam Hurst <shurst@google.com> Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'util')
-rw-r--r--util/build.mk3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/build.mk b/util/build.mk
index a9e1a040ab..8708c0eb89 100644
--- a/util/build.mk
+++ b/util/build.mk
@@ -31,7 +31,8 @@ $(out)/util/genvif: $(out)/util/usb_pd_policy.o board/$(BOARD)/board.h \
include/usb_pd.h include/usb_pd_tcpm.h
$(out)/util/genvif: BUILD_LDFLAGS+=$(out)/util/usb_pd_policy.o -flto
-STANDALONE_FLAGS=-ffreestanding -fno-builtin -nostdinc -Ibuiltin/ -D"__keep= "
+STANDALONE_FLAGS=-ffreestanding -fno-builtin -nostdinc \
+ -Ibuiltin/ -D"__keep= " -DVIF_BUILD
$(out)/util/usb_pd_policy.o: board/$(BOARD)/usb_pd_policy.c
$(call quiet,c_to_vif,BUILDCC)
deps += $(out)/util/usb_pd_policy.o.d