linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Cc: Michal Marek <michal.lkml@markovi.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 09/29] kbuild: disallow multi-word in M= or KBUILD_EXTMOD
Date: Mon, 1 Jun 2020 03:31:05 +0900	[thread overview]
Message-ID: <CAK7LNARYdPsu9feYR4N+rvNhn2J73jf5VwcV7U5Pi=jFzePddw@mail.gmail.com> (raw)
In-Reply-To: <20200524154235.380482-10-masahiroy@kernel.org>

On Mon, May 25, 2020 at 12:43 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> $(firstword ...) in scripts/Makefile.modpost was added by commit
> 3f3fd3c05585 ("[PATCH] kbuild: allow multi-word $M in Makefile.modpost")
> to build multiple external module directories.
>
> It was a solution to resolve symbol dependencies when an external
> module depends on another external module.
>
> Commit 0d96fb20b7ed ("kbuild: Add new Kbuild variable
> KBUILD_EXTRA_SYMBOLS") introduced another solution by passing symbol
> info via KBUILD_EXTRA_SYMBOLS, then broke the multi-word M= support.
>
>   include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \
>                $(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile)
>
> ... does not work if KBUILD_EXTMOD contains multiple words.
>
> This feature has been broken for more than a decade. Remove the
> bitrotten code, and stop parsing if M or KBUILD_EXTMOD contains
> multiple words.
>
> As Documentation/kbuild/modules.rst explains, if your module depends
> on another one, there are two solutions:
>   - add a common top-level Kbuild file
>   - use KBUILD_EXTRA_SYMBOLS
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

This patch, applied to linux-kbuild.



> ---
>
> Changes in v2:
>   - Add more commit log
>
>  Makefile                 | 3 +++
>  scripts/Makefile.modpost | 2 +-
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 72eb55a36545..48a2dfaf3bf3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -218,6 +218,9 @@ ifeq ("$(origin M)", "command line")
>    KBUILD_EXTMOD := $(M)
>  endif
>
> +$(if $(word 2, $(KBUILD_EXTMOD)), \
> +       $(error building multiple external modules is not supported))
> +
>  export KBUILD_CHECKSRC KBUILD_EXTMOD
>
>  extmod-prefix = $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)
> diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
> index 957eed6a17a5..b79bf0e30d32 100644
> --- a/scripts/Makefile.modpost
> +++ b/scripts/Makefile.modpost
> @@ -44,7 +44,7 @@ include include/config/auto.conf
>  include scripts/Kbuild.include
>
>  kernelsymfile := $(objtree)/Module.symvers
> -modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers
> +modulesymfile := $(KBUILD_EXTMOD)/Module.symvers
>
>  MODPOST = scripts/mod/modpost                                                          \
>         $(if $(CONFIG_MODVERSIONS),-m)                                                  \
> --
> 2.25.1
>


-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2020-05-31 18:31 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-24 15:42 [PATCH v2 00/29] modpost: various fixes, cleanups, optimizations Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 01/29] modpost: drop RCS/CVS $Revision handling in MODULE_VERSION() Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 02/29] modpost: do not call get_modinfo() for vmlinux Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 03/29] modpost: add read_text_file() and get_line() helpers Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 04/29] modpost: fix potential mmap'ed file overrun in get_src_version() Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 05/29] modpost: re-add warning about missing *.mod file Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 06/29] modpost: avoid false-positive file open error Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 07/29] modpost: use read_text_file() and get_line() for reading text files Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 08/29] modpost: remove get_next_text() and make {grab,release_}file static Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 09/29] kbuild: disallow multi-word in M= or KBUILD_EXTMOD Masahiro Yamada
2020-05-31 18:31   ` Masahiro Yamada [this message]
2020-05-24 15:42 ` [PATCH v2 10/29] modpost: move -T option close to the modpost command Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 11/29] modpost: pass -N option only for modules modpost Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 12/29] modpost: move external module options Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 13/29] modpost: load KBUILD_EXTRA_SYMBOLS files in order Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 14/29] modpost: track if the symbol origin is a dump file or ELF object Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 15/29] modpost: allow to pass -i option multiple times remove -e option Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 16/29] modpost: rename ext_sym_list to dump_list Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 17/29] modpost: re-add -e to set external_module flag Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 18/29] modpost: show warning if vmlinux is not found when processing modules Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 19/29] modpost: show warning if it fails to read symbol dump file Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 20/29] modpost: generate vmlinux.symvers and reuse it for the second modpost Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 21/29] modpost: remove -s option Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 22/29] modpost: remove mod->is_dot_o struct member Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 23/29] modpost: remove is_vmlinux() call in check_for_{gpl_usage,unused}() Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 24/29] modpost: add mod->is_vmlinux struct member Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 25/29] modpost: remove mod->skip " Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 26/29] modpost: set have_vmlinux in new_module() Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 27/29] modpost: strip .o from modname before calling new_module() Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 28/29] modpost: remove is_vmlinux() helper Masahiro Yamada
2020-05-24 15:42 ` [PATCH v2 29/29] modpost: change elf_info->size to size_t 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='CAK7LNARYdPsu9feYR4N+rvNhn2J73jf5VwcV7U5Pi=jFzePddw@mail.gmail.com' \
    --to=masahiroy@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    /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;
as well as URLs for NNTP newsgroup(s).