Skip to content

Commit

Permalink
selftests: override KHDR_INCLUDES var
Browse files Browse the repository at this point in the history
In a recent series [1], I suggested to use KHDR_INCLUDES variable to
avoid having to duplicate UAPI header files.

The BPF CI builds the kernel in a separated directory -- KBUILD_OUTPUT
variable is set and exported -- and the BPF selftests are executed
directly, from the selftests/bpf directory, not from its parent. In thi
s case, it is required to override KHDR_INCLUDES to look at the build
directory, and not the kernel source, in 'usr/include'.

Note that tools/testing/selftests/Makefile supports KBUILD_OUTPUT, but
this Makefile is not used by the BPF CI: it directly uses the one from
the bpf directory: tools/testing/selftests/bpf/Makefile. That's fine,
KHDR_INCLUDES can be overridden, that should then fix the build issue
seen in [1].

Also, this KHDR_INCLUDES variable is not used by the BPF selftests
before my series [1]. It is then fine to merge this modification before
applying my modifications.

Link: https://lore.kernel.org/bpf/20240816-ups-bpf-next-selftests-use-khdr-v1-0-1e19f3d5b17a@kernel.org/ [1]
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
  • Loading branch information
matttbe committed Aug 17, 2024
1 parent 08fa529 commit a74ab20
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions build-selftests/build_selftests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ MAKE_OPTS=$(cat <<EOF
EOF
)
SELF_OPTS=$(cat <<EOF
KHDR_INCLUDES=-I${KBUILD_OUTPUT}/usr/include
-C ${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf
EOF
)
Expand Down

0 comments on commit a74ab20

Please sign in to comment.