Message ID | 20201214220040.10644-2-kamal@canonical.com |
---|---|
State | New |
Headers | show |
Series | disable building bpf selftests | expand |
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 50965cc7bf09..0b924c168965 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -188,6 +188,9 @@ $(BUILD_DIR)/libbpf $(BUILD_DIR)/bpftool $(INCLUDE_DIR): $(INCLUDE_DIR)/vmlinux.h: $(VMLINUX_BTF) | $(BPFTOOL) $(INCLUDE_DIR) $(call msg,GEN,,$@) +ifeq ($(VMLINUX_BTF),) +$(error cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)") +endif $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@ # Get Clang's default includes on this system, as opposed to those seen by
BugLink: https://bugs.launchpad.net/bugs/1908144 If Makefile cannot find any of the vmlinux's in its VMLINUX_BTF_PATHS list, it tries to run btftool incorrectly, with VMLINUX_BTF unset: bpftool btf dump file $(VMLINUX_BTF) format c Such that the keyword 'format' is misinterpreted as the path to vmlinux. The resulting build error message is fairly cryptic: GEN vmlinux.h Error: failed to load BTF from format: No such file or directory This patch makes the failure reason clearer by yielding this instead: Makefile:...: *** cannot find a vmlinux for VMLINUX_BTF at any of "{paths}". Stop. Fixes: acbd06206bbb ("selftests/bpf: Add vmlinux.h selftest exercising tracing of syscalls") Cc: stable@vger.kernel.org # 5.7+ Signed-off-by: Kamal Mostafa <kamal@canonical.com> Reference: https://lore.kernel.org/bpf/20201214202049.7205-1-kamal@canonical.com/ --- tools/testing/selftests/bpf/Makefile | 3 +++ 1 file changed, 3 insertions(+)