mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
ANDROID: 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: 145210207 Change-Id: Ib77f7c431fce54243c46d584b55761ed2342965c Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
This commit is contained in:
parent
2e39b40dd2
commit
d671af5fd7
9 changed files with 52 additions and 5 deletions
|
|
@ -41,6 +41,10 @@ ifdef CONFIG_LTO_CLANG
|
|||
echo -T $(@:.ko=.o.symversions)) \
|
||||
-o $@ --whole-archive $(filter %.o, $^); \
|
||||
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
|
||||
|
||||
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