Thread (3 messages) 3 messages, 3 authors, 2021-09-29

Re: [PATCH bpf v2] samples: bpf: Fix vmlinux.h generation for XDP samples

From: Andrii Nakryiko <hidden>
Date: 2021-09-29 00:35:25

On Tue, Sep 28, 2021 at 6:47 AM Toke Høiland-Jørgensen [off-list ref] wrote:
Kumar Kartikeya Dwivedi [off-list ref] writes:
quoted
Generate vmlinux.h only from the in-tree vmlinux, and remove enum
declarations that would cause a build failure in case of version
mismatches.

There are now two options when building the samples:
1. Compile the kernel to use in-tree vmlinux for vmlinux.h
2. Override VMLINUX_BTF for samples using something like this:
   make VMLINUX_BTF=/sys/kernel/btf/vmlinux -C samples/bpf

This change was tested with relative builds, e.g. cases like:
 * make O=build -C samples/bpf
 * make KBUILD_OUTPUT=build -C samples/bpf
 * make -C samples/bpf
 * cd samples/bpf && make

When a suitable VMLINUX_BTF is not found, the following message is
printed:
/home/kkd/src/linux/samples/bpf/Makefile:333: *** Cannot find a vmlinux
for VMLINUX_BTF at any of "  ./vmlinux", build the kernel or set
VMLINUX_BTF variable.  Stop.

Cc: Toke Høiland-Jørgensen <redacted>
Fixes: 384b6b3bbf0d (samples: bpf: Add vmlinux.h generation support)
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Acked-by: Toke Høiland-Jørgensen <redacted>
Applied to bpf, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help