mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 05:12:49 +00:00
samples: bpf: Don't fail for a missing VMLINUX_BTF when VMLINUX_H is provided
[ Upstream commitec24704492
] samples/bpf build currently always fails if it can't generate vmlinux.h from vmlinux, even when vmlinux.h is directly provided by VMLINUX_H variable, which makes VMLINUX_H pointless. Only fails when neither method works. Fixes:384b6b3bbf
("samples: bpf: Add vmlinux.h generation support") Reported-by: CKI Project <cki-project@redhat.com> Reported-by: Veronika Kabatova <vkabatov@redhat.com> Signed-off-by: Jerome Marchand <jmarchan@redhat.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220507161635.2219052-1-jmarchan@redhat.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
debf40e6cb
commit
994eb459c7
1 changed files with 4 additions and 5 deletions
|
@ -368,16 +368,15 @@ VMLINUX_BTF ?= $(abspath $(firstword $(wildcard $(VMLINUX_BTF_PATHS))))
|
||||||
|
|
||||||
$(obj)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL)
|
$(obj)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL)
|
||||||
ifeq ($(VMLINUX_H),)
|
ifeq ($(VMLINUX_H),)
|
||||||
|
ifeq ($(VMLINUX_BTF),)
|
||||||
|
$(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)",\
|
||||||
|
build the kernel or set VMLINUX_BTF or VMLINUX_H variable)
|
||||||
|
endif
|
||||||
$(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@
|
$(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@
|
||||||
else
|
else
|
||||||
$(Q)cp "$(VMLINUX_H)" $@
|
$(Q)cp "$(VMLINUX_H)" $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(VMLINUX_BTF),)
|
|
||||||
$(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)",\
|
|
||||||
build the kernel or set VMLINUX_BTF variable)
|
|
||||||
endif
|
|
||||||
|
|
||||||
clean-files += vmlinux.h
|
clean-files += vmlinux.h
|
||||||
|
|
||||||
# Get Clang's default includes on this system, as opposed to those seen by
|
# Get Clang's default includes on this system, as opposed to those seen by
|
||||||
|
|
Loading…
Reference in a new issue