Skip to contentSkip to conversation

kbuild: fix the modules order between drivers and libs

PATCH In review Masahiro Yamada 1 participant 2 messages Aug 13, 2022 – Aug 17, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: fix the modules order between drivers and libs

Commit b2c885549122 ("kbuild: update modules.order only when contained modules are updated") accidentally changed the modules order.

Prior to that commit, the modules order was determined based on vmlinux-dirs, which lists core-y/m, drivers-y/m, libs-y/m, in this order.

Now, subdir-modorder lists them in a different order: core-y/m, libs-y/m, drivers-y/m.

Presumably, there was no practical issue because the modules in drivers and libs are orthogonal, but there is no reason to have this distortion.

Get back to the original order.

Fixes b2c885549122 ("kbuild: update modules.order only when contained modules are updated")

---

 Makefile | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Makefile +2 -4
index 5f5c43a52455..c4e06e8020f1 100644
@@ -1113,13 +1113,11 @@ vmlinux-alldirs	:= $(sort $(vmlinux-dirs) Documentation \
 		     $(patsubst %/,%,$(filter %/, $(core-) \
 			$(drivers-) $(libs-))))
 
-subdir-modorder := $(addsuffix modules.order,$(filter %/, \
-			$(core-y) $(core-m) $(libs-y) $(libs-m) \
-			$(drivers-y) $(drivers-m)))
-
 build-dirs	:= $(vmlinux-dirs)
 clean-dirs	:= $(vmlinux-alldirs)
 
+subdir-modorder := $(addsuffix /modules.order, $(build-dirs))
+
 # Externally visible symbols (used by link-vmlinux.sh)
 KBUILD_VMLINUX_OBJS := $(head-y) $(patsubst %/,%/built-in.a, $(core-y))
 KBUILD_VMLINUX_OBJS += $(addsuffix built-in.a, $(filter %/, $(libs-y)))
Signature · 1 line
2.34.1
#1 lore raw
Quoted 10 lines · Masahiro Yamada

Commit b2c885549122 ("kbuild: update modules.order only when contained modules are updated") accidentally changed the modules order.

Prior to that commit, the modules order was determined based on vmlinux-dirs, which lists core-y/m, drivers-y/m, libs-y/m, in this order.

Now, subdir-modorder lists them in a different order: core-y/m, libs-y/m, drivers-y/m.

Quoted 8 lines

Presumably, there was no practical issue because the modules in drivers and libs are orthogonal, but there is no reason to have this distortion.

Get back to the original order.

Fixes b2c885549122 ("kbuild: update modules.order only when contained modules are updated")

---

Applied to linux-kbuild/fixes.

Quoted 27 lines
 Makefile | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Makefile +2 -5
index 5f5c43a52455..c4e06e8020f1 100644
@@ -1113,13 +1113,11 @@ vmlinux-alldirs := $(sort $(vmlinux-dirs) Documentation \
                     $(patsubst %/,%,$(filter %/, $(core-) \
                        $(drivers-) $(libs-))))
 
-subdir-modorder := $(addsuffix modules.order,$(filter %/, \
-                       $(core-y) $(core-m) $(libs-y) $(libs-m) \
-                       $(drivers-y) $(drivers-m)))
-
 build-dirs     := $(vmlinux-dirs)
 clean-dirs     := $(vmlinux-alldirs)
 
+subdir-modorder := $(addsuffix /modules.order, $(build-dirs))
+
 # Externally visible symbols (used by link-vmlinux.sh)
 KBUILD_VMLINUX_OBJS := $(head-y) $(patsubst %/,%/built-in.a, $(core-y))
 KBUILD_VMLINUX_OBJS += $(addsuffix built-in.a, $(filter %/, $(libs-y)))
--

2.34.1

Signature · 2 lines
Best Regards
Masahiro Yamada