All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: force to build vmlinux if CONFIG_MODVERSION=y
@ 2020-05-31  8:47 Masahiro Yamada
  2020-06-05 14:10   ` Sasha Levin
  0 siblings, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2020-05-31  8:47 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-stable, Michal Marek, linux-kernel

This code does not work as stated in the comment.

$(CONFIG_MODVERSIONS) is always empty because it is expanded before
include/config/auto.conf is included. Hence, 'make modules' with
CONFIG_MODVERSION=y cannot record the version CRCs.

This has been broken since 2003, commit ("kbuild: Enable modules to be
build using the "make dir/" syntax"). [1]

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=15c6240cdc44bbeef3c4797ec860f9765ef4f1a7
Cc: linux-stable <stable@vger.kernel.org> # v2.5.71+
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 Makefile | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 2df903429d31..b856f84e28c9 100644
--- a/Makefile
+++ b/Makefile
@@ -619,12 +619,8 @@ KBUILD_MODULES :=
 KBUILD_BUILTIN := 1
 
 # If we have only "make modules", don't compile built-in objects.
-# When we're building modules with modversions, we need to consider
-# the built-in objects during the descend as well, in order to
-# make sure the checksums are up to date before we record them.
-
 ifeq ($(MAKECMDGOALS),modules)
-  KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1)
+  KBUILD_BUILTIN :=
 endif
 
 # If we have "make <whatever> modules", compile modules
@@ -1337,6 +1333,13 @@ ifdef CONFIG_MODULES
 
 all: modules
 
+# When we're building modules with modversions, we need to consider
+# the built-in objects during the descend as well, in order to
+# make sure the checksums are up to date before we record them.
+ifdef CONFIG_MODVERSIONS
+  KBUILD_BUILTIN := 1
+endif
+
 # Build modules
 #
 # A module can be listed more than once in obj-m resulting in
-- 
2.25.1


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

* Re: [PATCH] kbuild: force to build vmlinux if CONFIG_MODVERSION=y
  2020-05-31  8:47 [PATCH] kbuild: force to build vmlinux if CONFIG_MODVERSION=y Masahiro Yamada
@ 2020-06-05 14:10   ` Sasha Levin
  0 siblings, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2020-06-05 14:10 UTC (permalink / raw)
  To: Sasha Levin, Masahiro Yamada, linux-kbuild; +Cc: Masahiro Yamada, stable

Hi

[This is an automated email]

This commit has been processed because it contains a -stable tag.
The stable tag indicates that it's relevant for the following trees: 2.5.71+

The bot has tested the following trees: v5.6.15, v5.4.43, v4.19.125, v4.14.182, v4.9.225, v4.4.225.

v5.6.15: Build OK!
v5.4.43: Build OK!
v4.19.125: Build OK!
v4.14.182: Build OK!
v4.9.225: Failed to apply! Possible dependencies:
    2c1f4f125159 ("kbuild: re-order the code to not parse unnecessary variables")
    312a3d0918bb ("kbuild: trivial cleanups on the comments")
    a9d9a400e075 ("kbuild: split exported generic header creation into uapi-asm-generic")

v4.4.225: Failed to apply! Possible dependencies:
    23121ca2b56b ("kbuild: create/adjust generated/autoksyms.h")
    2441e78b1919 ("kbuild: better abstract vmlinux sequential prerequisites")
    2c1f4f125159 ("kbuild: re-order the code to not parse unnecessary variables")
    2e8d696b79e9 ("kbuild: drop FORCE from PHONY targets")
    312a3d0918bb ("kbuild: trivial cleanups on the comments")
    a9d9a400e075 ("kbuild: split exported generic header creation into uapi-asm-generic")
    b9ab5ebb14ec ("objtool: Add CONFIG_STACK_VALIDATION option")
    ba79d401f1ae ("kbuild: fix call to adjust_autoksyms.sh when output directory specified")
    dd92478a15fa ("kbuild: build sample modules along with the rest of the kernel")
    fbe6e37dab97 ("kbuild: add arch specific post-link Makefile")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

* Re: [PATCH] kbuild: force to build vmlinux if CONFIG_MODVERSION=y
@ 2020-06-05 14:10   ` Sasha Levin
  0 siblings, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2020-06-05 14:10 UTC (permalink / raw)
  To: Sasha Levin, Masahiro Yamada, linux-kbuild; +Cc: stable

Hi

[This is an automated email]

This commit has been processed because it contains a -stable tag.
The stable tag indicates that it's relevant for the following trees: 2.5.71+

The bot has tested the following trees: v5.6.15, v5.4.43, v4.19.125, v4.14.182, v4.9.225, v4.4.225.

v5.6.15: Build OK!
v5.4.43: Build OK!
v4.19.125: Build OK!
v4.14.182: Build OK!
v4.9.225: Failed to apply! Possible dependencies:
    2c1f4f125159 ("kbuild: re-order the code to not parse unnecessary variables")
    312a3d0918bb ("kbuild: trivial cleanups on the comments")
    a9d9a400e075 ("kbuild: split exported generic header creation into uapi-asm-generic")

v4.4.225: Failed to apply! Possible dependencies:
    23121ca2b56b ("kbuild: create/adjust generated/autoksyms.h")
    2441e78b1919 ("kbuild: better abstract vmlinux sequential prerequisites")
    2c1f4f125159 ("kbuild: re-order the code to not parse unnecessary variables")
    2e8d696b79e9 ("kbuild: drop FORCE from PHONY targets")
    312a3d0918bb ("kbuild: trivial cleanups on the comments")
    a9d9a400e075 ("kbuild: split exported generic header creation into uapi-asm-generic")
    b9ab5ebb14ec ("objtool: Add CONFIG_STACK_VALIDATION option")
    ba79d401f1ae ("kbuild: fix call to adjust_autoksyms.sh when output directory specified")
    dd92478a15fa ("kbuild: build sample modules along with the rest of the kernel")
    fbe6e37dab97 ("kbuild: add arch specific post-link Makefile")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

* Re: [PATCH] kbuild: force to build vmlinux if CONFIG_MODVERSION=y
  2020-06-05 14:10   ` Sasha Levin
  (?)
@ 2020-06-06  0:26   ` Masahiro Yamada
  -1 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2020-06-06  0:26 UTC (permalink / raw)
  To: Sasha Levin; +Cc: Linux Kbuild mailing list, stable

Hi.

On Fri, Jun 5, 2020 at 11:11 PM Sasha Levin <sashal@kernel.org> wrote:
>
> Hi
>
> [This is an automated email]
>
> This commit has been processed because it contains a -stable tag.
> The stable tag indicates that it's relevant for the following trees: 2.5.71+
>
> The bot has tested the following trees: v5.6.15, v5.4.43, v4.19.125, v4.14.182, v4.9.225, v4.4.225.
>
> v5.6.15: Build OK!
> v5.4.43: Build OK!
> v4.19.125: Build OK!
> v4.14.182: Build OK!
> v4.9.225: Failed to apply! Possible dependencies:
>     2c1f4f125159 ("kbuild: re-order the code to not parse unnecessary variables")
>     312a3d0918bb ("kbuild: trivial cleanups on the comments")
>     a9d9a400e075 ("kbuild: split exported generic header creation into uapi-asm-generic")
>
> v4.4.225: Failed to apply! Possible dependencies:
>     23121ca2b56b ("kbuild: create/adjust generated/autoksyms.h")
>     2441e78b1919 ("kbuild: better abstract vmlinux sequential prerequisites")
>     2c1f4f125159 ("kbuild: re-order the code to not parse unnecessary variables")
>     2e8d696b79e9 ("kbuild: drop FORCE from PHONY targets")
>     312a3d0918bb ("kbuild: trivial cleanups on the comments")
>     a9d9a400e075 ("kbuild: split exported generic header creation into uapi-asm-generic")
>     b9ab5ebb14ec ("objtool: Add CONFIG_STACK_VALIDATION option")
>     ba79d401f1ae ("kbuild: fix call to adjust_autoksyms.sh when output directory specified")
>     dd92478a15fa ("kbuild: build sample modules along with the rest of the kernel")
>     fbe6e37dab97 ("kbuild: add arch specific post-link Makefile")
>
>
> NOTE: The patch will not be queued to stable trees until it is upstream.
>
> How should we proceed with this patch?


I will send a pull request to Linus shortly.

After it hands, please cherry-pick it
for v4.14, v4.19, v5.4, v5.6


I will resolve the conflict and send a patch
for v4.4 and v4.9 later.

Thanks.





-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2020-06-06  0:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-31  8:47 [PATCH] kbuild: force to build vmlinux if CONFIG_MODVERSION=y Masahiro Yamada
2020-06-05 14:10 ` Sasha Levin
2020-06-05 14:10   ` Sasha Levin
2020-06-06  0:26   ` Masahiro Yamada

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.