Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1973923rwe; Fri, 2 Sep 2022 06:50:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR5qXzjNFXnwDuz8BICF7erxxc68dZgBMBjcPO+GzQACVWHuS+diip1PliQrOvnfIEO0DR1K X-Received: by 2002:a63:4a08:0:b0:428:d6ca:5a99 with SMTP id x8-20020a634a08000000b00428d6ca5a99mr31749046pga.98.1662126633576; Fri, 02 Sep 2022 06:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662126633; cv=none; d=google.com; s=arc-20160816; b=RYweKJyXFKQ2raDza/rnd5S9VjNGwHnccOgsmitX8mAazv6jHv3ZrqNLvtxnAhxdU3 PBpyezst8bcNAF/NUwCKkYM4UDG1rlvr0iHrGBVOmk4vFlrxsCJvmrLdA3lY7j6tWhde e75jDidvPT9vi/qS06HSDPYFXGAbfos3R3El+K3jkH/e1wkVt+bwB/ha0a1ttRQVq576 9RZil67hrEhff5sqt1CiW8x0CMewjwcAJu8XoYo+B1dsoeFp8xl1fHu2KhC0SM1uhfXy QU3kpcHZr/ZT3xnk0Oj2SewObnKpsIxC/D05XFJ+3QUuF2WRclh2sx4b/z/f+xa3vzQP ClEg== 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=b0G7Hlh72allOOCdyfBnUoTJVHy2p+VwqnnVN9jQlcU=; b=vE4qVNq/h/4/cCcfW8fSHfD45NTfBKgKCqcfgxuQn4WQ2ZmKyl9LshRRcwVvHso+o1 qf/mYXkQnpBoZR7Q+XqBVDdtUc4pCe6DtkMaSeVKKp/N1qrBRXLg430cEOTXE3ryOkIk dYDaZUP10KUJMWY7zEFj4xX9opk0t0HmSmaXvZzFiwNDqJmFjYAACQPmjM3oBBSGCVLT 0lZ8Izf+Vj9U9A2oFhd/LM1/RWgPBu7WFGORvd53Mntsr1O/Dfklt+JLXkX0UTmZRsi7 KRWVwG8UwK0XMbA2w99KHfh2QIXAjsIcEbB3pmzBXLvRkqdc5Zh8L4kmAoiMqh7BUiML tmfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="A1Q/Lqdz"; 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 ay12-20020a1709028b8c00b00172a134d5cbsi1978383plb.145.2022.09.02.06.50.05; Fri, 02 Sep 2022 06:50:33 -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="A1Q/Lqdz"; 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 S236463AbiIBM07 (ORCPT + 99 others); Fri, 2 Sep 2022 08:26:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236273AbiIBM0J (ORCPT ); Fri, 2 Sep 2022 08:26:09 -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 CE9BFDD762; Fri, 2 Sep 2022 05:23:27 -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 267FF6212F; Fri, 2 Sep 2022 12:23:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B5EBC433D7; Fri, 2 Sep 2022 12:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662121381; bh=44j/0QGKbnCXOQkwSh+zBTtcYgPKScXSQtuBhIR6w2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A1Q/Lqdz+6MDuAtyph+R+Nnz/WcV41BbX+rAPBB4y7KFBbwOZ6Xy2ZnC2fW8c7Q/S LvbvyMUGTHRfbC9eZks+xaNcMLh4XroVRpYjuw/QnxA3K5eaQ1Ue0ZgIar0qaM6OdB rhm4f4DVPn7v/8LfiRjgS705TPL95fBokOqLMlFE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jing Leng , Masahiro Yamada , Nicolas Schier Subject: [PATCH 4.14 31/42] kbuild: Fix include path in scripts/Makefile.modpost Date: Fri, 2 Sep 2022 14:18:55 +0200 Message-Id: <20220902121359.875927718@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220902121358.773776406@linuxfoundation.org> References: <20220902121358.773776406@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 commit 23a0cb8e3225122496bfa79172005c587c2d64bf upstream. 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 [nsc: updated context for v4.19] Signed-off-by: Nicolas Schier Signed-off-by: Greg Kroah-Hartman --- scripts/Makefile.modpost | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -51,8 +51,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) endif include scripts/Makefile.lib