• Arnaldo Carvalho de Melo's avatar
    perf bpf: Move BPF disassembly routines to separate file to avoid clash with capstone bpf headers · ea59b70a
    Arnaldo Carvalho de Melo authored
    There is a clash of the libbpf and capstone libraries, that ends up
    with:
    
      In file included from /usr/include/capstone/capstone.h:325,
                       from util/disasm.c:1513:
      /usr/include/capstone/bpf.h:94:14: error: ‘bpf_insn’ defined as wrong kind of tag
         94 | typedef enum bpf_insn {
    
    So far we're just trying to avoid this by not having both headers
    included in the same .c or .h file, do it one more time by moving the
    BPF diassembly routines from util/disasm.c to util/disasm_bpf.c.
    
    This is only being hit when building with BUILD_NONDISTRO=1, i.e.
    building with binutils-devel, that isn't the in the default build due to
    a licencing clash. We need to reimplement what is now isolated in
    util/disasm_bpf.c using some other library to have BPF annotation
    feature that now only is available with BUILD_NONDISTRO=1.
    
    Fixes: 6d17edc1 ("perf annotate: Use libcapstone to disassemble")
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Ian Rogers <irogers@google.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Kan Liang <kan.liang@linux.intel.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Link: https://lore.kernel.org/lkml/ZqpUSKPxMwaQKORr@x1Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    ea59b70a
disasm.c 49.5 KB