Skip to content

Commit

Permalink
[build-selftests] Clean selftests before building them
Browse files Browse the repository at this point in the history
Cleaning selftests is useful in case if cached kernel build artifacts
contain build results for selftests.
  • Loading branch information
eddyz87 authored and danielocfb committed Apr 20, 2023
1 parent 277b66f commit 1878716
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions build-selftests/build_selftests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@ else
fi

cd ${REPO_ROOT}/${REPO_PATH}
make \
CLANG=clang-${LLVM_VERSION} \
LLC=llc-${LLVM_VERSION} \
LLVM_STRIP=llvm-strip-${LLVM_VERSION} \
VMLINUX_BTF="${KBUILD_OUTPUT}/vmlinux" \
VMLINUX_H="${VMLINUX_H}" \
-C "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" \
-j $(kernel_build_make_jobs)

MAKE_OPTS=$(cat <<EOF
CLANG=clang-${LLVM_VERSION}
LLC=llc-${LLVM_VERSION}
LLVM_STRIP=llvm-strip-${LLVM_VERSION}
VMLINUX_BTF=${KBUILD_OUTPUT}/vmlinux
VMLINUX_H=${VMLINUX_H}
-C ${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf
EOF
)
make ${MAKE_OPTS} clean
make ${MAKE_OPTS} -j $(kernel_build_make_jobs)

cd -
mkdir "${LIBBPF_PATH}"/selftests
cp -R "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" \
Expand Down

0 comments on commit 1878716

Please sign in to comment.