summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHsuan Ting Chen <roccochen@chromium.org>2022-07-12 15:39:23 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-13 16:55:15 +0000
commit800f5de9662b2a7345e0f56dd070a11b9d4526bc (patch)
treedc089e0b5695b4e9c096c60dd8cc83efdda80597
parent6d74ce8a95a3a0ed8adb41bde3172f5d7db96f64 (diff)
downloadvboot-800f5de9662b2a7345e0f56dd070a11b9d4526bc.tar.gz
Makefile: coverage: Fix build failure
Currently, make coverage is broken due to two issues: 1. The optimization option -O0 ignores the inline specifier in firmware/2lib/2sha256_x86.c:46 and 52. This will violate the compile-time constraint "i" and cause a build failure. Fix this issue by using -Og instead of -O0. 2. The coverage_html requires ${COV_INFO}.* files which are generated in coverage_init and runtests. We need to add prerequisites to prevent potential errors while running with "-j". BUG=none BRANCH=none TEST=make clean && COV=1 make coverage -j Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Change-Id: If1f9de1dbc56f36afead9045c1f95349a5fa156c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3755927 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
-rw-r--r--Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index b6ab96b4..afb6e911 100644
--- a/Makefile
+++ b/Makefile
@@ -237,7 +237,7 @@ CFLAGS += $(cflags_use_64bits)
# Code coverage
ifneq ($(filter-out 0,${COV}),)
- COV_FLAGS = -O0 --coverage -DCOVERAGE
+ COV_FLAGS = -Og --coverage -DCOVERAGE
CFLAGS += ${COV_FLAGS}
LDFLAGS += ${COV_FLAGS}
COV_INFO = ${BUILD}/coverage.info
@@ -1354,7 +1354,7 @@ coverage_init: install_for_test
lcov -c -i -d . -b . -o ${COV_INFO}.initial
.PHONY: coverage_html
-coverage_html:
+coverage_html: coverage_init runtests
lcov -c -d . -b . -o ${COV_INFO}.tests
lcov -a ${COV_INFO}.initial -a ${COV_INFO}.tests -o ${COV_INFO}.total
lcov -r ${COV_INFO}.total '/usr/*' -o ${COV_INFO}.local