[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABCJKucE0c7SLbf5sxcNCj+tiL9uwYDKspg2Zq0vjR-ZSePpng@mail.gmail.com>
Date: Thu, 18 Jul 2024 17:54:03 +0000
From: Sami Tolvanen <samitolvanen@...gle.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
Jiri Olsa <jolsa@...nel.org>, Josh Poimboeuf <jpoimboe@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, Nicolas Schier <nicolas@...sle.eu>,
Brian Norris <briannorris@...omium.org>, Nathan Chancellor <nathan@...nel.org>
Subject: Re: [PATCH v2] Makefile: add comment to discourage tools/* addition
for kernel builds
Hi Masahiro,
On Wed, Jul 17, 2024 at 6:28 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> Kbuild provides scripts/Makefile.host to build host programs used for
> building the kernel. Unfortunately, there are two exceptions that opt
> out of Kbuild. The build system under tools/ is a cheesy replica, and
> cause issues. I was recently poked about a problem in the tools build
> system, which I do not maintain (and nobody maintains). [1]
>
> Without a comment, people might believe this is the right location
> because that is where objtool lives, even if a more robust Kbuild
> syntax satisfies their needs. [2]
>
> [1]: https://lore.kernel.org/linux-kbuild/ZnIYWBgrJ-IJtqK8@google.com/T/#m8ece130dd0e23c6f2395ed89070161948dee8457
> [2]: https://lore.kernel.org/all/20240618200501.GA1611012@google.com/
>
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> Acked-by: Nicolas Schier <nicolas@...sle.eu>
> Reviewed-by: Brian Norris <briannorris@...omium.org>
> ---
>
> Changes in v2:
> - rephase the comment for clarification
>
> Makefile | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 768d3dc107f8..943899656977 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1328,6 +1328,12 @@ prepare: tools/bpf/resolve_btfids
> endif
> endif
>
> +# The tools build system is not a part of Kbuild and tends to introduce
> +# its own unique issues. If you need to integrate a new tool into Kbuild,
> +# please consider locating that tool outside the tools/ tree and using the
> +# standard Kbuild "hostprogs" syntax instead of adding a new tools/* entry
> +# here. See Documentation/kbuild/makefiles.rst for details.
> +
> PHONY += resolve_btfids_clean
>
> resolve_btfids_O = $(abspath $(objtree))/tools/bpf/resolve_btfids
Looks good to me, thanks for adding the clarification!
Reviewed-by: Sami Tolvanen <samitolvanen@...gle.com>
Sami
Powered by blists - more mailing lists