Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2025741rwe; Fri, 2 Sep 2022 07:31:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR61ueS+etZOsZCVSS+cbxft2BubNm97TfTBXJUIpzHSnc7YiNl/aYLqpEdEJkRkTUAUqY12 X-Received: by 2002:a17:902:b68f:b0:173:188f:5fa1 with SMTP id c15-20020a170902b68f00b00173188f5fa1mr35025065pls.155.1662129076701; Fri, 02 Sep 2022 07:31:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662129076; cv=none; d=google.com; s=arc-20160816; b=uMsITOLSu73V+ibpGauLKC430WKheVMDk5Y9Y3gSc1r2UbyiysxsChIcby9L99SF1o MsK/iLnTB74048A4XrPdnvWTNWM2Sq6XK3uBppAJeyEk3fHg+5AEhsqFNTgbvcKtzmw6 /kBT9r+tGIfdWaSw6CredLppz08IY7wZrqKDg6S5Tk2p7xnr+O3KiO2LJs/nov5aWERp 6QnqdbJvmosZjpQ/7ja6nUmdaKdTdgICP7DKlxMCFpUkJg6ywL686fDCOxWcisSa+Mm0 9poB1+6k/5kYWzOLypiBwXnMsFWlgY9L36uyr8eNQn/lWBIFKrLY1mN69bIiDqZZBzqC aQJA== 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=McTf+sAbB4AUbhlm7aD998cFH+OuPcY1f4ZuRV8YI0w=; b=at7MJiY6B7rfiDyE7itdWD/yfB0Oq8eL+EfLQDcjc7DQX8ptdkBV8SO9HNYHxRrAZQ s4/Ncup98AKceBuOsZKA6Y8ZhiMHBhna9S0NyMr2m57ixFKFiz+V9BksqH6RomH/olke PQs/Qa9iITLQKJ/uLCADEFM7WrkVoSA2FDz/lSusoEmPCne4W2uHX1K1SvCWzP8shqYv k1qukbb+3tF8QoQLmLu7/Vxdz52zByKI2SCvZZJIumMPSv9PHAG/Ag7PK1HVxUGlZlfq pbYIenLugeqTXAW9EHFge68+dEIIOyTToc51j8kCwx3AF1ff2qEBJ5j8wePljAAndJIf HZGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JY6oaeTa; 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 l190-20020a6388c7000000b0041e2cc84562si1991984pgd.577.2022.09.02.07.31.01; Fri, 02 Sep 2022 07:31:16 -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=JY6oaeTa; 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 S237654AbiIBNkt (ORCPT + 99 others); Fri, 2 Sep 2022 09:40:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236490AbiIBNkO (ORCPT ); Fri, 2 Sep 2022 09:40:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E460CF8F6B; Fri, 2 Sep 2022 06:17:48 -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 8EFED6218F; Fri, 2 Sep 2022 12:29:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D58EC433D6; Fri, 2 Sep 2022 12:29:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662121751; bh=eD8hPXiqhltoVaonaNs7OuOm9CRuggKzV8BzNUVDAgs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JY6oaeTaHlikcg3UQFCsRHSJ9dDQgzUjPVKXFdF4QdD9CYKrFc9sz8+GktbQ2sW6x Rbalq9gcWiHC0yfBZ9TQtihk6yjS2PYGzo3OZqzTC9BEVXjXwJnM+rSIM8lRfw4eES G1fN9wYnZEetjFYsNMb/LEGMe70lHF3Nob6lbVks= 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 5.4 52/77] kbuild: Fix include path in scripts/Makefile.modpost Date: Fri, 2 Sep 2022 14:19:01 +0200 Message-Id: <20220902121405.386283923@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220902121403.569927325@linuxfoundation.org> References: <20220902121403.569927325@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 @@ -75,8 +75,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 MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T - $(wildcard vmlinux)