aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Koschel <[email protected]>2023-07-19 00:29:12 +0200
committerAndrew Morton <[email protected]>2023-08-18 10:18:56 -0700
commit349fde599db65d4827820ef6553e3f9ee75b8c7c (patch)
tree39267351bb36b0e555f57001c0b0f9e6b2df9e79
parentd9efb07dcb69a1e0428602597ececad34f3c717b (diff)
arch: enable HAS_LTO_CLANG with KASAN and KCOV
Both KASAN and KCOV had issues with LTO_CLANG if DEBUG_INFO is enabled. With LTO inlinable function calls are required to have debug info if they are inlined into a function that has debug info. Starting with LLVM 17 this will be fixed ([1],[2]) and enabling LTO with KASAN/KCOV and DEBUG_INFO doesn't cause linker errors anymore. Link: https://github.com/llvm/llvm-project/commit/913f7e93dac67ecff47bade862ba42f27cb68ca9 Link: https://github.com/llvm/llvm-project/commit/4a8b1249306ff11f229320abdeadf0c215a00400 Link: https://lkml.kernel.org/r/[email protected] Reviewed-by: Nathan Chancellor <[email protected]> Signed-off-by: Jakob Koschel <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Cc: Kees Cook <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Tom Rix <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--arch/Kconfig4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index b2872e9d3760..94050a3f094e 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -732,7 +732,9 @@ config HAS_LTO_CLANG
depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
depends on ARCH_SUPPORTS_LTO_CLANG
depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
- depends on !KASAN || KASAN_HW_TAGS
+ # https://github.com/ClangBuiltLinux/linux/issues/1721
+ depends on (!KASAN || KASAN_HW_TAGS || CLANG_VERSION >= 170000) || !DEBUG_INFO
+ depends on (!KCOV || CLANG_VERSION >= 170000) || !DEBUG_INFO
depends on !GCOV_KERNEL
help
The compiler and Kconfig options support building with Clang's