summaryrefslogtreecommitdiff
authorNick Desaulniers <ndesaulniers@google.com>2018-04-26 21:28:07 (GMT)
committer Tri Vo <trong@google.com>2019-05-23 23:51:33 (GMT)
commit8d921693f626f9132ba5c2f2c8704bc813507b75 (patch)
tree1079d05ad1b7cbaf93474bc4ed90f01c70922404
parent8e2c08d176f9d6e20881b3a5647f53a773458a41 (diff)
downloadcommon-8d921693f626f9132ba5c2f2c8704bc813507b75.zip
common-8d921693f626f9132ba5c2f2c8704bc813507b75.tar.gz
common-8d921693f626f9132ba5c2f2c8704bc813507b75.tar.bz2
BACKPORT: kbuild: gcov: enable -fno-tree-loop-im if supported
Clang does not recognize this compiler option. Reported-by: Prasad Sodagudi <psodagud@codeaurora.org> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> (cherry picked from commit c64ba044ed57ea72cc1c7b14a8dcfb6ded5a759c) Bug: 122733725 Test: defconfig + CONFIG_GCOV_KERNEL records coverage Change-Id: I334ebf83a9209d1e4a3e29ee12279f36f7afecdd
Diffstat
-rw-r--r--Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 1ca6a72..4d60703 100644
--- a/Makefile
+++ b/Makefile
@@ -636,7 +636,9 @@ all: vmlinux
KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
KBUILD_AFLAGS += $(call cc-option,-fno-PIE)
-CFLAGS_GCOV := -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
+CFLAGS_GCOV := -fprofile-arcs -ftest-coverage \
+ $(call cc-option,-fno-tree-loop-im) \
+ $(call cc-disable-warning,maybe-uninitialized,)
CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,)
export CFLAGS_GCOV CFLAGS_KCOV