linux-imx/tools/testing/selftests/filesystems
John Hubbard 3af6ed233a selftests/binderfs: use the Makefile's rules, not Make's implicit rules
[ Upstream commit 019baf635e ]

First of all, in order to build with clang at all, one must first apply
Valentin Obst's build fix for LLVM [1]. Once that is done, then when
building with clang, via:

    make LLVM=1 -C tools/testing/selftests

...the following error occurs:

   clang: error: cannot specify -o when generating multiple output files

This is because clang, unlike gcc, won't accept invocations of this
form:

    clang file1.c header2.h

While trying to fix this, I noticed that:

a) selftests/lib.mk already avoids the problem, and

b) The binderfs Makefile indavertently bypasses the selftests/lib.mk
build system, and quitely uses Make's implicit build rules for .c files
instead.

The Makefile attempts to set up both a dependency and a source file,
neither of which was needed, because lib.mk is able to automatically
handle both. This line:

    binderfs_test: binderfs_test.c

...causes Make's implicit rules to run, which builds binderfs_test
without ever looking at lib.mk.

Fix this by simply deleting the "binderfs_test:" Makefile target and
letting lib.mk handle it instead.

[1] https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c49f@valentinobst.de/

Fixes: 6e29225af9 ("binderfs: port tests to test harness infrastructure")
Cc: Christian Brauner <brauner@kernel.org>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:11:49 +02:00
..
binderfs selftests/binderfs: use the Makefile's rules, not Make's implicit rules 2024-06-12 11:11:49 +02:00
epoll selftests: filesystems: Fix incorrect kernel headers search path 2023-02-13 09:09:44 -07:00
fat selftests/filesystems: Add six consecutive 'x' characters to mktemp 2023-08-16 10:10:39 -06:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
devpts_pts.c selftests: filesystems: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
dnotify_test.c
Makefile selftests: filesystems: Fix incorrect kernel headers search path 2023-02-13 09:09:44 -07:00