2022-10-25 09:04:22

by kernel test robot

[permalink] [raw]
Subject: ld.lld: error: undefined symbol: __kcfi_typeid_ftrace_stub_graph

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a970174d7a1010cb29a5b0c9fa0626abdefcfcbe
commit: 883bbbffa5a4ffd1915f8b42934dab81b7f87226 ftrace,kcfi: Separate ftrace_stub() and ftrace_stub_graph()
date: 5 days ago
config: arm64-randconfig-r011-20221025
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=883bbbffa5a4ffd1915f8b42934dab81b7f87226
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 883bbbffa5a4ffd1915f8b42934dab81b7f87226
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

>> 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

--
0-DAY CI Kernel Test Service
https://01.org/lkp


Attachments:
(No filename) (1.65 kB)
config (182.03 kB)
Download all attachments

2022-10-26 16:26:02

by Sami Tolvanen

[permalink] [raw]
Subject: Re: ld.lld: error: undefined symbol: __kcfi_typeid_ftrace_stub_graph

On Tue, Oct 25, 2022 at 1:22 AM kernel test robot <[email protected]> wrote:
> >> 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

We don't seem to have any C translation units that would take the
address of ftrace_stub_graph with this config, which means the
compiler won't generate the __kcfi_typeid_ftrace_stub_graph symbol.
Adding __ADDRESSABLE(ftrace_stub_graph) to a suitable place would fix
this issue, perhaps somewhere in arch/arm64/kernel/ftrace.c?

Sami