[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e1261036-238a-513c-1b6d-fa4f47e6edb2@suse.cz>
Date: Tue, 20 Sep 2022 14:34:47 +0200
From: Martin Liška <mliska@...e.cz>
To: Jiri Slaby <jirislaby@...nel.org>,
Masahiro Yamada <masahiroy@...nel.org>
Cc: Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Sedat Dilek <sedat.dilek@...il.com>,
Michal Marek <michal.lkml@...kovi.net>,
Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: [PATCH v2 2/2] kbuild: lto: preserve MAKEFLAGS for module linking
On 9/20/22 10:06, Jiri Slaby wrote:
> On 19. 07. 22, 11:15, Masahiro Yamada wrote:
>> On Tue, Jul 19, 2022 at 5:41 PM Jiri Slaby <jslaby@...e.cz> wrote:
>>>
>>> From: Martin Liska <mliska@...e.cz>
>>>
>>> Prefix command in makefile run in order to preserve access to jobserver.
>>> This is needed for gcc at least.
>>>
>>> Fixes this warning:
>>> lto-wrapper: warning: jobserver is not available: ‘--jobserver-auth=’ is not present in ‘MAKEFLAGS’
>>
>>
>> What is lto-wrapper ?
>
> lto-wrapper is a part of gcc:
> https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/lto-wrapper.cc
>
> And is invoked during the link of LTO objects (also to link in parallel if jobserver is available).
Yes, it's a driver that is invoked by Linker when it decides to use LTO mode in GCC compiler.
Later on the lto-wrapper connects to make's jobserver and runs in parallel. Note a recent [1]
make implemented named pipes when it comes to communication with jobserver. And thus the '+'
won't be needed in the future, but we need it for now.
Cheers,
Martin
[1] https://git.savannah.gnu.org/cgit/make.git/commit/?id=7ad2593b2d2bb5b9332f4444d8bf93ac6f958bc6
>
> I am leaving the unanswered questions below for Martin to answer.
>
>>> Cc: Sedat Dilek <sedat.dilek@...il.com>
>>> Cc: Masahiro Yamada <masahiroy@...nel.org>
>>> Cc: Michal Marek <michal.lkml@...kovi.net>
>>> Cc: Nick Desaulniers <ndesaulniers@...gle.com>
>>> Fixes: 5d45950dfbb1 (kbuild: move vmlinux.o link to scripts/Makefile.vmlinux_o)
>>> Signed-off-by: Martin Liska <mliska@...e.cz>
>>> Signed-off-by: Jiri Slaby <jslaby@...e.cz>
>>> ---
>>>
>>> Notes:
>>> [v2] this is new in v2
>>>
>>> scripts/Makefile.build | 6 +++---
>>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
>>> index bb63374fb055..493f3c4e8461 100644
>>> --- a/scripts/Makefile.build
>>> +++ b/scripts/Makefile.build
>>> @@ -247,8 +247,8 @@ endef
>>>
>>> # Built-in and composite module parts
>>> $(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE
>>> - $(call if_changed_rule,cc_o_c)
>>> - $(call cmd,force_checksrc)
>>> + +$(call if_changed_rule,cc_o_c)
>>> + +$(call cmd,force_checksrc)
>>
>>
>> cmd_force_checksrc invokes sparse.
>> How is it related to GCC?
>>
>>
>>
>>
>>>
>>> # To make this rule robust against "Argument list too long" error,
>>> # ensure to add $(obj)/ prefix by a shell command.
>>> @@ -457,7 +457,7 @@ endef
>>> $(multi-obj-m): objtool-enabled := $(delay-objtool)
>>> $(multi-obj-m): part-of-module := y
>>> $(multi-obj-m): %.o: %.mod FORCE
>>> - $(call if_changed_rule,ld_multi_m)
>>> + +$(call if_changed_rule,ld_multi_m)
>>> $(call multi_depend, $(multi-obj-m), .o, -objs -y -m)
>>
>>
>> cmd_ld_multi_m invokes $(LD) directly.
>> How is it related to gcc?
>
>
>
Powered by blists - more mailing lists