Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1131099lqt; Sat, 20 Apr 2024 01:57:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX331I6IbhmDyoPdSLAiD7Dm3t3hKRxcKd6YITa2X0sPXJGrHA57J204hiKI+DTB/v7ulEIkvxixkD/UgD8dsT6SHF568NRo3U9s02a0A== X-Google-Smtp-Source: AGHT+IElw93FkR8+REdEhyrhuP3BwHEiBAWqQj4umDoN/zhlJbxGRC04WnyuXH9cwLVOz17cwAfK X-Received: by 2002:a17:902:eecd:b0:1e5:4743:deba with SMTP id h13-20020a170902eecd00b001e54743debamr4421390plb.58.1713603452326; Sat, 20 Apr 2024 01:57:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713603452; cv=pass; d=google.com; s=arc-20160816; b=myrDI+1AmFxnAwH+AVbUQ1YjsstOs3d7yO3/qQ34gavgo1B24fP/4X+RRozjwBhagm HsjN0AfjH6H0I+LHaiOwjkneW8ULh0YzyDGV3Fw36Tm1MpfU8zjGQn1wkt05GOBL12ol l25ju3FHhrF8RQqhdVZ+ujST6N1vLWBp7DIKz2oasP6aEUFUWUH100m0F4ROZ+Blg/k0 gIcc9cztpu0iBrg43dM+rjjCy7md3fi6lDu7QfZ1NC0mkJROISMGAoe+Z0gDbJ9tgbcX boceqljUH1PMVbNCKrJQzrCQ3b7ydhj3jKW+pv69Fg4oiUb+dgZtssAjGdprBRo48CC0 kYlw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=H9HdPV7mKVeKhqKll2sbzF1CnsqyxBd7959HfzfLF4c=; fh=Hd6Q3wGD+hhgINAlvZ+VHGR9B2as4DqjdAoEkdDYcTU=; b=Y1+AJJSDZrqRHO5v34Hx6zNr1EeOl6rhzD8xfQ/ITxhYCF0ovxdu2JPZg7ks8RGSTH lTxf86rC6bsw+3EfJM1o3alWri5f9EBGqfvjSyXRI/wYeATH73wJWB3nURyItOQ7OpcB +iiT4rmHXesNTLFVqBA92jKLVJK8zySlPIZdzCF1tx1YzeFzxNDbYVuF/vCWKe0gh+1L XrFfwHNeC60DrmGWOLnypp6HEAoIOlxBabaXlvzr5hP+SGnyDcTQP2fK4yvOcwEzI17S KWNUn5ws4oX9Txyzg/xzU88xpUI6/et8z6OwooZKfFnuGI64O1V87Zi1YXvC0tkVZJkf lukQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MLM5Y60e; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-152181-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152181-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k9-20020a170902ba8900b001e132f931fbsi4345045pls.363.2024.04.20.01.57.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 01:57:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152181-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MLM5Y60e; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-152181-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152181-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 01C732810CB for ; Sat, 20 Apr 2024 08:57:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D27414AB0; Sat, 20 Apr 2024 08:57:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MLM5Y60e" 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 64896F9DF; Sat, 20 Apr 2024 08:57:25 +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=1713603445; cv=none; b=LXZrqg1kZUqbFW596QDy1hv7Zvjsxvo0u+M9Z9dyVloCFhyGezDQ9LiSEdSOFoOGBJGbvFO6DHwBN7H1irWyDcHiTsUIz3KbaFdqxngi7Tph7y5ncIXzaeH9WdqwhHBr4Ivz/aXWan9rHaLc6VWLcU0RLgiY1gCXHWdKZVekJJA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713603445; c=relaxed/simple; bh=d2Y+idK3Ze2qLNSSS7zzqAxEmlRt9o56eI03/DQs9YU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=t1Xkk1IkhIx4BQzYnoicblEg4HJN+MTDsOcm+LCVpDcRHTncSVFj8F9Y+/Ef0Z0cKPM8uNgy4vnlcNAs55MDhFXDrGoipuE0ls/8IPjP/1e3Ojd/Ys+Bsahzwrjgvb2zyNAXkwbnFFGxX83tEhA/ePZv+NdypjvdNVd9aprGv/g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MLM5Y60e; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5708C3277B; Sat, 20 Apr 2024 08:57:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713603444; bh=d2Y+idK3Ze2qLNSSS7zzqAxEmlRt9o56eI03/DQs9YU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MLM5Y60eHDyutEenfWi+nAlLlul1vs9La6sIQBOX19D2C3Zev891B9UqgwDrFnZeJ U3jUJle7qUr4cFuway59hMUoPtnULEcIIO4miZcoLQmXyC7h0yVt6xTuQKrHRITLQA SHhEU8/lmGOdl2UZhRLosH94uD5CMIMN+FJYWoxcf78UwSHqIHq8rt7daJnJlkHvp+ 8RuU7YgjCqC5MYTomb0P/e5du0wAce1CHAaxj+tx0EIEaZwHI+Q6+lEZOgan6if0cB cUYUvZ/rf6ARkatjn06Rb9MA1GhyYEwRM0hP4wSSeNcEdqeXa7dMVYj1NuAk175zzu VvxTMvKLzpRGA== Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-5171a529224so3472201e87.0; Sat, 20 Apr 2024 01:57:24 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCV9qKjVmk3lSjVOF4dq6deaHpUhWZ0M05ldRhB6wq13JrIRVB1F25kcPqdr9PSmyIsOjFuxKc4as4m1sxeBezJ6zLmbXH5uEULam94G X-Gm-Message-State: AOJu0YyFpEzlK8rtLhaV2glGWQiG+JtcQPRtvtxo2X9mWPIGNvyHnYb4 3BHJ7Fk14XMhG9OukynDy8U7Kpg807KSRcX7UubbqumAEa3VBOGhpEv463cFG4ATNiSiWxIC/hu y4J+msmVp+G0GsfAOhFkoHyKWm8I= X-Received: by 2002:a19:5f12:0:b0:519:b963:6591 with SMTP id t18-20020a195f12000000b00519b9636591mr2472663lfb.23.1713603443578; Sat, 20 Apr 2024 01:57:23 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240416121838.95427-1-masahiroy@kernel.org> <20240416121838.95427-5-masahiroy@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Sat, 20 Apr 2024 17:56:47 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/4] kbuild: use $(src) instead of $(srctree)/$(src) for source directory To: Nicolas Schier Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Apr 20, 2024 at 12:09=E2=80=AFAM Nicolas Schier = wrote: > > On Tue 16 Apr 2024 21:18:38 GMT, Masahiro Yamada wrote: > > Kbuild conventionally uses $(obj)/ for generated files, and $(src)/ for > > checked-in source files. It is merely a convention without any function= al > > difference. In fact, $(obj) and $(src) are exactly the same, as defined > > in scripts/Makefile.build: > > > > src :=3D $(obj) > > > > When the kernel is built in a separate output directory, $(src) does > > not match the directory in the source tree. It still works because the > > top Makefile sets VPATH to $(srctree). However, VPATH does not cover > > all cases. There are many places where the exact path to the source > > directory is needed. For example, when adding a header search path for > > local headers, it is typical to pass -I$(srctree)/$(src) to the compile= r. > > > > However, it introduces inconsistency between upstream Makefiles and > > downstream Makefiles; when the source directory path is needed, > > $(srctree)/$(src) is used in the upstream kernel, while $(src) is used > > in external modules. > > > > To resolve the distortion, this commit changes the semantics of $(src) > > so that it always points to the directory in the source tree. > > > > Going forward, the variables used in Makefiles will work as follows: > > > > $(obj) - directory in the object tree > > $(src) - directory in the source tree (changed by this commit!) > > $(objtree) - the top of the kernel object tree > > $(srctree) - the top of the kernel source tree > > > > This is a tweewide Makefile conversion for replacing $(srctree)/$(src) > > with $(src). > > tweewide -> treewide > > [...] > > diff --git a/drivers/Makefile b/drivers/Makefile > > index 3bf5cab4b451..fe9ceb0d2288 100644 > > --- a/drivers/Makefile > > +++ b/drivers/Makefile > > @@ -6,11 +6,6 @@ > > # Rewritten to use lists instead of if-statements. > > # > > > > -# Some driver Makefiles miss $(srctree)/ for include directive. > > -ifdef building_out_of_srctree > > -MAKEFLAGS +=3D --include-dir=3D$(srctree) > > -endif > > - > > Ah, it's nice to get rid of this. > > > obj-y +=3D cache/ > > obj-y +=3D irqchip/ > > obj-y +=3D bus/ > [...] > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > > index 3179747cbd2c..c53d2f168801 100644 > > --- a/scripts/Makefile.lib > > +++ b/scripts/Makefile.lib > > @@ -209,13 +209,13 @@ _c_flags +=3D $(if $(patsubst n%,, \ > > -D__KCSAN_INSTRUMENT_BARRIERS__) > > endif > > > > -# $(srctree)/$(src) for including checkin headers from generated sourc= e files > > -# $(objtree)/$(obj) for including generated headers from checkin sourc= e files > > +# $(src) for including checkin headers from generated source files > > +# $(obj) for including generated headers from checkin source files > > this is a funny criss-cross of words; but might the following be more > accurate? > > # $(src) for including headers from checked-in source files > # $(obj) for including generated headers These are added only when building_out_of_srctree is defined. When the kernel is built in-tree, the include directive with the double-quote form should work without the header inclusion path. Anyway, this does not seem to be a good idea. I want to get rid of these entirely. > > > > Anyway, thanks for the patch. I think it is quite a good way forward! > > Reviewed-by: Nicolas Schier --=20 Best Regards Masahiro Yamada