ProcDump-for-Linux: 3.2.0: build fails with `libbpf: failed to find BTF info for object procdump_ebpf.o`
cmake settings
-- Cache values
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
CMAKE_INSTALL_PREFIX:PATH=/usr
PROCDUMP_DISABLE_SYSTEM_LIBBPF:BOOL=OFF
cmake params and output:
+ /usr/bin/cmake -B x86_64-redhat-linux-gnu -D BUILD_SHARED_LIBS=ON -D CMAKE_AR=/usr/bin/gcc-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/gcc-nm -D CMAKE_RANLIB=/usr/bin/gcc-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 -S .
-- The C compiler identification is GNU 14.0.1
-- The CXX compiler identification is GNU 14.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found ZLIB: /usr/lib64/libz.so (found version "1.3.0")
-- Found Libelf: /usr/lib64/libelf.so (found version "0.191")
-- Found Bpf: (found version "1.4.0") found components: libbpf
-- Found Bpf: (found version "1.4.0") found components: bpftool
-- Configuring done (1.5s)
-- Generating done (0.0s)
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_Fortran_FLAGS_RELEASE
INCLUDE_INSTALL_DIR
LIB_INSTALL_DIR
LIB_SUFFIX
SHARE_INSTALL_PREFIX
SYSCONF_INSTALL_DIR
And build fails with:
[ 24%] Built target ProcDumpProfiler
make -f CMakeFiles/procdump_ebpf.dir/build.make CMakeFiles/procdump_ebpf.dir/depend
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/ProcDump-for-Linux-3.2.0/x86_64-redhat-linux-gnu'
cd /home/tkloczko/rpmbuild/BUILD/ProcDump-for-Linux-3.2.0/x86_64-redhat-linux-gnu && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/tkloczko/rpmbuild/BUILD/ProcDump-for-Linux-3.2.0 /home/tkloczko/rpmbuild/BUILD/ProcDump-for-Linux-3.2.0 /home/tkloczko/rpmbuild/BUILD/ProcDump-for-Linux-3.2.0/x86_64-redhat-linux-gnu /home/tkloczko/rpmbuild/BUILD/ProcDump-for-Linux-3.2.0/x86_64-redhat-linux-gnu /home/tkloczko/rpmbuild/BUILD/ProcDump-for-Linux-3.2.0/x86_64-redhat-linux-gnu/CMakeFiles/procdump_ebpf.dir/DependInfo.cmake "--color="
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/ProcDump-for-Linux-3.2.0/x86_64-redhat-linux-gnu'
make -f CMakeFiles/procdump_ebpf.dir/build.make CMakeFiles/procdump_ebpf.dir/build
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/ProcDump-for-Linux-3.2.0/x86_64-redhat-linux-gnu'
[ 27%] Generating procdump.ebpf.o
/usr/sbin/bpftool gen object procdump.ebpf.o procdump_ebpf.o
libbpf: failed to find BTF info for object 'procdump_ebpf.o'
Error: failed to link 'procdump_ebpf.o': Invalid argument (22)
make[2]: *** [CMakeFiles/procdump_ebpf.dir/build.make:78: procdump.ebpf.o] Error 234
make[2]: *** Deleting file 'procdump.ebpf.o'
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/ProcDump-for-Linux-3.2.0/x86_64-redhat-linux-gnu'
make[1]: *** [CMakeFiles/Makefile2:308: CMakeFiles/procdump_ebpf.dir/all] Error 2
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/ProcDump-for-Linux-3.2.0/x86_64-redhat-linux-gnu'
make: *** [Makefile:94: all] Error 2
About this issue
- Original URL
- State: open
- Created 2 months ago
- Comments: 15
I’m not making any statements as to which technology came first or if one is better than the other 😃 Suffice to say, I was presenting an optional build strategy if you don’t need memory leak tracking and hence can remove the dependency on eBPF.
Thanks. I think GCC can build BPF code nowadays but it’s not something I have tried or is supported at the moment. Feel free to try it out if you want. There are a couple of other things to check: