Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1002291: bpfcc: Fails to build with libbpf/0.6.1-1

100 views
Skip to first unread message

Sudip Mukherjee

unread,
Dec 21, 2021, 2:30:03 PM12/21/21
to
Source: bpfcc
Version: 0.22.0+ds-2
Severity: important
Tags: ftbfs
X-Debbugs-Cc: sudipm.m...@gmail.com

Dear Maintainer,

bpfcc is failing to build with the latest release of libbpf.

Reported error:
In file included from /<<PKGBUILDDIR>>/src/cc/bcc_libbpf_inc.h:5,
from /<<PKGBUILDDIR>>/src/cc/frontends/clang/b_frontend_action.cc:37:
/usr/include/bpf/btf.h: In function ‘bool btf_is_mod(const btf_type*)’:
/usr/include/bpf/btf.h:463:24: error: ‘BTF_KIND_TYPE_TAG’ was not declared in this scope; did you mean ‘BTF_KIND_TYPEDEF’?
463 | kind == BTF_KIND_TYPE_TAG;
| ^~~~~~~~~~~~~~~~~
| BTF_KIND_TYPEDEF
/usr/include/bpf/btf.h: In function ‘bool btf_is_decl_tag(const btf_type*)’:
/usr/include/bpf/btf.h:493:31: error: ‘BTF_KIND_DECL_TAG’ was not declared in this scope; did you mean ‘BTF_KIND_FLOAT’?
493 | return btf_kind(t) == BTF_KIND_DECL_TAG;
| ^~~~~~~~~~~~~~~~~
| BTF_KIND_FLOAT
/usr/include/bpf/btf.h: In function ‘bool btf_is_type_tag(const btf_type*)’:
/usr/include/bpf/btf.h:498:31: error: ‘BTF_KIND_TYPE_TAG’ was not declared in this scope; did you mean ‘BTF_KIND_TYPEDEF’?
498 | return btf_kind(t) == BTF_KIND_TYPE_TAG;
| ^~~~~~~~~~~~~~~~~
| BTF_KIND_TYPEDEF


I have uploaded libbpf to experimental for now.


--
Regards
Sudip

Vasudev Kamath

unread,
Dec 22, 2021, 6:10:04 AM12/22/21
to
Hi Sudip,

Sudip Mukherjee <sudipm.m...@gmail.com> writes:


>
> Reported error:
> In file included from /<<PKGBUILDDIR>>/src/cc/bcc_libbpf_inc.h:5,
> from /<<PKGBUILDDIR>>/src/cc/frontends/clang/b_frontend_action.cc:37:
> /usr/include/bpf/btf.h: In function ‘bool btf_is_mod(const btf_type*)’:
> /usr/include/bpf/btf.h:463:24: error: ‘BTF_KIND_TYPE_TAG’ was not declared in this scope; did you mean ‘BTF_KIND_TYPEDEF’?
> 463 | kind == BTF_KIND_TYPE_TAG;
> | ^~~~~~~~~~~~~~~~~
> | BTF_KIND_TYPEDEF
> /usr/include/bpf/btf.h: In function ‘bool btf_is_decl_tag(const btf_type*)’:
> /usr/include/bpf/btf.h:493:31: error: ‘BTF_KIND_DECL_TAG’ was not declared in this scope; did you mean ‘BTF_KIND_FLOAT’?
> 493 | return btf_kind(t) == BTF_KIND_DECL_TAG;
> | ^~~~~~~~~~~~~~~~~
> | BTF_KIND_FLOAT
> /usr/include/bpf/btf.h: In function ‘bool btf_is_type_tag(const btf_type*)’:
> /usr/include/bpf/btf.h:498:31: error: ‘BTF_KIND_TYPE_TAG’ was not declared in this scope; did you mean ‘BTF_KIND_TYPEDEF’?
> 498 | return btf_kind(t) == BTF_KIND_TYPE_TAG;
> | ^~~~~~~~~~~~~~~~~
> | BTF_KIND_TYPEDEF
>

I tried building bpfcc 0.23.0 with experimental libbpf and it too
failed. These versions are released with 0.5.0 libbpf. I see that next
release 0.24.0 (not sure when it happens) should work with newer libbpf.
Can we hold uploading newer libbpf to unstable till then?.

Thanks and Regards,
Vasudev

Sudip Mukherjee

unread,
Dec 23, 2021, 1:20:03 PM12/23/21
to
On Wed, Dec 22, 2021 at 10:52 AM Vasudev Kamath <vas...@copyninja.info> wrote:
>
> Hi Sudip,
>
> Sudip Mukherjee <sudipm.m...@gmail.com> writes:
>
>
> >
> > Reported error:

<snip>

> >
>
> I tried building bpfcc 0.23.0 with experimental libbpf and it too
> failed. These versions are released with 0.5.0 libbpf. I see that next
> release 0.24.0 (not sure when it happens) should work with newer libbpf.
> Can we hold uploading newer libbpf to unstable till then?.

Sure, just let me know when its ready and I can upload then.


--
Regards
Sudip

Sudip Mukherjee

unread,
Feb 16, 2022, 2:30:03 PM2/16/22
to
Hi Vasudev,
Seems like the FTBFS is not there with libbpf/0.7.0
I will upload to experimental by Friday so that you can test.

--
Regards
Sudip

Sudip Mukherjee

unread,
Feb 18, 2022, 1:40:03 PM2/18/22
to
Hi Vasudev,

On Wed, Feb 16, 2022 at 7:15 PM Sudip Mukherjee
<sudipm.m...@gmail.com> wrote:
>
> Hi Vasudev,
>
> On Thu, Dec 23, 2021 at 6:07 PM Sudip Mukherjee
> <sudipm.m...@gmail.com> wrote:
> >
> > On Wed, Dec 22, 2021 at 10:52 AM Vasudev Kamath <vas...@copyninja.info> wrote:
> > >

<snip>

>
> Seems like the FTBFS is not there with libbpf/0.7.0
> I will upload to experimental by Friday so that you can test.

I have now uploaded libbpf/0.7.0 to experimental, can you please try
building bpfcc and let me know if it works for you.


--
Regards
Sudip

Vasudev Kamath

unread,
Feb 19, 2022, 1:00:03 AM2/19/22
to
Sudip Mukherjee <sudipm.m...@gmail.com> writes:

> I have now uploaded libbpf/0.7.0 to experimental, can you please try
> building bpfcc and let me know if it works for you.
>

I'm ending up getting different error now related to deprecation.

>/<<PKGBUILDDIR>>/src/cc/bcc_btf.cc:178:33: error: invalid application of ‘sizeof’ to incomplete type ‘btf_ext_vendored::btf_ext_setup_core_relos(btf_ext_vendored::btf_ext*)::bpf_core_relo’
> 178 | .min_rec_size = sizeof(struct bpf_core_relo),
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /<<PKGBUILDDIR>>/src/cc/bcc_btf.cc: In member function ‘int ebpf::BTF::get_map_tids(std::string, unsigned int, unsigned int, unsigned int*, unsigned int*)’:
> /<<PKGBUILDDIR>>/src/cc/bcc_btf.cc:655:30: warning: ‘int btf__get_map_kv_tids(const btf*, const char*, __u32, __u32, __u32*, __u32*)’ is deprecated: libbpf v0.7+: this API is not necessary when BTF-defined maps are used [-Wdeprecated-declarations]
> 655 | return btf__get_map_kv_tids(btf_, map_name.c_str(),
> | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
> 656 | expected_ksize, expected_vsize,
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 657 | key_tid, value_tid);
> | ~~~~~~~~~~~~~~~~~~~
> In file included from /<<PKGBUILDDIR>>/src/cc/bcc_libbpf_inc.h:5,
> from /<<PKGBUILDDIR>>/src/cc/bcc_btf.cc:22:
> /usr/include/bpf/btf.h:154:16: note: declared here
> 154 | LIBBPF_API int btf__get_map_kv_tids(const struct btf *btf, const char *map_name,
> | ^~~~~~~~~~~~~~~~~~~~
> /<<PKGBUILDDIR>>/src/cc/bcc_btf.cc: In function ‘int btf_ext_vendored::btf_ext_setup_core_relos(btf_ext_vendored::btf_ext*)’:
> /<<PKGBUILDDIR>>/src/cc/bcc_btf.cc:178:33: error: invalid application of ‘sizeof’ to incomplete type ‘btf_ext_vendored::btf_ext_setup_core_relos(btf_ext_vendored::btf_ext*)::bpf_core_relo’
> 178 | .min_rec_size = sizeof(struct bpf_core_relo),
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /<<PKGBUILDDIR>>/src/cc/bcc_btf.cc: In member function ‘int ebpf::BTF::get_map_tids(std::string, unsigned int, unsigned int, unsigned int*, unsigned int*)’:
> /<<PKGBUILDDIR>>/src/cc/bcc_btf.cc:655:30: warning: ‘int btf__get_map_kv_tids(const btf*, const char*, __u32, __u32, __u32*, __u32*)’ is deprecated: libbpf v0.7+: this API is not necessary when BTF-defined maps are used [-Wdeprecated-declarations]
> 655 | return btf__get_map_kv_tids(btf_, map_name.c_str(),
> | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
> 656 | expected_ksize, expected_vsize,
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 657 | key_tid, value_tid);
> | ~~~~~~~~~~~~~~~~~~~
> In file included from /<<PKGBUILDDIR>>/src/cc/bcc_libbpf_inc.h:5,
> from /<<PKGBUILDDIR>>/src/cc/bcc_btf.cc:22:
> /usr/include/bpf/btf.h:154:16: note: declared here
> 154 | LIBBPF_API int btf__get_map_kv_tids(const struct btf *btf, const char *map_name,
> | ^~~~~~~~~~~~~~~~~~~~
> make[3]: *** [src/cc/CMakeFiles/bcc-shared.dir/build.make:121: src/cc/CMakeFiles/bcc-shared.dir/bcc_btf.cc.o] Error 1
> make[3]: *** Waiting for unfinished jobs....
> [ 69%] Building CXX object src/cc/CMakeFiles/bcc-static.dir/bpf_module_rw_engine.cc.o
> cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/cc && /usr/bin/c++ -DEXPORT_USDT -DHAVE_EXTERNAL_LIBBPF -I/usr/lib/llvm-13/include/../tools/clang/include -I/<<PKGBUILDDIR>>/src -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/cc -I/<<PKGBUILDDIR>>/src/cc -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/cc/frontends/b -I/<<PKGBUILDDIR>>/src/cc/frontends/b -I/<<PKGBUILDDIR>>/src/cc/frontends/clang -I/usr/lib/llvm-13/include -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DCUSTOM_MACRO=true -Wall -fno-rtti -fPIC -DBCC_PROG_TAG_DIR='"/var/tmp/bcc"' -Wno-unused-result -DLLVM_MAJOR_VERSION=13 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -std=gnu++14 -MD -MT src/cc/CMakeFiles/bcc-static.dir/bpf_module_rw_engine.cc.o -MF CMakeFiles/bcc-static.dir/bpf_module_rw_engine.cc.o.d -o CMakeFiles/bcc-static.dir/bpf_module_rw_engine.cc.o -c /<<PKGBUILDDIR>>/src/cc/bpf_module_rw_engine.cc
> [ 69%] Building CXX object src/cc/CMakeFiles/bcc-shared.dir/exported_files.cc.o
> cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/cc && /usr/bin/c++ -DEXPORT_USDT -DHAVE_EXTERNAL_LIBBPF -Dbcc_shared_EXPORTS -I/usr/lib/llvm-13/include/../tools/clang/include -I/<<PKGBUILDDIR>>/src -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/cc -I/<<PKGBUILDDIR>>/src/cc -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/cc/frontends/b -I/<<PKGBUILDDIR>>/src/cc/frontends/b -I/<<PKGBUILDDIR>>/src/cc/frontends/clang -I/usr/lib/llvm-13/include -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DCUSTOM_MACRO=true -Wall -fno-rtti -fPIC -DBCC_PROG_TAG_DIR='"/var/tmp/bcc"' -Wno-unused-result -DLLVM_MAJOR_VERSION=13 -fPIC -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -std=gnu++14 -MD -MT src/cc/CMakeFiles/bcc-shared.dir/exported_files.cc.o -MF CMakeFiles/bcc-shared.dir/exported_files.cc.o.d -o CMakeFiles/bcc-shared.dir/exported_files.cc.o -c /<<PKGBUILDDIR>>/src/cc/exported_files.cc
> make[3]: *** [src/cc/CMakeFiles/bcc-static.dir/build.make:107: src/cc/CMakeFiles/bcc-static.dir/bcc_btf.cc.o] Error 1
> make[3]: *** Waiting for unfinished jobs....
> /<<PKGBUILDDIR>>/src/cc/bpf_module_rw_engine.cc: In function ‘llvm::LoadInst* ebpf::createLoad(llvm::IRBuilder<>&, llvm::Value*, bool)’:
> /<<PKGBUILDDIR>>/src/cc/bpf_module_rw_engine.cc:55:22: warning: ‘llvm::LoadInst* llvm::IRBuilderBase::CreateLoad(llvm::Value*, bool, const llvm::Twine&)’ is deprecated: Use the version that explicitly specifies the loaded type instead [-Wdeprecated-declarations]
> 55 | return B.CreateLoad(addr, isVolatile);
> | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
> In file included from /usr/lib/llvm-13/include/llvm/Support/ErrorHandling.h:17,
> from /usr/lib/llvm-13/include/llvm/ADT/Hashing.h:48,
> from /usr/lib/llvm-13/include/llvm/ADT/ArrayRef.h:12,
> from /usr/lib/llvm-13/include/llvm/ExecutionEngine/ExecutionEngine.h:18,
> from /usr/lib/llvm-13/include/llvm/ExecutionEngine/MCJIT.h:17,
> from /<<PKGBUILDDIR>>/src/cc/bpf_module_rw_engine.cc:20:
> /usr/lib/llvm-13/include/llvm/IR/IRBuilder.h:1686:39: note: declared here
> 1686 | LLVM_ATTRIBUTE_DEPRECATED(LoadInst *CreateLoad(Value *Ptr,
> | ^~~~~~~~~~
> /usr/lib/llvm-13/include/llvm/Support/Compiler.h:320:74: note: in definition of macro ‘LLVM_ATTRIBUTE_DEPRECATED’
> 320 | #define LLVM_ATTRIBUTE_DEPRECATED(decl, message) [[deprecated(message)]] decl
> | ^~~~
> /<<PKGBUILDDIR>>/src/cc/bpf_module_rw_engine.cc: In function ‘llvm::Value* ebpf::createInBoundsGEP(llvm::IRBuilder<>&, llvm::Value*, llvm::ArrayRef<llvm::Value*>)’:
> /<<PKGBUILDDIR>>/src/cc/bpf_module_rw_engine.cc:65:29: warning: ‘llvm::Value* llvm::IRBuilderBase::CreateInBoundsGEP(llvm::Value*, llvm::ArrayRef<llvm::Value*>, const llvm::Twine&)’ is deprecated: Use the version with explicit element type instead [-Wdeprecated-declarations]
> 65 | return B.CreateInBoundsGEP(ptr, idxlist);
> | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
> In file included from /usr/lib/llvm-13/include/llvm/Support/ErrorHandling.h:17,
> from /usr/lib/llvm-13/include/llvm/ADT/Hashing.h:48,
> from /usr/lib/llvm-13/include/llvm/ADT/ArrayRef.h:12,
> from /usr/lib/llvm-13/include/llvm/ExecutionEngine/ExecutionEngine.h:18,
> from /usr/lib/llvm-13/include/llvm/ExecutionEngine/MCJIT.h:17,
> from /<<PKGBUILDDIR>>/src/cc/bpf_module_rw_engine.cc:20:
> /usr/lib/llvm-13/include/llvm/IR/IRBuilder.h:1810:14: note: declared here
> 1810 | Value *CreateInBoundsGEP(Value *Ptr, ArrayRef<Value *> IdxList,
> | ^~~~~~~~~~~~~~~~~
> /usr/lib/llvm-13/include/llvm/Support/Compiler.h:320:74: note: in definition of macro ‘LLVM_ATTRIBUTE_DEPRECATED’
> 320 | #define LLVM_ATTRIBUTE_DEPRECATED(decl, message) [[deprecated(message)]] decl

I don't really have time to debug this I was hoping upstream to fix
this. As they embed libbpf and we removed the embedded file. I will just
wait for some more time till they include libbpf with their release.

Previous release also did not work with libbpf 0.6.0 even though
embedded version included 0.6.0 in it. Again I did not get enough time
to debug.

Cheers,
Vasudev

Sudip Mukherjee

unread,
Feb 19, 2022, 7:30:03 PM2/19/22
to
On Sat, Feb 19, 2022 at 5:36 AM Vasudev Kamath <vas...@copyninja.info> wrote:
>
> Sudip Mukherjee <sudipm.m...@gmail.com> writes:
>
> > I have now uploaded libbpf/0.7.0 to experimental, can you please try
> > building bpfcc and let me know if it works for you.
> >
>
> I'm ending up getting different error now related to deprecation.

I am not sure why and how you are getting the error. I have tried
building bpfcc_0.22.0+ds-2 with sbuild and have also tried building in
an unstable VM with dpkg-buildpackage and in both the cases it has
built fine with libbpf/0.7.0


--
Regards
Sudip

Sudip Mukherjee

unread,
Feb 21, 2022, 4:30:03 AM2/21/22
to
> Regular build using sbuild + git-buildpackage. Attaching the full log
> and git diff. I tried to build using libbpf 0.7.0 from experimental. But
> it continues to fail.
>
>
> Let me know if you are able to figure out. I'm bit lost and unable to
> really figure out what is happening here.

You are trying to build 0.24.0+ds and I am rebuilding 0.22.0+ds-2 to test. :)

Can you rebuild 0.22.0+ds-2 and verify.


--
Regards
Sudip

Vasudev Kamath

unread,
Feb 21, 2022, 11:20:03 PM2/21/22
to
Sudip Mukherjee <sudipm.m...@gmail.com> writes:

> You are trying to build 0.24.0+ds and I am rebuilding 0.22.0+ds-2 to test. :)
>
> Can you rebuild 0.22.0+ds-2 and verify.

Err yes. It works with 0.22.0. I was preparing 0.23.0 and then 0.24.0.
Both of which fails as of now. Not sure what should be done.

Cheers,
Vasudev

Sudip Mukherjee

unread,
Feb 23, 2022, 5:10:04 AM2/23/22
to
I think, since it works with 0.22.0 I will update libbpf in unstable.
I am guessing the previous FTBFS was fixed by libbpf in this release.
But now bpfcc has messed up something.
If you are ok, then I can update libbpf and then you can ping the
bpfcc upstream about the FTBFS with latest bpfcc with latest libbpf.


--
Regards
Sudip

Vasudev Kamath

unread,
Feb 23, 2022, 6:40:03 AM2/23/22
to
Yes please go ahead. I will wait for the new upload a bit more. If it
still does not work I will ping the upstream.

Cheers,
Vasudev

Sudip Mukherjee

unread,
Feb 26, 2022, 7:10:03 PM2/26/22
to
HI Vasudev,

On Wed, Feb 23, 2022 at 11:30 AM Vasudev Kamath <vas...@copyninja.info> wrote:
>
> Sudip Mukherjee <sudipm.m...@gmail.com> writes:
>
> > On Tue, Feb 22, 2022 at 4:12 AM Vasudev Kamath <vas...@copyninja.info> wrote:
> >>
> >> Sudip Mukherjee <sudipm.m...@gmail.com> writes:
> >>
> >> > You are trying to build 0.24.0+ds and I am rebuilding 0.22.0+ds-2 to test. :)
> >> >
> >> > Can you rebuild 0.22.0+ds-2 and verify.
> >>
> >> Err yes. It works with 0.22.0. I was preparing 0.23.0 and then 0.24.0.
> >> Both of which fails as of now. Not sure what should be done.
> >
> > I think, since it works with 0.22.0 I will update libbpf in unstable.
> > I am guessing the previous FTBFS was fixed by libbpf in this release.
> > But now bpfcc has messed up something.
> > If you are ok, then I can update libbpf and then you can ping the
> > bpfcc upstream about the FTBFS with latest bpfcc with latest libbpf.
>
> Yes please go ahead. I will wait for the new upload a bit more. If it
> still does not work I will ping the upstream.

Thanks. I have uploaded now.
Also, if you can please push your branch to salsa I can have a look
sometime next week.


--
Regards
Sudip
0 new messages