summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2022-08-28 11:39:50 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-04-13 16:48:20 +0200
commitf5c5934580e7a313aa500e1b1469beab94107459 (patch)
tree47c0faf0dbb23fc969f86cdf641e3d84563a61b2
parente62d179b9177dcf63916bfcfda089f1ff8207e91 (diff)
downloadlinux-stable-f5c5934580e7a313aa500e1b1469beab94107459.tar.gz
linux-stable-f5c5934580e7a313aa500e1b1469beab94107459.tar.bz2
linux-stable-f5c5934580e7a313aa500e1b1469beab94107459.zip
kbuild: refactor single builds of *.ko
[ Upstream commit f110e5a250e3c5db417e094b3dd86f1c135291ca ] Remove the potentially invalid modules.order instead of using the temporary file. Also, KBUILD_MODULES is don't care for single builds. No need to cancel it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Stable-dep-of: ed1f4ccfe947 ("clk: imx: imx8mp: add shared clk gate for usb suspend clk") Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--Makefile16
1 files changed, 4 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 6459e91369fd..4de8cd300451 100644
--- a/Makefile
+++ b/Makefile
@@ -1850,6 +1850,8 @@ modules modules_install:
@echo >&2 '***'
@exit 1
+KBUILD_MODULES :=
+
endif # CONFIG_MODULES
# Single targets
@@ -1875,18 +1877,12 @@ $(single-ko): single_modpost
$(single-no-ko): descend
@:
-ifeq ($(KBUILD_EXTMOD),)
-# For the single build of in-tree modules, use a temporary file to avoid
-# the situation of modules_install installing an invalid modules.order.
-MODORDER := .modules.tmp
-endif
-
+# Remove MODORDER when done because it is not the real one.
PHONY += single_modpost
single_modpost: $(single-no-ko) modules_prepare
$(Q){ $(foreach m, $(single-ko), echo $(extmod_prefix)$m;) } > $(MODORDER)
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
-
-KBUILD_MODULES := 1
+ $(Q)rm -f $(MODORDER)
export KBUILD_SINGLE_TARGETS := $(addprefix $(extmod_prefix), $(single-no-ko))
@@ -1896,10 +1892,6 @@ build-dirs := $(foreach d, $(build-dirs), \
endif
-ifndef CONFIG_MODULES
-KBUILD_MODULES :=
-endif
-
# Handle descending into subdirectories listed in $(build-dirs)
# Preset locale variables to speed up the build process. Limit locale
# tweaks to this spot to avoid wrong language settings when running