Skip to content

Commit 1878716

Browse files
eddyz87danielocfb
authored andcommitted
[build-selftests] Clean selftests before building them
Cleaning selftests is useful in case if cached kernel build artifacts contain build results for selftests.
1 parent 277b66f commit 1878716

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

build-selftests/build_selftests.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,19 @@ else
3131
fi
3232

3333
cd ${REPO_ROOT}/${REPO_PATH}
34-
make \
35-
CLANG=clang-${LLVM_VERSION} \
36-
LLC=llc-${LLVM_VERSION} \
37-
LLVM_STRIP=llvm-strip-${LLVM_VERSION} \
38-
VMLINUX_BTF="${KBUILD_OUTPUT}/vmlinux" \
39-
VMLINUX_H="${VMLINUX_H}" \
40-
-C "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" \
41-
-j $(kernel_build_make_jobs)
34+
35+
MAKE_OPTS=$(cat <<EOF
36+
CLANG=clang-${LLVM_VERSION}
37+
LLC=llc-${LLVM_VERSION}
38+
LLVM_STRIP=llvm-strip-${LLVM_VERSION}
39+
VMLINUX_BTF=${KBUILD_OUTPUT}/vmlinux
40+
VMLINUX_H=${VMLINUX_H}
41+
-C ${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf
42+
EOF
43+
)
44+
make ${MAKE_OPTS} clean
45+
make ${MAKE_OPTS} -j $(kernel_build_make_jobs)
46+
4247
cd -
4348
mkdir "${LIBBPF_PATH}"/selftests
4449
cp -R "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" \

0 commit comments

Comments
 (0)