aquasecurity / libbpfgo

eBPF library for Go. Powered by libbpf.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libbpfgo fails to build on non-AMD64 architectures

jeffmahoney opened this issue · comments

libbpfgo fails to build on non-AMD64 architectures since commit 6070c0d (Add parsing function for mmap flags argument (#267)) since unix.MAP_32BIT only exists on AMD64 as a workaround for early versions of these CPUs.

Further, once this is fixed, it fails to build on ppc64 due to the kernel defining the 64-bit types for that architecture (initially) using typedefs to long. Later, it was changed to use long long like every other architecture, but for compatibility purposes, the "new" version must be explicitly enabled, which the project doesn't do. This ends up causing a build failure in bpfMapCreateOptsToC() because the map_extra member is defined as C.ulonglong and the original PPC64 types use unsigned long long for that field.

Thanks for opening this issue @jeffmahoney. We're releasing libbfgo today/tomorrow and I'll add this issue to the next milestone!

I just saw you provided a PR, so I'm including in this milestone, will review the PR today.