]> git.baikalelectronics.ru Git - kernel.git/commit
kbuild: lto: postpone objtool
authorSami Tolvanen <samitolvanen@google.com>
Mon, 13 Apr 2020 23:10:13 +0000 (16:10 -0700)
committerKees Cook <keescook@chromium.org>
Tue, 23 Feb 2021 20:46:57 +0000 (12:46 -0800)
commit9d444b12cfd78fefbca2a0d64dc9e1e29ca696bf
tree4c6672f8aa90443585f2ceb4cb4e65425d800c6a
parent3b585a0d633e822843fef55f5961acbcf5512229
kbuild: lto: postpone objtool

With LTO, LLVM bitcode won't be compiled into native code until
modpost_link, or modfinal for modules. This change postpones calls
to objtool until after these steps, and moves objtool_args to
Makefile.lib, so the arguments can be reused in Makefile.modfinal.

As we didn't have objects to process earlier, we use --duplicate
when processing vmlinux.o. This change also disables unreachable
instruction warnings with LTO to avoid warnings about the int3
padding between functions.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
scripts/Makefile.build
scripts/Makefile.lib
scripts/Makefile.modfinal
scripts/link-vmlinux.sh