]> www.infradead.org Git - users/hch/misc.git/commit
selftests/bpf: Fix selection of static vs. dynamic LLVM
authorAnton Protopopov <aspsk@isovalent.com>
Mon, 10 Mar 2025 14:51:12 +0000 (14:51 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 15 Mar 2025 18:48:58 +0000 (11:48 -0700)
commitcaa4237a790a986d668a83a48f0de7ab0069f9d8
tree5b83fd49376f7b4a4dcaecb2f868a5e135ee6581
parent488a8544f839048064ea0647596af2aaca7ecc25
selftests/bpf: Fix selection of static vs. dynamic LLVM

The Makefile uses the exit code of the `llvm-config --link-static --libs`
command to choose between statically-linked and dynamically-linked LLVMs.
The stdout and stderr of that command are redirected to /dev/null.
To redirect the output the "&>" construction is used, which might not be
supported by /bin/sh, which is executed by make for $(shell ...) commands.
On such systems the test will fail even if static LLVM is actually
supported. Replace "&>" by ">/dev/null 2>&1" to fix this.

Fixes: 2a9d30fac818 ("selftests/bpf: Support dynamically linking LLVM if static is not available")
Signed-off-by: Anton Protopopov <aspsk@isovalent.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Daniel Xu <dxu@dxuuu.xyz>
Link: https://lore.kernel.org/bpf/20250310145112.1261241-1-aspsk@isovalent.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/Makefile