From: Nathan Chancellor <nathan@kernel.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org, Paul Menzel <pmenzel@molgen.mpg.de>,
Borislav Petkov <bp@alien8.de>,
Nikolay Borisov <nik.borisov@suse.com>,
Marco Elver <elver@google.com>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Nicolas Schier <nicolas@fjasle.eu>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] kbuild: enable objtool for *.mod.o and additional kernel objects
Date: Mon, 18 Nov 2024 19:27:30 -0700 [thread overview]
Message-ID: <20241119022730.GA2908286@thelio-3990X> (raw)
In-Reply-To: <20241113234526.402738-3-masahiroy@kernel.org>
Hi Masahiro,
On Thu, Nov 14, 2024 at 08:45:22AM +0900, Masahiro Yamada wrote:
> Currently, objtool is disabled in scripts/Makefile.{modfinal,vmlinux}.
>
> This commit moves rule_cc_o_c and rule_as_o_S to scripts/Makefile.lib
> and set objtool-enabled to y there.
>
> With this change, *.mod.o, .module-common.o, builtin-dtb.o, and
> vmlinux.export.o will now be covered by objtool.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
I am seeing some build failures when LTO is enabled with this change in
-next as commit d8d3f6c6690c ("kbuild: enable objtool for *.mod.o and
additional kernel objects").
$ printf 'CONFIG_LTO_%s\n' NONE=n CLANG_THIN=y >kernel/configs/thinlto.config
$ make -skj"$(nproc)" ARCH=x86_64 LLVM=1 mrproper {def,thinlto.}config all
...
.vmlinux.export.o: warning: objtool: gelf_getehdr: invalid `Elf' handle
make[4]: *** [scripts/Makefile.vmlinux:13: .vmlinux.export.o] Error 1
...
When LTO is enabled, these files are LLVM bitcode, not ELF, so objtool
can't process them:
$ file .vmlinux.export.o
.vmlinux.export.o: LLVM IR bitcode
Cheers,
Nathan
next prev parent reply other threads:[~2024-11-19 2:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 23:45 [PATCH 0/3] kbuild: enable objtool for more objects and re-enable KCSAN for *.mod.o Masahiro Yamada
2024-11-13 23:45 ` [PATCH 1/3] kbuild: move cmd_cc_o_c and cmd_as_o_S to scripts/Malefile.lib Masahiro Yamada
2024-11-16 9:19 ` Masahiro Yamada
2024-11-13 23:45 ` [PATCH 2/3] kbuild: enable objtool for *.mod.o and additional kernel objects Masahiro Yamada
2024-11-19 2:27 ` Nathan Chancellor [this message]
2024-11-19 17:22 ` Masahiro Yamada
2024-11-13 23:45 ` [PATCH 3/3] kbuild: re-enable KCSAN for autogenerated *.mod.c intermediaries Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241119022730.GA2908286@thelio-3990X \
--to=nathan@kernel.org \
--cc=bp@alien8.de \
--cc=elver@google.com \
--cc=jpoimboe@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nicolas@fjasle.eu \
--cc=nik.borisov@suse.com \
--cc=pmenzel@molgen.mpg.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox