Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2928544rwb; Mon, 15 Aug 2022 14:14:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR7utd3HSaaSV/jIVT753rFM8l0wj9LTZ6QhbAxl1/4oxWThN915uY+7qCS+sZ1G4UXYrSe4 X-Received: by 2002:a63:6384:0:b0:41d:3511:7fda with SMTP id x126-20020a636384000000b0041d35117fdamr15507876pgb.291.1660597957228; Mon, 15 Aug 2022 14:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597957; cv=none; d=google.com; s=arc-20160816; b=owGoTZcFoPbew2qHDxeZcYKERSxCqd+Qta8FrtvDZBwQo/J1xuAn4bLbRQ/92IHH1t b1VNeopCaIPzBX9WXOtdqMemd4Z85npvt1MEvQUc3zytPLeEYtS7YrC/P5sM2mTCRlju pGO1T53r9a/BlwMzKxAWeXqeun/75giwxjOuWlJhz/uuv/3ODLiqJpYcI9EVhCFKfLHp +0aZ61DPbM6CNbJdvZSQaRLnYbckZFrUdlZJtduECOytpqt7CIthERluIMVdcp+VA1y4 WjssddfIKqPzUnyiGYrK719Ym8TKlQBXbn/TuplKMn/JphHuUVGz5tL1exJF+liyx/CJ M9rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=c9Pr29fqYbAcLt0dpFczZjIDQ0uvFJv0arabdr2ReMU=; b=hZej+yPGXZAbguaOHzA37KqUidnBdPP2MlPwbChXue1Zd+HJH1ygn/RsUtmXh1x3Ec 7VX5EKTwf+Qpg/0FZJuqEKnfvGPHl7wTW5gNwt6lPGBgt9PieVOqro9bR0sRzJNqKKqN RfxHj0+6X+AmqrOT2kdqjn3neoy444hAY54px8FVdveLW9n3WsKAgALBtmwU1nT9aWZS VuSOcC7WrUcF1OoBJr47+2Qdkz2el0MzwAFwJ2Y9UGCYki49Bhqi1qD15O3zayOGotIp KHQxmV+VrHXYmusCcLIPcnU33veYaySRtEH1s2bfDWKfG/8b1DcVAISfRkdPbRGVHBEq jSwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AkBMkvzm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w23-20020a63f517000000b003fcf1182db5si11751963pgh.530.2022.08.15.14.12.25; Mon, 15 Aug 2022 14:12:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AkBMkvzm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345267AbiHOUjj (ORCPT + 99 others); Mon, 15 Aug 2022 16:39:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346029AbiHOUej (ORCPT ); Mon, 15 Aug 2022 16:34:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07FE74D803; Mon, 15 Aug 2022 12:06:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 943DE61299; Mon, 15 Aug 2022 19:06:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0BDDC433C1; Mon, 15 Aug 2022 19:06:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590378; bh=f1QHJkEWBxe0y7ULk3wzJybIZKZvXufJ0WmRnppxYtk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AkBMkvzmyZRCgRsybAnR6VBa73mZ0dXecyUeELJEPrZjWutpvrfZRq4wyPthHMR2s FshSrVJ/QMyFA5rFpuNEKnQhbaey+BGpAM7RyQl2myx6s518UH9lbg/acjTJRqoqfH 5a6eRDkjPndc/Mi9xJ3G1/MYvBDZgOAOsDXypF28= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jing Leng , Masahiro Yamada , Sasha Levin Subject: [PATCH 5.18 0241/1095] kbuild: Fix include path in scripts/Makefile.modpost Date: Mon, 15 Aug 2022 19:54:00 +0200 Message-Id: <20220815180439.757015907@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jing Leng [ Upstream commit 23a0cb8e3225122496bfa79172005c587c2d64bf ] 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 [masahiro: I do not think "M=$(OUT_DIR) src=$(PWD)" is the official way, but this patch is a nice clean up anyway.] Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- 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 -- 2.35.1