linux/arch/arm64
Sami Tolvanen 2598ac6ec4 arm64: ftrace: Define ftrace_stub_graph only with FUNCTION_GRAPH_TRACER
The 0-day bot reports that arm64 builds with CONFIG_CFI_CLANG +
CONFIG_FTRACE are broken when CONFIG_FUNCTION_GRAPH_TRACER is not
enabled:

 ld.lld: error: undefined symbol: __kcfi_typeid_ftrace_stub_graph
 >>> referenced by entry-ftrace.S:299 (arch/arm64/kernel/entry-ftrace.S:299)
 >>>               arch/arm64/kernel/entry-ftrace.o:(.text+0x48) in archive vmlinux.a

This is caused by ftrace_stub_graph using SYM_TYPE_FUNC_START when
the address of the function is not taken in any C translation unit.

Fix the build by only defining ftrace_stub_graph when it's actually
needed, i.e. with CONFIG_FUNCTION_GRAPH_TRACER.

Link: https://lore.kernel.org/lkml/202210251659.tRMs78RH-lkp@intel.com/
Fixes: 883bbbffa5 ("ftrace,kcfi: Separate ftrace_stub() and ftrace_stub_graph()")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/20221109192831.3057131-1-samitolvanen@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2022-11-14 12:28:52 +00:00
..
boot Armv8 Juno fix for v6.1 2022-11-02 21:58:46 +01:00
configs This update includes the following changes: 2022-10-10 13:04:25 -07:00
crypto This update includes the following changes: 2022-10-10 13:04:25 -07:00
hyperv hyperv: simplify and rename generate_guest_id 2022-09-28 13:36:56 +00:00
include Second batch of EFI fixes for v6.1 2022-11-04 14:37:25 -07:00
kernel arm64: ftrace: Define ftrace_stub_graph only with FUNCTION_GRAPH_TRACER 2022-11-14 12:28:52 +00:00
kvm KVM: arm64: Fix SMPRI_EL1/TPIDR2_EL0 trapping on VHE 2022-11-01 15:56:52 +00:00
lib Networking changes for 6.0. 2022-08-03 16:29:08 -07:00
mm arm64: efi: Recover from synchronous exceptions occurring in firmware 2022-11-03 18:01:15 +01:00
net bpf: arm64: No support of struct argument in trampoline programs 2022-09-06 19:51:14 -07:00
tools arm64/sysreg: Fix typo in SCTR_EL1.SPINTMASK 2022-10-07 14:30:11 +01:00
xen
Kbuild
Kconfig arm64 fixes: 2022-10-14 12:38:03 -07:00
Kconfig.debug
Kconfig.platforms ARM: SoC code changes for 6.1 2022-10-06 11:22:25 -07:00
Makefile Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00