selftests/bpf: do not ignore clang failures
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 11 Jul 2019 09:12:49 +0000 (11:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Aug 2019 17:08:08 +0000 (19:08 +0200)
commitd8ed48f2378018bdef53cef1cb254b44cf8f2a26
tree0adbb53dc8c655bb0531fcb9d9bbb9bfe6edbd13
parent0a3df1d1800c88cb8c042a51ea67b0b4e76b880c
selftests/bpf: do not ignore clang failures

[ Upstream commit 9cae4ace80ef39005da106fbb89c952b27d7b89e ]

When compiling an eBPF prog fails, make still returns 0, because
failing clang command's output is piped to llc and therefore its
exit status is ignored.

When clang fails, pipe the string "clang failed" to llc. This will make
llc fail with an informative error message. This solution was chosen
over using pipefail, having separate targets or getting rid of llc
invocation due to its simplicity.

In addition, pull Kbuild.include in order to get .DELETE_ON_ERROR target,
which would cause partial .o files to be removed.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/Makefile