summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2021-09-20 16:12:32 -0600
committerCommit Bot <commit-bot@chromium.org>2021-09-27 20:23:23 +0000
commitc3fb51caf35a068e4030fc95ec65c20de7c789ce (patch)
tree76c53c6649c32e016ede66d67b79420ff3e60883
parent12683de751a5b00a9dea2146313cc25dae86182f (diff)
downloadchrome-ec-c3fb51caf35a068e4030fc95ec65c20de7c789ce.tar.gz
ec: Set GCOV tool for cross compile
Use the right gcov tool for cross compile and host builds. The llvm-cov tool is sort of magical and can handle both llvm and gcc output, but that is only in the chroot, and so on gitlab we need to pick the right gcov for each platform. BRANCH=None BUG=None TEST=in docker: make -j CRYPTOC_DIR="${MODULES_DIR}/cryptoc" \ FTDIVERSION=1 HOSTGCOV='gcov' \ CROSS_COMPILE_arm=/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi- \ coverage Change-Id: Ie95032a4c0706b2bd49574df03e93dcbec7c3eed Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3171942 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
-rw-r--r--Makefile.rules4
-rw-r--r--Makefile.toolchain2
2 files changed, 4 insertions, 2 deletions
diff --git a/Makefile.rules b/Makefile.rules
index a02a89f3be..be7885a198 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -409,10 +409,10 @@ bldversion=$(shell (./util/getversion.sh ; echo VERSION) | $(CPP) -P -)
# lcov fails when multiple instances run at the same time.
# We need to run them sequentially by using flock
cmd_lcov=flock /tmp/ec-lcov-lock -c "lcov --gcov-tool \
- $(CURDIR)/util/llvm-gcov.sh -q -o $@ -c -d build/coverage/$* -t $* \
+ $(HOSTGCOV) -q -o $@ -c -d build/coverage/$* -t $* \
--exclude '*/ec/test/*' --exclude '*/ec/include/tests/*'"
cmd_lcov-initial=flock /tmp/ec-lcov-lock -c "lcov --gcov-tool \
- $(CURDIR)/util/llvm-gcov.sh -q -o $@ -c -d build/coverage/initial-$* \
+ $(GCOV) -q -o $@ -c -d build/coverage/initial-$* \
-i -t $* --exclude '*/ec/test/*' --exclude '*/ec/include/tests/*'"
cmd_merge_cov=lcov -o build/coverage/lcov.info $(foreach info,$^,-a ${info})
cmd_report_cov=genhtml -q -o build/coverage/coverage_rpt -t \
diff --git a/Makefile.toolchain b/Makefile.toolchain
index fbd6af1276..ecfaeb6dd6 100644
--- a/Makefile.toolchain
+++ b/Makefile.toolchain
@@ -47,6 +47,8 @@ HOSTCC?=$(CCACHE) $(HOST_CROSS_COMPILE)gcc
HOSTCXX?=$(CCACHE) $(HOST_CROSS_COMPILE)clang++
HOST_PKG_CONFIG?=$(HOST_CROSS_COMPILE)pkg-config
PROTOC?=protoc
+GCOV=$(CROSS_COMPILE)gcov
+HOSTGCOV=$(CURDIR)/util/llvm-gcov.sh
C_WARN = -Wstrict-prototypes -Wdeclaration-after-statement -Wno-pointer-sign
COMMON_WARN = -Wall -Wundef -Werror -Werror-implicit-function-declaration \