ARM: disable FUNCTION_TRACER when building with Clang
PATCH 1/1 ARM: disable FUNCTION_TRACER when building with Clang
Clang needs "-meabi gnu" flag to emit calls to "__gnu_mcount_nc". Otherwise, it inserts calls to undefined "mcount".
kernel/softirq.o: In function `_local_bh_enable':
...
undefined reference to `mcount'
"-meabi gnu" resolves link failures. However, Clang does not implement calls to "__gnu_mcount_nc" correctly. It does not save the link register on the stack, which corrupts the stack. The resulting kernel does not boot.
Disable FUNCTION_TRACER support when building with Clang.
Suggested-by Stefan Agner <[email protected]>
Signed-off-by Tri Vo <[email protected]>
--- arch/arm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/Kconfig +1 -1
@@ -75,7 +75,7 @@ config ARM select HAVE_EXIT_THREAD select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL && !CC_IS_CLANG - select HAVE_FUNCTION_TRACER if !XIP_KERNEL + select HAVE_FUNCTION_TRACER if !XIP_KERNEL && !CC_IS_CLANG select HAVE_GCC_PLUGINS select HAVE_HW_BREAKPOINT if PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7) select HAVE_IDE if PCI || ISA || PCMCIA
Signature · 1 line
2.21.0.1020.gf2820cf01a-goog