nixpkgs/pkgs/os-specific/linux/bpftrace/btf-dump-new-0.6.0.patch
Dominique Martinet fa857bb435 bpftrace: fix build with libbpf 0.6.0
libbpf 0.6.0 relies on typeof in bpf/btf.h to pick the right version of
btf_dump__new() but that's not valid c++.
see https://github.com/iovisor/bpftrace/issues/2068
2021-12-06 07:15:56 +09:00

40 lines
1.1 KiB
Diff

diff -ur source/src/btf.cpp new/src/btf.cpp
--- source/src/btf.cpp 1970-01-01 09:00:01.000000000 +0900
+++ new/src/btf.cpp 2021-12-04 21:46:59.337023489 +0900
@@ -225,7 +225,7 @@
char err_buf[256];
int err;
- dump = btf_dump__new(btf, nullptr, &opts, dump_printf);
+ dump = btf_dump__new_deprecated(btf, nullptr, &opts, dump_printf);
err = libbpf_get_error(dump);
if (err)
{
@@ -496,7 +496,7 @@
char err_buf[256];
int err;
- dump = btf_dump__new(btf, nullptr, &opts, dump_printf);
+ dump = btf_dump__new_deprecated(btf, nullptr, &opts, dump_printf);
err = libbpf_get_error(dump);
if (err)
{
@@ -554,7 +554,7 @@
char err_buf[256];
int err;
- dump = btf_dump__new(btf, nullptr, &opts, dump_printf);
+ dump = btf_dump__new_deprecated(btf, nullptr, &opts, dump_printf);
err = libbpf_get_error(dump);
if (err)
{
@@ -648,7 +648,7 @@
char err_buf[256];
int err;
- dump = btf_dump__new(btf, nullptr, &opts, dump_printf);
+ dump = btf_dump__new_deprecated(btf, nullptr, &opts, dump_printf);
err = libbpf_get_error(dump);
if (err)
{