[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK7LNATpu5zYwx7kmaknsPGLXt8n8uCXyFpdi5vZeFZiBxYkGw@mail.gmail.com>
Date: Wed, 20 Nov 2024 02:22:37 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Nathan Chancellor <nathan@...nel.org>
Cc: linux-kbuild@...r.kernel.org, Paul Menzel <pmenzel@...gen.mpg.de>,
Borislav Petkov <bp@...en8.de>, Nikolay Borisov <nik.borisov@...e.com>, Marco Elver <elver@...gle.com>,
Josh Poimboeuf <jpoimboe@...nel.org>, Nicolas Schier <nicolas@...sle.eu>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] kbuild: enable objtool for *.mod.o and additional
kernel objects
On Tue, Nov 19, 2024 at 11:27 AM Nathan Chancellor <nathan@...nel.org> wrote:
>
> 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@...nel.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
Good catch!
I will squash the attached diff.
Thank you.
--
Best Regards
Masahiro Yamada
Download attachment "0001-fixup.patch" of type "application/x-patch" (1770 bytes)
Powered by blists - more mailing lists