From patchwork Sun Jun 25 14:06:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 112598 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6941043vqr; Sun, 25 Jun 2023 07:22:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5l6oHEDmOcs6fJxa4XHWEhWULupojAY5IlTqJ//C9tjswclDNx1R/V7X9TdfsRFPbII3RG X-Received: by 2002:a17:902:c944:b0:1b0:6038:2982 with SMTP id i4-20020a170902c94400b001b060382982mr4665165pla.41.1687702920663; Sun, 25 Jun 2023 07:22:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687702920; cv=none; d=google.com; s=arc-20160816; b=Yqg6rb/0Jxs86Ne5qIDkZU747tcVyr4IXQp22jMxgAuBErOQULa0qoFhM6L1bqal/s cNG8zdkog0toaiE+rTgfXn+HPhY6Yo4q86P1qycoPhVEXLNr5tqvNPM8virIvLa26szz Bk4MzBWSeD0Joi59QNitN7jUs6YNviEhrwSwMD246E7bAscOnmSCUoVWjbNEd7n3CTYF 2AR9xiqqGkYc03PSudamcckWCEWNSo4S4ApnxjSR0WNWZpddi/U/gNYEZER3UPhcniod EJO0JK6tkp/VKNotaLutAXXL/ZH/aCx3aJYlDF4o21kFAJIpNDwtDk9h5Z2PbnLtA2gz Y4og== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=I+aqBUyfH/cWc+L4gQDVgAnC5ox0C+7jjxeuZONnLPs=; fh=wKrPioF+0wPaktGqmf0aQvlk8PY4Pc32rTAsBSAiP8I=; b=TXfPOFNRvANMe2f5iRCLw5VrzaCg1AVdiGENzJuyKSXEa7e4d19UwbE1WNy4+TEEWv QfmZMS8mKjARvd+RLLUYzc1/3VAsfwVBtIAwCzic7KgLfCNX3sYICCMk2xPjBrvK0FnB eKlU7tyxGh4P7mUGLtnSYt0JwaqHu/1m49Mt+dOHwE13n2A0Sf3QBGiG+D9ju9mKzhfJ zhj/558FmSbwtdinJj0v9Tx+ofEX35+ueTzz5j5Zky0zzzQvHKGtTfBIhN8CFd12t0Oz JJyB2ytTqoZPYz8hOLBf1T72BUAXKt0JUCqBSjZNb1JGxx1OlwVQSLLPGKQ8VceGVg/X VZ2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hR+Wy0YV; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jl23-20020a170903135700b001b241f8a865si3041491plb.117.2023.06.25.07.21.48; Sun, 25 Jun 2023 07:22:00 -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=@kernel.org header.s=k20201202 header.b=hR+Wy0YV; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229735AbjFYOGn (ORCPT + 99 others); Sun, 25 Jun 2023 10:06:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjFYOGl (ORCPT ); Sun, 25 Jun 2023 10:06:41 -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 AD11A1B1; Sun, 25 Jun 2023 07:06:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 03F1E602E2; Sun, 25 Jun 2023 14:06:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2F87C433C0; Sun, 25 Jun 2023 14:06:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687701999; bh=S3NHgH5zR4/XnZv9Sf+BiVy8WcLky1GXrScxBb3Sw4o=; h=From:To:Cc:Subject:Date:From; b=hR+Wy0YVxhHo8php6titEefdXjx1gFvxWnuNQ2CDek9qP7xqcXDn37IlecsY2msYL jkXNhtz9OlfCckR2GvVk86VSaIwzBturcRYHT8arRZpD0C/0z6PMmgKtZIEhDjdVQQ LhfU8lnolLSy30nXxUoBTbZP2jB4FjNhQrnrrl45tVEWSW66ZaUULokO9D/5U48oJT 1BwlFtlc9IGSLPBdqLpdRwWB2+x8OpEdm4wDG7Xv1Yy9rq6MnUsfG9NOKJtgTS6b+u QISLl0aNzk+1KyyrMDpOuU6Ei6NUAHSn6mBIDdUa6tcqbQJpOEknnnlw+tN3BP4xXG 6A5BBFwRKwUYQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH v3 1/3] kbuild: unexport abs_srctree and abs_objtree Date: Sun, 25 Jun 2023 23:06:28 +0900 Message-Id: <20230625140630.2134298-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769684777349945368?= X-GMAIL-MSGID: =?utf-8?q?1769684777349945368?= 'make rpm-pkg' builds the kernel in rpmbuild/BUILD, but $(abs_srctree) and $(abs_objtree) point to the directory path where make was started, not the kernel is actually being built. Fix it. In hindsight, there was no need to export abs_srctree and abs_objtree. Signed-off-by: Masahiro Yamada --- Changes in v3: - New patch Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index f18d59c81241..6f9bbb0d9172 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,10 @@ __all: # descending is started. They are now explicitly listed as the # prepare rule. +this-makefile := $(lastword $(MAKEFILE_LIST)) +abs_srctree := $(realpath $(dir $(this-makefile))) +abs_objtree := $(CURDIR) + ifneq ($(sub_make_done),1) # Do not use make's built-in rules and variables @@ -185,8 +189,6 @@ $(if $(abs_objtree),, \ # $(realpath ...) resolves symlinks abs_objtree := $(realpath $(abs_objtree)) -else -abs_objtree := $(CURDIR) endif # ifneq ($(KBUILD_OUTPUT),) ifeq ($(abs_objtree),$(CURDIR)) @@ -196,9 +198,6 @@ else need-sub-make := 1 endif -this-makefile := $(lastword $(MAKEFILE_LIST)) -abs_srctree := $(realpath $(dir $(this-makefile))) - ifneq ($(words $(subst :, ,$(abs_srctree))), 1) $(error source directory cannot contain spaces or colons) endif @@ -211,7 +210,6 @@ need-sub-make := 1 $(this-makefile): ; endif -export abs_srctree abs_objtree export sub_make_done := 1 ifeq ($(need-sub-make),1)