kbuild: gcov: enable -fno-tree-loop-im if supported
authorNick Desaulniers <ndesaulniers@google.com>
Thu, 26 Apr 2018 21:28:07 +0000 (14:28 -0700)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 17 May 2018 13:35:30 +0000 (22:35 +0900)
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>
Makefile

index d0d2652..ba09085 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -623,7 +623,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,)
 export CFLAGS_GCOV CFLAGS_KCOV
 
 # The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default