mirror of
https://github.com/a52xq-dev/kernel.git
synced 2026-10-18 21:58:11 +07:00
FROMLIST: kbuild: fix dynamic ftrace with clang LTO
With CONFIG_LTO_CLANG enabled, LLVM IR won't be compiled into object files until modpost_link. This change postpones calls to recordmcount until after this step. In order to exclude ftrace_process_locs from inspection, we add a new code section .text..ftrace, which we tell recordmcount to ignore, and a __norecordmcount attribute for moving functions to this section. Bug: 62093296 Bug: 67506682 Bug: 133186739 Change-Id: Iba2c053968206acf533fadab1eb34a743b5088ee (am from https://patchwork.kernel.org/patch/10060327/) Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
This commit is contained in:
parent
0e0752ebd2
commit
c274f8308e
1 changed files with 53 additions and 6 deletions
|
|
@ -143,6 +143,10 @@ ifdef CONFIG_LTO_CLANG
|
|||
echo -T $(@:.ko=.o.symversions)) \
|
||||
-o $@ --whole-archive \
|
||||
$(filter-out FORCE,$(^:$(modpost-ext).o=.o))
|
||||
|
||||
ifdef CONFIG_FTRACE_MCOUNT_RECORD
|
||||
cmd_ld_ko_o += ; $(objtree)/scripts/recordmcount $(RECORDMCOUNT_FLAGS) $@
|
||||
endif
|
||||
else
|
||||
cmd_ld_ko_o = \
|
||||
$(LD) -r $(KBUILD_LDFLAGS) \
|
||||
|
|
|
|||
Loading…
Reference in a new issue