Skip to content

Commit 6e6ef2d

Browse files
committed
Makefile: add comment to discourage tools/* addition for kernel builds
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/[email protected]/T/#m8ece130dd0e23c6f2395ed89070161948dee8457 [2]: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Nicolas Schier <[email protected]> Reviewed-by: Brian Norris <[email protected]> Reviewed-by: Sami Tolvanen <[email protected]>
1 parent 44ad281 commit 6e6ef2d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,12 @@ prepare: tools/bpf/resolve_btfids
13281328
endif
13291329
endif
13301330

1331+
# The tools build system is not a part of Kbuild and tends to introduce
1332+
# its own unique issues. If you need to integrate a new tool into Kbuild,
1333+
# please consider locating that tool outside the tools/ tree and using the
1334+
# standard Kbuild "hostprogs" syntax instead of adding a new tools/* entry
1335+
# here. See Documentation/kbuild/makefiles.rst for details.
1336+
13311337
PHONY += resolve_btfids_clean
13321338

13331339
resolve_btfids_O = $(abspath $(objtree))/tools/bpf/resolve_btfids

0 commit comments

Comments
 (0)