mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 08:03:01 +09:00
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:913f7e93daLink:4a8b124930Link: https://lkml.kernel.org/r/20230717-enable-kasan-lto1-v3-1-650e1efc19d1@gmail.com Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Jakob Koschel <jkl820.git@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Cc: Kees Cook <keescook@chromium.org> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Tom Rix <trix@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
d9efb07dcb
commit
349fde599d
@@ -732,7 +732,9 @@ config HAS_LTO_CLANG
|
|||||||
depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
|
depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
|
||||||
depends on ARCH_SUPPORTS_LTO_CLANG
|
depends on ARCH_SUPPORTS_LTO_CLANG
|
||||||
depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
|
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
|
depends on !GCOV_KERNEL
|
||||||
help
|
help
|
||||||
The compiler and Kconfig options support building with Clang's
|
The compiler and Kconfig options support building with Clang's
|
||||||
|
|||||||
Reference in New Issue
Block a user