From patchwork Tue Sep 6 19:34:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 12968040 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26196C38145 for ; Tue, 6 Sep 2022 19:35:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229549AbiIFTfy (ORCPT ); Tue, 6 Sep 2022 15:35:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbiIFTfw (ORCPT ); Tue, 6 Sep 2022 15:35:52 -0400 Received: from conuserg-07.nifty.com (conuserg-07.nifty.com [210.131.2.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C82889CE7; Tue, 6 Sep 2022 12:35:50 -0700 (PDT) Received: from zoe.. (133-32-182-133.west.xps.vectant.ne.jp [133.32.182.133]) (authenticated) by conuserg-07.nifty.com with ESMTP id 286JYjqX018889; Wed, 7 Sep 2022 04:34:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com 286JYjqX018889 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1662492886; bh=buj24yq3s8ReDMkxdHKGvu3Cnge/yLfAR/qMi/tJe6c=; h=From:To:Cc:Subject:Date:From; b=s7zaK5N+ehEANgy1X+xjmV3aDseitIuEh7EmzeRvVRHMf1xV4RGdUdGHjWJpOoFuT 9K9K3qNnd8XOFHqtaodT5NKWc01pkDu/jViDERsJvjRFLwbFONucrPpWwcN1qZ1fWX vD/T+GFxqTEU0sfAHgDIvXpZhYvdHPg+zyK/9vMaCevwyuUI1p70oHjh1NuiyKCLhW Y3CZyiDaPDxNiws6PFD39eQZ0rp7QrCHjiNoUxl/QyLEwL1UImROW02mqwMSk9CePG WWbAogDNangs3ENTzyFl1lW195/MuN0Uqmn5Wi/S3ZJfK2MKENVW52bTwi6lPQSzlV k4IEjknoprwGw== X-Nifty-SrcIP: [133.32.182.133] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Marek , Nick Desaulniers Subject: [PATCH 1/2] kbuild: use modpost-args-y to clean up modpost arguments Date: Wed, 7 Sep 2022 04:34:35 +0900 Message-Id: <20220906193436.2135744-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Separate the modpost executable (scripts/mod/modpost) and the command parameters for the next commit. Signed-off-by: Masahiro Yamada --- Makefile | 2 +- scripts/Makefile.modpost | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index aee4f0769d9d..e07236209606 100644 --- a/Makefile +++ b/Makefile @@ -1908,7 +1908,7 @@ tags TAGS cscope gtags: FORCE # --------------------------------------------------------------------------- PHONY += nsdeps -nsdeps: export KBUILD_NSDEPS=1 +nsdeps: export KBUILD_NSDEPS=y nsdeps: modules $(Q)$(CONFIG_SHELL) $(srctree)/scripts/nsdeps diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index ceb1d78140e7..87821a5fe16b 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -38,17 +38,17 @@ __modpost: include include/config/auto.conf include $(srctree)/scripts/Kbuild.include -MODPOST = scripts/mod/modpost \ - $(if $(CONFIG_MODVERSIONS),-m) \ - $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \ - $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ - $(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS)) \ - $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \ - -o $@ +MODPOST = scripts/mod/modpost + +modpost-args-$(CONFIG_MODVERSIONS) += -m +modpost-args-$(CONFIG_MODULE_SRCVERSION_ALL) += -a +modpost-args-$(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS) += -N +modpost-args-$(KBUILD_NSDEPS) += -N -d $(MODULES_NSDEPS) +modpost-args-y += $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) # 'make -i -k' ignores compile errors, and builds as many modules as possible. ifneq ($(findstring i,$(filter-out --%,$(MAKEFLAGS))),) -MODPOST += -n +modpost-args-y += -n endif ifeq ($(KBUILD_EXTMOD),) @@ -99,12 +99,12 @@ module.symvers-if-present := $(wildcard Module.symvers) output-symdump := $(KBUILD_EXTMOD)/Module.symvers missing-input := $(filter-out $(module.symvers-if-present), Module.symvers) -MODPOST += -e $(addprefix -i ,$(module.symvers-if-present) $(KBUILD_EXTRA_SYMBOLS)) +modpost-args-y += -e $(addprefix -i ,$(module.symvers-if-present) $(KBUILD_EXTRA_SYMBOLS)) endif # ($(KBUILD_EXTMOD),) ifneq ($(KBUILD_MODPOST_WARN)$(missing-input),) -MODPOST += -w +modpost-args-y += -w endif modorder-if-needed := $(if $(KBUILD_MODULES), $(MODORDER)) @@ -117,7 +117,7 @@ quiet_cmd_modpost = MODPOST $@ echo >&2 "WARNING: $(missing-input) is missing."; \ echo >&2 " Modules may not have dependencies or modversions."; \ echo >&2 " You may get many unresolved symbol warnings.";) \ - sed 's/ko$$/o/' $(or $(modorder-if-needed), /dev/null) | $(MODPOST) $(vmlinux.o-if-present) -T - + sed 's/ko$$/o/' $(or $(modorder-if-needed), /dev/null) | $(MODPOST) $(modpost-args-y) $(vmlinux.o-if-present) -T - -o $@ targets += $(output-symdump) $(output-symdump): $(modorder-if-needed) $(vmlinux.o-if-present) $(moudle.symvers-if-present) FORCE From patchwork Tue Sep 6 19:34:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 12968041 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F052ECAAA1 for ; Tue, 6 Sep 2022 19:35:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229559AbiIFTfy (ORCPT ); Tue, 6 Sep 2022 15:35:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbiIFTfw (ORCPT ); Tue, 6 Sep 2022 15:35:52 -0400 Received: from conuserg-07.nifty.com (conuserg-07.nifty.com [210.131.2.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26D03804A7; Tue, 6 Sep 2022 12:35:49 -0700 (PDT) Received: from zoe.. (133-32-182-133.west.xps.vectant.ne.jp [133.32.182.133]) (authenticated) by conuserg-07.nifty.com with ESMTP id 286JYjqY018889; Wed, 7 Sep 2022 04:34:46 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com 286JYjqY018889 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1662492886; bh=h1Wn/PkFpnuQ5ZufXwU4XYgsqEkmLcWVv+UYyLr6tSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=20e0T6hjUxqE+YC/3Extlb5G6lvIqRAVanct260dna7ibMm7QxX4XXLXs2Z9Y3lzQ Ez1M+gEg5Z8KFM3rG95cGb6ymqtOjnDP+ZbtMTaCQimUNbdaLXMG5TwfS2eq29XCTK DSRG+TEQi8YrPDPXb05pepO5919zII3tKiyO3ihPSVwzK7ornEwExe+sR9Z7c/0Vc6 hiLci4D8C+pm8dxJEWOVAExwGhDw2YnW4oGjufFeN7hu/L5KwtDTVhF/H4BFov6QfF xa6ns332RJ2ELUhFzQe1hoYHW9h+nEMW0rRAyhGw787dqv8wvIvIT+uE2tHm0sxMl+ tE2w2g8Wq9QOQ== X-Nifty-SrcIP: [133.32.182.133] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Marek , Nick Desaulniers Subject: [PATCH 2/2] kbuild: re-run modpost stage when scripts/mod/modpost is updated Date: Wed, 7 Sep 2022 04:34:36 +0900 Message-Id: <20220906193436.2135744-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220906193436.2135744-1-masahiroy@kernel.org> References: <20220906193436.2135744-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org vmlinux depends on .vmlinux.export.c, modules depend on *.mod.c. They are output from modpost, so the modpost stage must be re-run when the modpost code is updated. Signed-off-by: Masahiro Yamada --- scripts/Makefile.modpost | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 87821a5fe16b..1afe50971f3b 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -120,7 +120,7 @@ quiet_cmd_modpost = MODPOST $@ sed 's/ko$$/o/' $(or $(modorder-if-needed), /dev/null) | $(MODPOST) $(modpost-args-y) $(vmlinux.o-if-present) -T - -o $@ targets += $(output-symdump) -$(output-symdump): $(modorder-if-needed) $(vmlinux.o-if-present) $(moudle.symvers-if-present) FORCE +$(output-symdump): $(modorder-if-needed) $(vmlinux.o-if-present) $(moudle.symvers-if-present) $(MODPOST) FORCE $(call if_changed,modpost) __modpost: $(output-symdump)