From: David Laight <David.Laight@ACULAB.COM>
To: 'Nick Desaulniers' <ndesaulniers@google.com>,
Masahiro Yamada <masahiroy@kernel.org>
Cc: "linux-kbuild@vger.kernel.org" <linux-kbuild@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Michal Marek <michal.lkml@markovi.net>
Subject: RE: [PATCH 6/7] kbuild: make *.mod not depend on *.o
Date: Thu, 7 Apr 2022 21:39:16 +0000 [thread overview]
Message-ID: <eedd7486cd484c359be90e6138b0b2be@AcuMS.aculab.com> (raw)
In-Reply-To: <CAKwvOdm7NBPj43sRw-_dtjzgpHeOHnQ9uB3rSg3rYhUu0_PN7A@mail.gmail.com>
From: Nick Desaulniers
> Sent: 07 April 2022 18:59
>
> On Wed, Apr 6, 2022 at 8:31 AM Masahiro Yamada <masahiroy@kernel.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@kernel.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?
I think I'd do:
single-no-ko := $(filter-out $(single-ko), $(MAKECMDGOALS))
single-no-ko += $(patsubst %.ko, %.o, $(single-ko))
single-no-ko += $(patsubst %.ko, %.mod, $(single-ko))
Although you can use the simpler SYSV make suffix substitution syntax:
single-no-ko += $(single-ko:.ko=.o) $(single-ko:.ko=.mod)
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2022-04-07 21:39 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-06 15:30 [PATCH 0/7] kbuild: more misc cleanups Masahiro Yamada
2022-04-06 15:30 ` [PATCH 1/7] kbuild: reuse suffix-search to refactor multi_depend Masahiro Yamada
2022-04-06 20:54 ` Nick Desaulniers
2022-04-06 15:30 ` [PATCH 2/7] kbuild: make multi_depend work with targets in subdirectory Masahiro Yamada
2022-04-07 17:34 ` Nick Desaulniers
2022-04-06 15:30 ` [PATCH 3/7] kbuild: reuse real-search to simplify cmd_mod Masahiro Yamada
2022-04-07 17:38 ` Nick Desaulniers
2022-04-06 15:30 ` [PATCH 4/7] kbuild: split the second line of *.mod into *.usyms Masahiro Yamada
2022-04-07 17:47 ` Nick Desaulniers
2022-04-07 23:56 ` Masahiro Yamada
2022-04-06 15:30 ` [PATCH 5/7] kbuild: get rid of duplication in *.mod files Masahiro Yamada
2022-04-07 17:55 ` Nick Desaulniers
2022-04-08 0:07 ` Masahiro Yamada
2022-04-08 20:42 ` Nick Desaulniers
2022-04-13 8:19 ` Masahiro Yamada
2022-04-06 15:30 ` [PATCH 6/7] kbuild: make *.mod not depend on *.o Masahiro Yamada
2022-04-07 17:59 ` Nick Desaulniers
2022-04-07 21:39 ` David Laight [this message]
2022-04-08 0:37 ` Masahiro Yamada
2022-04-08 2:37 ` Masahiro Yamada
2022-04-06 15:30 ` [PATCH 7/7] kbuild: read *.mod to get objects passed to $(LD) or $(AR) Masahiro Yamada
2022-04-06 18:13 ` Jeff Johnson
2022-04-07 3:07 ` Masahiro Yamada
2022-04-07 18:01 ` Nick Desaulniers
2022-04-15 7:20 ` [PATCH 0/7] kbuild: more misc cleanups Masahiro Yamada
2022-04-22 19:07 ` Elliot Berman
2022-04-23 5:02 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eedd7486cd484c359be90e6138b0b2be@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=michal.lkml@markovi.net \
--cc=ndesaulniers@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox