All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] kbuild: modpost: Explicitly warn about unprototyped symbols
@ 2021-06-07 14:02 Mark Brown
  2021-06-17  1:05 ` Masahiro Yamada
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2021-06-07 14:02 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek; +Cc: linux-kbuild, linux-kernel, Mark Brown

One common cause of modpost version generation failures is a failure to
prototype exported assembly functions - the tooling requires this for
exported functions even if they are not and should not be called from C
code in order to do the version mangling for symbols. Unfortunately the
error message is currently rather abstruse, simply saying that "version
generation failed" and even diving into the code doesn't directly show
what's going on since there's several steps between the problem and it
being observed.

Provide an explicit hint as to the likely cause of a version generation
failure to help anyone who runs into this in future more readily diagnose
and fix the problem.

Signed-off-by: Mark Brown <broonie@kernel.org>
---

v2:
 - Reword and reformat error message.
 - Fix duplicated is.

 scripts/mod/modpost.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 3e623ccc020b..270a7df898e2 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -660,8 +660,11 @@ static void handle_modversion(const struct module *mod,
 	unsigned int crc;
 
 	if (sym->st_shndx == SHN_UNDEF) {
-		warn("EXPORT symbol \"%s\" [%s%s] version generation failed, symbol will not be versioned.\n",
-		     symname, mod->name, mod->is_vmlinux ? "" : ".ko");
+		warn("EXPORT symbol \"%s\" [%s%s] version ...\n"
+		     "Is \"%s\" prototyped in <asm/asm-prototypes.h>?\n",
+		     symname, mod->name, mod->is_vmlinux ? "" : ".ko",
+		     symname);
+
 		return;
 	}
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] kbuild: modpost: Explicitly warn about unprototyped symbols
  2021-06-07 14:02 [PATCH v2] kbuild: modpost: Explicitly warn about unprototyped symbols Mark Brown
@ 2021-06-17  1:05 ` Masahiro Yamada
  2021-06-22 16:56   ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2021-06-17  1:05 UTC (permalink / raw)
  To: Mark Brown
  Cc: Michal Marek, Linux Kbuild mailing list, Linux Kernel Mailing List

On Mon, Jun 7, 2021 at 11:02 PM Mark Brown <broonie@kernel.org> wrote:
>
> One common cause of modpost version generation failures is a failure to
> prototype exported assembly functions - the tooling requires this for
> exported functions even if they are not and should not be called from C
> code in order to do the version mangling for symbols. Unfortunately the
> error message is currently rather abstruse, simply saying that "version
> generation failed" and even diving into the code doesn't directly show
> what's going on since there's several steps between the problem and it
> being observed.
>
> Provide an explicit hint as to the likely cause of a version generation
> failure to help anyone who runs into this in future more readily diagnose
> and fix the problem.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---

Applied to linux-kbuild. Thanks.


>
> v2:
>  - Reword and reformat error message.
>  - Fix duplicated is.
>
>  scripts/mod/modpost.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 3e623ccc020b..270a7df898e2 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -660,8 +660,11 @@ static void handle_modversion(const struct module *mod,
>         unsigned int crc;
>
>         if (sym->st_shndx == SHN_UNDEF) {
> -               warn("EXPORT symbol \"%s\" [%s%s] version generation failed, symbol will not be versioned.\n",
> -                    symname, mod->name, mod->is_vmlinux ? "" : ".ko");
> +               warn("EXPORT symbol \"%s\" [%s%s] version ...\n"
> +                    "Is \"%s\" prototyped in <asm/asm-prototypes.h>?\n",
> +                    symname, mod->name, mod->is_vmlinux ? "" : ".ko",
> +                    symname);
> +
>                 return;
>         }
>
> --
> 2.20.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] kbuild: modpost: Explicitly warn about unprototyped symbols
  2021-06-17  1:05 ` Masahiro Yamada
@ 2021-06-22 16:56   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-06-22 16:56 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Michal Marek, Linux Kbuild mailing list, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 552 bytes --]

On Thu, Jun 17, 2021 at 10:05:44AM +0900, Masahiro Yamada wrote:
> On Mon, Jun 7, 2021 at 11:02 PM Mark Brown <broonie@kernel.org> wrote:

> > One common cause of modpost version generation failures is a failure to
> > prototype exported assembly functions - the tooling requires this for
> > exported functions even if they are not and should not be called from C

> Applied to linux-kbuild. Thanks.

This doesn't seem to be showing up in -next, was there some issue?
Looks like the kbuild tree that -next is picking up wasn't updated since
1st June.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-22 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 14:02 [PATCH v2] kbuild: modpost: Explicitly warn about unprototyped symbols Mark Brown
2021-06-17  1:05 ` Masahiro Yamada
2021-06-22 16:56   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.