Re: [PATCH] kbuild: pass jobserver to cmd_ld_vmlinux.o

From: Jiri Slaby
Date: Tue Jun 21 2022 - 03:32:39 EST


On 17. 06. 22, 18:32, Nick Desaulniers wrote:
On Fri, Jun 17, 2022 at 3:35 AM Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:

On Fri, Jun 17, 2022 at 12:53 AM Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:

On Thu, Jun 16, 2022 at 4:09 PM Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:

On Thu, Jun 16, 2022 at 12:45 PM Jiri Slaby <jslaby@xxxxxxx> wrote:

Until the link-vmlinux.sh split (cf. the commit below), the linker was
run with jobserver set in MAKEFLAGS. After the split, the command in
Makefile.vmlinux_o is not prefixed by "+" anymore, so this information
is lost.

Restore it as linkers working in parallel (esp. the LTO ones) make a use
of it.

TBH, I agree with Masahiro. I didn't understand this comment "esp. the
LTO ones." Jiri, can you clarify what you mean here?

Sure. clang is not the only compiler/linker that can handle kernel ;). So while rebasing gcc-LTO-kernel-patches to 5.19-rc (to upstream them later), this broke. See:
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/lto-wrapper.cc;h=26e06e77be4e0afb2bc3e913062a9c51cab5d205;hb=HEAD#l1336

gcc really parses MAKEFLAGS and looks for "--jobserver-auth=" there, if one passes specifies -flto=jobserver.

thanks,
--
js
suse labs