lkml.org 
[lkml]   [2022]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH v2 bpf 06/11] samples/bpf: use host bpftool to generate vmlinux.h, not target
    Use the host build of bpftool (bootstrap) instead of the target one
    to generate vmlinux.h/skeletons for the BPF samples. Otherwise, when
    host != target, samples compilation fails with:

    /bin/sh: line 1: samples/bpf/bpftool/bpftool: failed to exec: Exec
    format error

    Fixes: 384b6b3bbf0d ("samples: bpf: Add vmlinux.h generation support")
    Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
    Acked-by: Song Liu <songliubraving@fb.com>
    Signed-off-by: Alexander Lobakin <alobakin@pm.me>
    ---
    samples/bpf/Makefile | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
    index 70323ac1114f..2bb9088a8d91 100644
    --- a/samples/bpf/Makefile
    +++ b/samples/bpf/Makefile
    @@ -291,12 +291,13 @@ $(LIBBPF): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(LIBBPF_OU

    BPFTOOLDIR := $(TOOLS_PATH)/bpf/bpftool
    BPFTOOL_OUTPUT := $(abspath $(BPF_SAMPLES_PATH))/bpftool
    -BPFTOOL := $(BPFTOOL_OUTPUT)/bpftool
    +BPFTOOL := $(BPFTOOL_OUTPUT)/bootstrap/bpftool
    $(BPFTOOL): $(LIBBPF) $(wildcard $(BPFTOOLDIR)/*.[ch] $(BPFTOOLDIR)/Makefile) | $(BPFTOOL_OUTPUT)
    $(MAKE) -C $(BPFTOOLDIR) srctree=$(BPF_SAMPLES_PATH)/../../ \
    OUTPUT=$(BPFTOOL_OUTPUT)/ \
    LIBBPF_OUTPUT=$(LIBBPF_OUTPUT)/ \
    - LIBBPF_DESTDIR=$(LIBBPF_DESTDIR)/
    + LIBBPF_DESTDIR=$(LIBBPF_DESTDIR)/ \
    + bootstrap

    $(LIBBPF_OUTPUT) $(BPFTOOL_OUTPUT):
    $(call msg,MKDIR,$@)
    --
    2.36.0

    \
     
     \ /
      Last update: 2022-04-21 02:43    [W:3.301 / U:1.344 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site