[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAR68JsGK4uqwJEKi8g9-rfjFLt3RX-0PjqcCTTuwCR8ZQ@mail.gmail.com>
Date: Fri, 8 Apr 2022 11:37:31 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: David Laight <David.Laight@...lab.com>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>,
"linux-kbuild@...r.kernel.org" <linux-kbuild@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Michal Marek <michal.lkml@...kovi.net>
Subject: Re: [PATCH 6/7] kbuild: make *.mod not depend on *.o
On Fri, Apr 8, 2022 at 9:37 AM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> On Fri, Apr 8, 2022 at 6:39 AM David Laight <David.Laight@...lab.com> wrote:
> >
> > From: Nick Desaulniers
> > > Sent: 07 April 2022 18:59
> > >
> > > On Wed, Apr 6, 2022 at 8:31 AM Masahiro Yamada <masahiroy@...nel.org> wrote:
> > > >
> > > > The dependency
> > > >
> > > > $(obj)/%.mod: $(obj)/%$(mod-prelink-ext).o
> > > >
> > > > ... exists because *.mod files previously contained undefined symbols,
> > > > which are computed from *.o files when CONFIG_TRIM_UNUSED_KSYMS=y.
> > > >
> > > > Now that the undefined symbols are put into separate *.usyms files,
> > > > there is no reason to make *.mod depend on *.o files.
> > > >
> > > > Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> > > > ---
> > > >
> > > > Makefile | 3 ++-
> > > > scripts/Makefile.build | 5 ++---
> > > > 2 files changed, 4 insertions(+), 4 deletions(-)
> > > >
> > > > diff --git a/Makefile b/Makefile
> > > > index 82ee893909e9..e915aacd02b0 100644
> > > > --- a/Makefile
> > > > +++ b/Makefile
> > > > @@ -1792,7 +1792,8 @@ ifdef single-build
> > > >
> > > > # .ko is special because modpost is needed
> > > > single-ko := $(sort $(filter %.ko, $(MAKECMDGOALS)))
> > > > -single-no-ko := $(sort $(patsubst %.ko,%.mod, $(MAKECMDGOALS)))
> > > > +single-no-ko := $(filter-out $(single-ko), $(MAKECMDGOALS)) \
> > > > + $(foreach x, o mod, $(patsubst %.ko, %.$x, $(single-ko)))
> > >
> > > I'm on board with this patch, and the overall goal with the series. My
> > > brain is having a hard time parsing `o mod` though. Can you walk me
> > > through that? Are those targets for .o and .mod files, respectively?
>
>
> Yes.
>
> Kbuild can build a module individually.
>
> make foo/bar/baz.ko
>
> (but modpost check does not work well)
>
> To do this, Kbuild needs to descend to
> the directory and generate
> foo/bar/baz.o and foo/bar/baz.mod.
>
> Previously, foo/bar/baz.o was generated as a
> prerequisite of foo/bar/baz.mod, but now we
> need to request Kbuild to generate both of them.
>
BTW, this feature is broken for CONFIG_LTO_CLANG=y
because the ELF object is not foo/bar/baz.o
but foo/bar/baz.prelink.o
(which was renamed from foo/bar/baz.lto.o).
I will not fix it, though.
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists