[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220527153154.hivyahzjz3txouoi@treble>
Date: Fri, 27 May 2022 08:31:54 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Josh Poimboeuf <jpoimboe@...hat.com>, llvm@...ts.linux.dev,
Helge Deller <deller@....de>, linux-parisc@...r.kernel.org,
Nicolas Schier <nicolas@...sle.eu>,
Nathan Chancellor <nathan@...nel.org>,
Sami Tolvanen <samitolvanen@...gle.com>,
Sedat Dilek <sedat.dilek@...il.com>,
Michal Marek <michal.lkml@...kovi.net>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Tom Rix <trix@...hat.com>
Subject: Re: [PATCH v7 2/8] kbuild: do not create *.prelink.o for Clang LTO
or IBT
On Fri, May 27, 2022 at 07:01:49PM +0900, Masahiro Yamada wrote:
> New build flow
> ==============
>
> [1] single-object module
>
> Since there is only one object, there is no need to keep the LLVM IR.
> Use $(CC)+$(LD) to generate an ELF object in one build rule. When LTO
> is disabled, $(LD) is unneeded because $(CC) produces an ELF object.
>
> $(CC)+$(LD)+objtool $(LD)
> foo.c ----------------------------> foo.o ---------> foo.ko
> (ELF) |
> |
> foo.mod.o --/
>
> [2] multi-object module
>
> Previously, $(AR) was used to combine LLVM bitcode into an archive,
> but there was no technical reason to do so. Use $(LD) to merge them
> into a single ELF object.
>
> $(LD)
> $(CC) +objtool $(LD)
> foo1.c ---------> foo1.o ---------> foo.o ---------> foo.ko
> | (ELF) |
> foo2.c ---------> foo2.o ----/ |
> (LLVM IR) foo.mod.o --/
>
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> Reviewed-by: Nicolas Schier <nicolas@...sle.eu>
> Tested-by: Nathan Chancellor <nathan@...nel.org>
> Reviewed-by: Sami Tolvanen <samitolvanen@...gle.com>
> Tested-by: Sedat Dilek <sedat.dilek@...il.com> # LLVM-14 (x86-64)
Acked-by: Josh Poimboeuf <jpoimboe@...nel.org>
--
Josh
Powered by blists - more mailing lists