When running 'make' in tools/testing/selftests/arm64/ without explicitly setting the OUTPUT variable, the build system will creates test directories (e.g., /bti) in the root filesystem due to OUTPUT defaulting to an empty string. This causes unintended pollution of the root directory.
This patch adds proper handling for the OUTPUT variable: Sets OUTPUT to the current directory (.) if not specified
Signed-off-by: tanze tanze@kylinos.cn --- tools/testing/selftests/arm64/Makefile | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/arm64/Makefile b/tools/testing/selftests/arm64/Makefile index 22029e60eff3..c4c72ee2ef55 100644 --- a/tools/testing/selftests/arm64/Makefile +++ b/tools/testing/selftests/arm64/Makefile @@ -21,6 +21,8 @@ CFLAGS += $(KHDR_INCLUDES)
CFLAGS += -I$(top_srcdir)/tools/include
+OUTPUT ?= $(CURDIR) + export CFLAGS export top_srcdir
On Thu, 15 May 2025 13:18:39 +0800, tanze wrote:
When running 'make' in tools/testing/selftests/arm64/ without explicitly setting the OUTPUT variable, the build system will creates test directories (e.g., /bti) in the root filesystem due to OUTPUT defaulting to an empty string. This causes unintended pollution of the root directory.
This patch adds proper handling for the OUTPUT variable: Sets OUTPUT to the current directory (.) if not specified
[...]
Applied to arm64 (for-next/selftests), thanks!
[1/1] kselftest/arm64: Set default OUTPUT path when undefined https://git.kernel.org/arm64/c/b225219a4002
Cheers,
linux-kselftest-mirror@lists.linaro.org