From e675b8a59a1bab2b0ddc0027607f1fbc0a6dc7d9 Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Mon, 12 Oct 2020 14:17:56 -0700 Subject: [PATCH] ANDROID: kbuild: disable GCOV with CFI With GCOV enabled, LLVM generates calls to compiler-generated __llvm_gcov_* functions, but doesn't add them to the CFI jump table, which trips indirect call checking. Work around the issue by disabling CFI when GCOV_KERNEL is enabled. Bug: 169124292 Change-Id: Ifd60cd9eda2bcdd86838ac5ce41bb0dbc00d602f Signed-off-by: Sami Tolvanen (cherry picked from commit 93a4197bc23a4a6967ff0592d07f3cf4cd69b1d6) --- arch/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/Kconfig b/arch/Kconfig index e2465e92ca21..d53afd0c8323 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -605,6 +605,7 @@ endchoice config CFI_CLANG bool "Use Clang's Control Flow Integrity (CFI)" depends on LTO_CLANG && KALLSYMS + depends on !GCOV_KERNEL help This option enables Clang's Control Flow Integrity (CFI), which adds runtime checking for indirect function calls.