From patchwork Tue May 17 10:51:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Leng <3090101217@zju.edu.cn> X-Patchwork-Id: 12852290 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 B2F98C433EF for ; Tue, 17 May 2022 10:58:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344572AbiEQK6Q (ORCPT ); Tue, 17 May 2022 06:58:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344720AbiEQK6M (ORCPT ); Tue, 17 May 2022 06:58:12 -0400 X-Greylist: delayed 360 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 17 May 2022 03:58:04 PDT Received: from zg8tndyumtaxlji0oc4xnzya.icoremail.net (zg8tndyumtaxlji0oc4xnzya.icoremail.net [46.101.248.176]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 9E98749906; Tue, 17 May 2022 03:58:04 -0700 (PDT) Received: from jleng.ambarella.net (unknown [180.169.129.130]) by mail-app4 (Coremail) with SMTP id cS_KCgAHHyIxfoNiwSVaAA--.8062S2; Tue, 17 May 2022 18:51:35 +0800 (CST) From: 3090101217@zju.edu.cn To: masahiroy@kernel.org, michal.lkml@markovi.net, ndesaulniers@google.com Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Jing Leng Subject: [PATCH] kbuild: Fix include path in scripts/Makefile.modpost Date: Tue, 17 May 2022 18:51:28 +0800 Message-Id: <20220517105128.9720-1-3090101217@zju.edu.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: cS_KCgAHHyIxfoNiwSVaAA--.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YxBIdaVFxhVjvjDU0xZFpf9x07jrSdgUUUUU= X-CM-SenderInfo: qtqziiyqrsilo62m3hxhgxhubq/1tbiAwINBVNG3GxzgAAAsf Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org From: Jing Leng When building an external module, if users don't need to separate the compilation output and source code, they run the following command: "make -C $(LINUX_SRC_DIR) M=$(PWD)". At this point, "$(KBUILD_EXTMOD)" and "$(src)" are the same. If they need to separate them, they run "make -C $(KERNEL_SRC_DIR) O=$(KERNEL_OUT_DIR) M=$(OUT_DIR) src=$(PWD)". Before running the command, they need to copy "Kbuild" or "Makefile" to "$(OUT_DIR)" to prevent compilation failure. So the kernel should change the included path to avoid the copy operation. Signed-off-by: Jing Leng --- scripts/Makefile.modpost | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 48585c4d04ad..0273bf7375e2 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -87,8 +87,7 @@ obj := $(KBUILD_EXTMOD) src := $(obj) # Include the module's Makefile to find KBUILD_EXTRA_SYMBOLS -include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \ - $(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile) +include $(if $(wildcard $(src)/Kbuild), $(src)/Kbuild, $(src)/Makefile) # modpost option for external modules MODPOST += -e