Skip to content

Commit 291c5af

Browse files
Yujie-Liurli9
authored andcommitted
lib/tests/update-llvm.sh: update minimum clang version of building bpf selftest
> BTW, I failed to compile the latest selftests/bpf with > the following errors: > > progs/verifier_and.c:58:16: error: invalid operand for instruction > asm volatile (" \ > These tests were moved to use inline assembly recently (2 month ago). Discussion at the time was whether to use \n\ or \ terminators at the end of each line. People opted for \ as easier to read. Replacing \ with \n\ and compiling this test using clang 14 shows more informative error message: $ make -j14 `pwd`/verifier_and.bpf.o CLNG-BPF [test_maps] verifier_and.bpf.o progs/verifier_and.c:68:1: error: invalid operand for instruction w1 %%= 2; \n\ ^ <inline asm>:11:5: note: instantiated into assembly here w1 %= 2; My guess is that clang 14 does not know how to handle operations on 32-bit sub-registers w[0-9]. But using clang 14 I get some errors not related to inline assembly as well. Also, I recall that there were runtime issues with clang 14 and tests using enum64. All-in-all, you need newer version of clang for tests nowadays, sorry for inconvenience. Link: https://lore.kernel.org/netdev/[email protected]/ Signed-off-by: Yujie Liu <[email protected]> Signed-off-by: Philip Li <[email protected]>
1 parent 9af77ef commit 291c5af

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/tests/update-llvm.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/bin/bash
22

3-
# As of now, make bpf failed when we use clang under v10.
4-
# prepare_for_llvm works for cluster, for local user, please install clang v10
3+
. $LKP_SRC/lib/env.sh
4+
5+
# make bpf failed when we use clang under v15 on v6.7 kernel
6+
# prepare_for_llvm works for cluster, for local user, please install clang v15 or newer
57
# mannually.
68
prepare_for_llvm()
79
{
810
# Due to some low dependency version issues, the latest version of the llvm_project.cgz package
911
# cannot be generated in alios.
10-
# But bpf must use llvm v10 or higher, so don't run bpf on alios.
12+
# But bpf must use llvm v15 or higher, so don't run bpf on alios.
1113
is_aliyunos && die "alios doesn't support bpf due to some dependency issues"
1214

1315
# LLVM version 11.0.1
@@ -16,8 +18,8 @@ prepare_for_llvm()
1618
llvm_version=${llvm_version##* }
1719
llvm_version=${llvm_version%%.*}
1820
echo "llvm_version: $llvm_version"
19-
[[ $llvm_version -ge 10 ]] || {
20-
echo "Please install llvm-10 or newer before running bpf"
21+
[[ $llvm_version -ge 15 ]] || {
22+
echo "Please install llvm-15 or newer before running bpf"
2123
return 1
2224
}
2325
}

0 commit comments

Comments
 (0)