From cb7e26c99399e1655c574adb2ab5dfdacf70193c Mon Sep 17 00:00:00 2001 From: Sam Hurst Date: Thu, 13 Jul 2017 11:47:19 -0700 Subject: [PATCH] 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 Reviewed-on: https://chromium-review.googlesource.com/570820 Commit-Ready: Sam Hurst Tested-by: Sam Hurst Reviewed-by: Shawn N --- util/build.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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