Message ID | 20220413181420.3522187-1-nathan@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | arm64: Improve HAVE_DYNAMIC_FTRACE_WITH_REGS selection for clang | expand |
On Wed, 13 Apr 2022 11:14:21 -0700, Nathan Chancellor wrote: > Will and Anders reported that using just 'CC=clang' with CONFIG_FTRACE=y > and CONFIG_STACK_TRACER=y would result in an error while linking: > > aarch64-linux-gnu-ld: .init.data has both ordered [`__patchable_function_entries' in init/main.o] and unordered [`.meminit.data' in mm/sparse.o] sections > aarch64-linux-gnu-ld: final link failed: bad value > > This error was exposed by commit f12b034afeb3 ("scripts/Makefile.clang: > default to LLVM_IAS=1") in combination with binutils older than 2.36. > > [...] Applied to arm64 (for-next/fixes), thanks! [1/1] arm64: Improve HAVE_DYNAMIC_FTRACE_WITH_REGS selection for clang https://git.kernel.org/arm64/c/45bd8951806e Cheers,
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 57c4c995965f..1fd16faa7f31 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -175,8 +175,6 @@ config ARM64 select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_CONTIGUOUS select HAVE_DYNAMIC_FTRACE - select HAVE_DYNAMIC_FTRACE_WITH_REGS \ - if $(cc-option,-fpatchable-function-entry=2) select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY \ if DYNAMIC_FTRACE_WITH_REGS select HAVE_EFFICIENT_UNALIGNED_ACCESS @@ -228,6 +226,17 @@ config ARM64 help ARM 64-bit (AArch64) Linux support. +config CLANG_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS + def_bool CC_IS_CLANG + # https://github.com/ClangBuiltLinux/linux/issues/1507 + depends on AS_IS_GNU || (AS_IS_LLVM && (LD_IS_LLD || LD_VERSION >= 23600)) + select HAVE_DYNAMIC_FTRACE_WITH_REGS + +config GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS + def_bool CC_IS_GCC + depends on $(cc-option,-fpatchable-function-entry=2) + select HAVE_DYNAMIC_FTRACE_WITH_REGS + config 64BIT def_bool y