I tried to call bpftool directly instead of using the /usr/sbin/bpftool
script:
https://git.launchpad.net/~danilogondolfo/ubuntu/+source/delve/commit/?h=ubuntu/devel&id=2cf86a5394786f9ec8b2931d0c4c05af992be1c2

It kinda worked but then the build failed with:

In file included from 
/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/github.com/go-delve/delve/pkg/proc/internal/ebpf/bpf/trace.bpf.c:1:
/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/github.com/go-delve/delve/pkg/proc/internal/ebpf/bpf/include/trace.bpf.h:10:17:
 error: use of undeclared identifier 'BPF_MAP_TYPE_RINGBUF'
   __uint(type, BPF_MAP_TYPE_RINGBUF);
                ^
/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/github.com/go-delve/delve/pkg/proc/internal/ebpf/bpf/include/trace.bpf.h:15:17:
 error: use of undeclared identifier 'BPF_MAP_TYPE_RINGBUF'
   __uint(type, BPF_MAP_TYPE_RINGBUF);
                ^
/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/github.com/go-delve/delve/pkg/proc/internal/ebpf/bpf/trace.bpf.c:243:37:
 error: use of undeclared identifier 'BPF_RB_FORCE_WAKEUP'
    bpf_ringbuf_submit(parsed_args, BPF_RB_FORCE_WAKEUP);
                                    ^
3 errors generated.
Error: clang: exit status 1


Looks like pkg/proc/internal/ebpf/bpf/include/trace.bpf.h is missing a #include 
<linux/bpf.h>

Maybe there is a better solution than this hack...

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/2021481

Title:
  delve ftbfs on amd64 due to bpftool

Status in delve package in Ubuntu:
  Confirmed
Status in linux package in Ubuntu:
  Confirmed

Bug description:
  src/github.com/go-delve/delve/pkg/proc/internal/ebpf/helpers.go
  WARNING: bpftool not found for kernel 6.1.0-9

    You may need to install the following packages for this specific kernel:
      linux-tools-6.1.0-9-amd64
      linux-cloud-tools-6.1.0-9-amd64

    You may also want to install one of the following packages to keep up to 
date:
      linux-tools-amd64
      linux-cloud-tools-amd64

  The Debian package build-depends on bpftool. But bpftool is different
  in Debian and Ubuntu. On Ubuntu it's provided by linux-tools-common.
  However it seems it needs linux-tools-amd64 as well?

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/delve/+bug/2021481/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to