Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: do not deduplicate modules.order

The AWK code was added to deduplicate modules.order in case $(obj-m)
contains the same module multiple times, but it is actually unneeded
since commit b2c885549122 ("kbuild: update modules.order only when
contained modules are updated").

The list is already deduplicated before being processed by AWK because
$^ is the deduplicated list of prerequisites.
(Please note the real-prereqs macro uses $^)

Yet, modules.order will contain duplication if two different Makefiles
build the same module:

foo/Makefile:

obj-m += bar/baz.o

foo/bar/Makefile:

obj-m += baz.o

However, the parallel builds cannot properly handle this case in the
first place. So, it is better to let it fail (as already done by
scripts/modules-check.sh).

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+2 -5
+1 -4
Makefile
··· 1430 1430 1431 1431 # Build modules 1432 1432 # 1433 - # A module can be listed more than once in obj-m resulting in 1434 - # duplicate lines in modules.order files. Those are removed 1435 - # using awk while concatenating to the final file. 1436 1433 1437 1434 PHONY += modules 1438 1435 modules: $(if $(KBUILD_BUILTIN),vmlinux) modules_check modules_prepare 1439 1436 1440 - cmd_modules_order = $(AWK) '!x[$$0]++' $(real-prereqs) > $@ 1437 + cmd_modules_order = cat $(real-prereqs) > $@ 1441 1438 1442 1439 modules.order: $(subdir-modorder) FORCE 1443 1440 $(call if_changed,modules_order)
+1 -1
scripts/Makefile.build
··· 374 374 375 375 cmd_modules_order = { $(foreach m, $(real-prereqs), \ 376 376 $(if $(filter %/modules.order, $m), cat $m, echo $(patsubst %.o,%.ko,$m));) :; } \ 377 - | $(AWK) '!x[$$0]++' - > $@ 377 + > $@ 378 378 379 379 $(obj)/modules.order: $(obj-m) FORCE 380 380 $(call if_changed,modules_order)