Skip to content

gen_type_bindings.c errors on unsupported target #4

@jrfondren

Description

@jrfondren

I'm targeting Linux 5.14 on AlmaLinux 9, and intending to use older LSM hooks, and everything basically works fine except that the generated bindings include some unsupported symbols, with errors like

gen_type_bindings.c: In function 'main':
gen_type_bindings.c:555:58: error: 'BPF_MAP_TYPE_USER_RINGBUF' undeclared (first use in this function); did you mean 'BPF_MAP_TYPE_RINGBUF'?
  555 |      enum { check_BPF_MAP_TYPE_USER_RINGBUF_const = (int)BPF_MAP_TYPE_USER_RINGBUF };
      |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                          BPF_MAP_TYPE_RINGBUF
gen_type_bindings.c:555:58: note: each undeclared identifier is reported only once for each function it appears in

Quick workaround: adding print_endline "#define BPF_MAP_TYPE_USER_RINGBUF 0"; to the top of src/bindings/stubgen/gen_type_bindings.ml

In jrfondren@45bd02b I added the kernel filtering I need for this target, but a more thorough solution could associate a kernel version with everything from https://github.com/isovalent/ebpf-docs/blob/master/docs/linux/timeline/index.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions