iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.61k stars 3.89k forks source link

0.15.0: build fails #2982

Open kloczek opened 4 years ago

kloczek commented 4 years ago
+ /usr/bin/cmake -D BUILD_SHARED_LIBS=ON -D CMAKE_AR=/usr/bin/ar -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_FLAGS_RELEASE=-DNDEBUG -D CMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -D CMAKE_Fortran_FLAGS_RELEASE=-DNDEBUG -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_NM=/usr/bin/nm -D CMAKE_RANLIB=/usr/bin/ranlib -D CMAKE_VERBOSE_MAKEFILE=ON -D INCLUDE_INSTALL_DIR=/usr/include -D LIB_INSTALL_DIR=/usr/lib64 -D LIB_SUFFIX=64 -D SHARE_INSTALL_PREFIX=/usr/share -D SYSCONF_INSTALL_DIR=/etc . -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_USE_LIBBPF_PACKAGE=ON -D ENABLE_LLVM_SHARED=ON -D PYTHON_CMD=/usr/bin/python3 -D REVISION_LAST=0.15.0 -D REVISION=0.15.0

[..]

[ 30%] Building C object introspection/CMakeFiles/bps.dir/bps.c.o
cd /home/tkloczko/rpmbuild/BUILD/bcc-0.15.0/introspection && /usr/bin/gcc  -I/usr/include/../tools/clang/include -I/home/tkloczko/rpmbuild/BUILD/bcc-0.15.0/src/cc -I/home/tkloczko/rpmbuild/BUILD/bcc-0.15.0/src/cc/api -I/home/tkloczko/rpmbuild/BUILD/bcc-0.15.0/src/cc/libbpf/include/uapi  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wall -O2 -g -DNDEBUG   -o CMakeFiles/bps.dir/bps.c.o   -c /home/tkloczko/rpmbuild/BUILD/bcc-0.15.0/introspection/bps.c
/home/tkloczko/rpmbuild/BUILD/bcc-0.15.0/introspection/bps.c:78:4: error: ‘BPF_MAP_TYPE_RINGBUF’ undeclared here (not in a function); did you mean ‘BPF_MAP_TYPE_QUEUE’?
   78 |   [BPF_MAP_TYPE_RINGBUF] = "ringbuf",
      |    ^~~~~~~~~~~~~~~~~~~~
      |    BPF_MAP_TYPE_QUEUE
/home/tkloczko/rpmbuild/BUILD/bcc-0.15.0/introspection/bps.c:78:4: error: array index in initializer not of integer type
/home/tkloczko/rpmbuild/BUILD/bcc-0.15.0/introspection/bps.c:78:4: note: (near initialization for ‘map_type_strings’)
make[2]: *** [introspection/CMakeFiles/bps.dir/build.make:86: introspection/CMakeFiles/bps.dir/bps.c.o] Error 1
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/bcc-0.15.0'
make[1]: *** [CMakeFiles/Makefile2:1086: introspection/CMakeFiles/bps.dir/all] Error 2
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/bcc-0.15.0'
yonghong-song commented 4 years ago

It built successfully in my environment. In release page https://github.com/iovisor/bcc/releases/tag/v0.15.0 please be sure to use bcc-src-with-submodule.tar.gz or bcc-src-with-submodule.zip.

kloczek commented 4 years ago

It would be way better instead include libbpf tree just check in one cmake line availability of the libpf 0.0.9 using pkgconfig. Include other module is always nothing more than asking for troubles.

kloczek commented 4 years ago

So is it any reasion why bcc is not using shared system libbpf?

yonghong-song commented 4 years ago

There is option cmake option CMAKE_USE_LIBBPF_PACKAGE to use system libbpf package.

kloczek commented 4 years ago

I've started working on patch for that.

yonghong-song commented 4 years ago

Thanks!

kloczek commented 3 years ago

So far I had no time to make progress on that patch. Just question: do you have at all intention to abandon inclided libbpf and use only system available libbpf library?

yonghong-song commented 3 years ago

No. We will support both mode.