From 5f5334aba74e821d79b95dbdc2d333850d5ec604 Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Mon, 8 Jun 2020 14:18:21 -0700 Subject: [PATCH] ANDROID: arm64: disable BTI with CFI for Clang <12 Older versions of Clang didn't generate BTI instructions for the compiler-generated CFI check functions. As CFI provides a more fine-grained control-flow checking then BTI, disable BTI when CFI is enabled and we're using Clang <12. Bug: 145210207 Change-Id: I248bc761443e4f354cf4dfbfc3db0fc22385ce63 Link: https://bugs.llvm.org/show_bug.cgi?id=46258 Signed-off-by: Sami Tolvanen --- arch/arm64/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index ad1274cd135d..7a6914fdfcb7 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1627,6 +1627,8 @@ config ARM64_BTI_KERNEL # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697 depends on !CC_IS_GCC || GCC_VERSION >= 100100 depends on !(CC_IS_CLANG && GCOV_KERNEL) + # https://bugs.llvm.org/show_bug.cgi?id=46258 + depends on !CFI_CLANG || CLANG_VERSION >= 120000 depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS) help Build the kernel with Branch Target Identification annotations