Re: linux-next: build failure after merge of the kbuild tree

From: Masahiro Yamada
Date: Tue Jul 16 2019 - 01:00:35 EST


Hi Stephen,

On Tue, Jul 16, 2019 at 1:31 PM Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote:
>
> Hi all,
>
> After merging the kbuild tree, today's linux-next build (x86_64
> allnoconfig) failed like this:
>
> make[1]: *** No rule to make target 'modules.order', needed by 'autoksyms_recursive'. Stop.
>
> Starting with commit
>
> 656c0ac3cb4b ("kbuild: modpost: read modules.order instead of $(MODVERDIR)/*.mod")
>
> i.e. after reverting just:
>
> 25a55e249bc0 Revert "kbuild: create *.mod with full directory path and remove MODVERDIR"
> 15657d9eceb6 Revert "kbuild: remove the first line of *.mod files"
> 8c21f4122839 Revert "kbuild: remove 'prepare1' target"
> 35bc41d44d2d Revert "kbuild: split out *.mod out of {single,multi}-used-m rules"
>
> I get
>
> cat: modules.order: No such file or directory
>
> near the end of the allnoconfig build (but it does not fail).
>
> and when I remove 25a55e249bc0 i.e. stop reverting
>
> 0539f970a842 ("kbuild: create *.mod with full directory path and remove MODVERDIR")
>
> the build fails.
>
> So, for today I have reverted these 4 commits:
>
> 56dce8121e97 ("kbuild: split out *.mod out of {single,multi}-used-m rules")
> fbe0b5eb7890 ("kbuild: remove 'prepare1' target")
> 008fa222d268 ("kbuild: remove the first line of *.mod files")
> 0539f970a842 ("kbuild: create *.mod with full directory path and remove MODVERDIR")
>


Ugh, sorry for the breakage.


For the build error, I will fix it as follows for tomorrow's linux-next:

diff --git a/Makefile b/Makefile
index bfb08cc647f8..5f3daca90862 100644
--- a/Makefile
+++ b/Makefile
@@ -1028,8 +1028,8 @@ vmlinux-deps := $(KBUILD_LDS)
$(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)

# Recurse until adjust_autoksyms.sh is satisfied
PHONY += autoksyms_recursive
-autoksyms_recursive: $(vmlinux-deps) modules.order
ifdef CONFIG_TRIM_UNUSED_KSYMS
+autoksyms_recursive: $(vmlinux-deps) modules.order
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \
"$(MAKE) -f $(srctree)/Makefile vmlinux"
endif



For the warning, I will fix it as follows for tomorrow's linux-next:

diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 3e229d4f4d72..6b19c1a4eae5 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -64,7 +64,9 @@ modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers
modorder := $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order

# Step 1), find all modules listed in modules.order
+ifdef CONFIG_MODULES
modules := $(sort $(shell cat $(modorder)))
+endif

# Stop after building .o files if NOFINAL is set. Makes compile tests quicker
_modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules))


Thanks!

--
Best Regards
Masahiro Yamada