Skip to content

Commit

Permalink
ANDROID: arm64: disable BTI with CFI for Clang <12
Browse files Browse the repository at this point in the history
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 <samitolvanen@google.com>
  • Loading branch information
samitolvanen authored and adelva1984 committed Jan 14, 2021
1 parent 2df99b6 commit 5f5334a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5f5334a

Please sign in to comment.