Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp981345lqs; Wed, 6 Mar 2024 02:44:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUMbKmZ9TQwBFS3mUVu1irTqGu3O00qHGXuMknFTGsl1o4bd2Mq3zRZetCyCBh+XNrQ4qvUZYpiAoT6Ss56G0644F6LvlyzTip1zlBBSw== X-Google-Smtp-Source: AGHT+IGtVZYygHSaQiITt+02ghXemKgbMM+Vj8LRv+XGv0HjLFFo2O0PK7XtoyFzJE/V27nNflg8 X-Received: by 2002:a05:620a:2191:b0:788:229c:766a with SMTP id g17-20020a05620a219100b00788229c766amr4758317qka.54.1709721858969; Wed, 06 Mar 2024 02:44:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709721858; cv=pass; d=google.com; s=arc-20160816; b=Qsx7M9kwbxDNxAWkmV/Nb89JaySmd+mTO63HDRwIHaTEvFTuDzPHJznqE/ugf6BSRO JdJpPWSRCCwJt6e9BpjAxzza3L5ABHu8ookt8SDQ0TzSrM/iYHla0tdyAgONm6bwbYKN k8jAuyAy0CTLOp/f4vvVJ73n4tXS8p/MgXSPLCd9OueX3YVw+BZQXhRUmkZ5TcbH6sDy 76KODb8U+yuVZz5Ifn1XYvYp8yfn9BN2ET1p6E9vvXgB6Rp83rokbboXncpW1Ye37efB 0oHaA/GX2zJlGTnUoidAIQ4cMZvWtuH+AaIIDB02nxldl4Ps0tAvZ9v+3/rgTQM71Qlf z4bA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=99RtIWr/egQ0L3Pyp+lUsDpsrkrUuf/CGhNSWn28gyI=; fh=oQbvuNnOUeIuBT5siQdg+euUHNNdn+CeEwAg69/1RSo=; b=dXeqfzucfJv7XOCm3Mb5qNrOhnnOY0U19GMqzDKFPYuzO/IlK/PDmLWpfsbXu86aXN 8e0zP9I+nx5bH2cCOQQArfe/K9Ui6+9acvKsAlQd6Q4nDr/Rf/MJ/6t0uSTbAtcO02dw J4BvVYLON8aFG4HDezMYGSBRe5FDGumq5SmvFvxNEriM5YBN8Sa/66MHLLnJ/1cd1tuT wTfKRfqynMew3aor74V9eDNWIHpqluUDkro4RgCeGTe86dq0AIlGcxHI4viaxNon4tVm 3ycPtmHgARrOExbPZql5KC+Pdnrc3dv/6pY5+ovnyaAKPxKqtWj44WAughP/OTJq/Ra1 xzJg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ob1wDC6T; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-93794-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93794-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id oq32-20020a05620a612000b007881bb8a6b8si8994794qkn.301.2024.03.06.02.44.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 02:44:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93794-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ob1wDC6T; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-93794-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93794-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 636671C21B3E for ; Wed, 6 Mar 2024 10:44:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4421560DDC; Wed, 6 Mar 2024 10:43:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ob1wDC6T" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DC1760BA1; Wed, 6 Mar 2024 10:43:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709721797; cv=none; b=Xsf3webqzz4YK45BIHZe9HC4GDq9RKC0zj42MtnS8vWRsziSIUG6RYa/LTncMqS4PuOlauv/YmaUuxdgKBzpBcaPB7zyLJ4gaRm1cYJhM++JUXtcHFPVt+pwcn3xzFPkZ1P0LsuuPkaAGL6vXTJJVv3n5yZZtFwMFErGHU6+akk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709721797; c=relaxed/simple; bh=qPc3Rze+xdFVIDt8rY61AlQ9GWmq0n15nKjNocAbfY0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=KY1MD6FmdoeSCw6lYPlRsgfkcuQi8rnE+rD2CJ4UNA8IC0xmc7+++ERPJ9ac2+//Q9DV26GP+yQsS+ROq486eqxqhlwPKTwCkzmtwVae5VeF1YIk4060OE8u9PSXo4Q+S0dOvr3mEgm/BXhVSKIMiTVU63JBJevi/6lLSSWTjsU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ob1wDC6T; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E7F0C43394; Wed, 6 Mar 2024 10:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709721796; bh=qPc3Rze+xdFVIDt8rY61AlQ9GWmq0n15nKjNocAbfY0=; h=From:To:Cc:Subject:Date:From; b=ob1wDC6TqX8niGkM2eQeaSpFizoDM/FaBMz/mvcNOK3unqNNkDrL9l5RvRw7Iz19T 09a6oA9+gNa2+04BlWmERnTOHG4EoYo2TZpwve6xaRG647CQ7zRvJgGBU7J0wH7jho eLgQOl3LpYejyauzDw8sTGSEdQj89Wa7POXDHc7YtSxBu5R6fZJv8XwNH2P2HqrjMM nvE9jv+VOu/EYq1yTIuly7fqmb4vbcgFyhgSNUfedS2bnSdZWFyheL2z3TlHMx84OF 6PKCu0XxS8uKVMfmVE7b+/6lJjy0h4GaDTM8KkkuUY3siOsO3Ci7fRDM2znWlh/Udx X2xNYN9C/McXQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH] kbuild: unexport abs_srctree and abs_objtree Date: Wed, 6 Mar 2024 19:42:22 +0900 Message-Id: <20240306104222.308473-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Commit 25b146c5b8ce ("kbuild: allow Kbuild to start from any directory") exported abs_srctree and abs_objtree to avoid recomputation after the sub-make. However, this approach turned out to be fragile. Commit 5fa94ceb793e ("kbuild: set correct abs_srctree and abs_objtree for package builds") moved them above "ifneq ($(sub_make_done),1)", eliminating the need for exporting them. These are only needed in the top Makefile. If an absolute path is required in sub-directories, you can use $(abspath ) or $(realpath ) as needed. Signed-off-by: Masahiro Yamada --- Makefile | 4 ++-- rust/Makefile | 4 ++-- scripts/Makefile.package | 2 +- tools/lib/bpf/Makefile | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d84c0fb215fd..d9274e7c75f0 100644 --- a/Makefile +++ b/Makefile @@ -39,8 +39,8 @@ __all: # prepare rule. this-makefile := $(lastword $(MAKEFILE_LIST)) -export abs_srctree := $(realpath $(dir $(this-makefile))) -export abs_objtree := $(CURDIR) +abs_srctree := $(realpath $(dir $(this-makefile))) +abs_objtree := $(CURDIR) ifneq ($(sub_make_done),1) diff --git a/rust/Makefile b/rust/Makefile index 9d2a16cc91cb..ae691b71d9fc 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -100,7 +100,7 @@ rustdoc: rustdoc-core rustdoc-macros rustdoc-compiler_builtins \ -e 's:rust-logo-[0-9a-f]+\.svg:logo.svg:g' \ -e 's:favicon-[0-9a-f]+\.svg:logo.svg:g' \ -e 's:::g' \ - -e 's:::g' + -e 's:::g' $(Q)for f in $(rustdoc_output)/static.files/rustdoc-*.css; do \ echo ".logo-container > img { object-fit: contain; }" >> $$f; done @@ -413,7 +413,7 @@ quiet_cmd_rustc_library = $(if $(skip_clippy),RUSTC,$(RUSTC_OR_CLIPPY_QUIET)) L rust-analyzer: $(Q)$(srctree)/scripts/generate_rust_analyzer.py \ --cfgs='core=$(core-cfgs)' --cfgs='alloc=$(alloc-cfgs)' \ - $(abs_srctree) $(abs_objtree) \ + $(realpath $(srctree)) $(realpath $(objtree)) \ $(RUST_LIB_SRC) $(KBUILD_EXTMOD) > \ $(if $(KBUILD_EXTMOD),$(extmod_prefix),$(objtree))/rust-project.json diff --git a/scripts/Makefile.package b/scripts/Makefile.package index a81dfb1f5181..38653f3e8108 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -135,7 +135,7 @@ snap-pkg: mkdir $(objtree)/snap $(MAKE) clean sed "s@KERNELRELEASE@$(KERNELRELEASE)@; \ - s@SRCTREE@$(abs_srctree)@" \ + s@SRCTREE@$(realpath $(srctree))@" \ $(srctree)/scripts/package/snapcraft.template > \ $(objtree)/snap/snapcraft.yaml cd $(objtree)/snap && \ diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index 4be7144e4803..2cf892774346 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -2,7 +2,7 @@ # Most of this file is copied from tools/lib/traceevent/Makefile RM ?= rm -srctree = $(abs_srctree) +srctree := $(realpath $(srctree)) VERSION_SCRIPT := libbpf.map LIBBPF_VERSION := $(shell \ -- 2.40.1