Open Apteryks opened 7 months ago
The same happens when attempting to build from the latest commit: b3734896de3fa23a78003a0d203d6a3aae896339
.
Seems related to the use of "-DBUILD_SHARED_LIBS=ON"
. When switching this to OFF, it proceeds further, but eventually fails with:
[ 70%] Building C object libscap/engine/bpf/CMakeFiles/scap_engine_bpf.dir/scap_bpf.c.o
cd /tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/build/libscap/engine/bpf && /gnu/store/5lqhcv91ijy82p92ac6g5xw48l0lwwz4-gcc-11.3.0/bin/gcc -DHAVE_SYS_SYSMACROS_H -DPLATFORM_NAME=\"Linux\" -DSCAP_HOSTNAME_ENV_VAR=\"SCAP_HOSTNAME\" -DSCAP_HOST_ROOT_ENV_VAR_NAME=\"HOST_ROOT\" -DSCAP_KERNEL_MODULE_NAME=\"scap\" -D__STDC_FORMAT_MACROS -I/gnu/store/l2iwk7p08lpb0hhcp2jnlkqs06520441-googletest-1.12.1/include/gtest -I/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/build/driver/src -I/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/source -I/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/source/userspace -I/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/build -I/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/source/userspace/libscap/linux -Wall -ggdb -O2 -g -DNDEBUG -MD -MT libscap/engine/bpf/CMakeFiles/scap_engine_bpf.dir/scap_bpf.c.o -MF CMakeFiles/scap_engine_bpf.dir/scap_bpf.c.o.d -o CMakeFiles/scap_engine_bpf.dir/scap_bpf.c.o -c /tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/source/userspace/libscap/engine/bpf/scap_bpf.c
/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/source/userspace/libscap/engine/bpf/scap_bpf.c: In function ‘load_bpf_file’:
/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/source/userspace/libscap/engine/bpf/scap_bpf.c:717:61: error: ‘ELF_C_READ_MMAP_PRIVATE’ undeclared (first use in this function)
717 | handle->elf = elf_begin(handle->program_fd, ELF_C_READ_MMAP_PRIVATE, NULL);
| ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/source/userspace/libscap/engine/bpf/scap_bpf.c:717:61: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [libscap/engine/bpf/CMakeFiles/scap_engine_bpf.dir/build.make:79: libscap/engine/bpf/CMakeFiles/scap_engine_bpf.dir/scap_bpf.c.o] Error 1
make[3]: Leaving directory '/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/build'
make[2]: *** [CMakeFiles/Makefile2:1163: libscap/engine/bpf/CMakeFiles/scap_engine_bpf.dir/all] Error 2
make[2]: Leaving directory '/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/build'
make[1]: *** [CMakeFiles/Makefile2:814: libscap/CMakeFiles/scap.dir/rule] Error 2
make[1]: Leaving directory '/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/build'
make: *** [Makefile:341: scap] Error 2
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("-j" "1" "scap") exit-status: 2 term-signal: #f stop-signal: #f>
phase `build' failed after 13.9 seconds
/tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/source/userspace/libscap/engine/bpf/scap_bpf.c: In function ‘load_bpf_file’: /tmp/guix-build-falcosecurity-libs-0.15.1.drv-0/source/userspace/libscap/engine/bpf/scap_bpf.c:717:61: error: ‘ELF_C_READ_MMAP_PRIVATE’ undeclared (first use in this function) 717 | handle->elf = elf_begin(handle->program_fd, ELF_C_READ_MMAP_PRIVATE, NULL);
This was resolved by adding elfutils
to the build environment. Ideally CMake should check for it.
I've made some progress on this. I'm now encountering:
[ 98%] Linking CXX executable libscap_test
cd /home/maxim/src/falcosecurity-libs/build4/test/libscap && /gnu/store/jg0xx3g6ac56mfs7646qln18z4y9fpj0-cmake-minimal-3.24.2/bin/cmake -E cmake_link_script CMakeFiles/libscap_test.dir/link.txt --verbose=1
/gnu/store/zkzvc2b0xggy6ah9xxyar1i1z9dj185i-profile/bin/c++ -Wall -ggdb -std=c++17 -O3 -fno-strict-aliasing -DNDEBUG CMakeFiles/libscap_test.dir/test_suites/userspace/common_strl.cpp.o CMakeFiles/libscap_test.dir/test_suites/userspace/event_table.cpp.o CMakeFiles/libscap_test.dir/test_suites/userspace/linux/scap_cgroup.cpp.o CMakeFiles/libscap_test.dir/test_suites/userspace/ppm_sc_names_table.cpp.o CMakeFiles/libscap_test.dir/test_suites/userspace/scap_event.cpp.o CMakeFiles/libscap_test.dir/test_suites/userspace/scap_ppm_sc.cpp.o CMakeFiles/libscap_test.dir/test_suites/userspace/syscall_table.cpp.o CMakeFiles/libscap_test.dir/helpers/engines.cpp.o CMakeFiles/libscap_test.dir/test_suites/engines/modern_bpf/modern_bpf.cpp.o CMakeFiles/libscap_test.dir/test_suites/engines/gvisor/gvisor_parsers.cpp.o CMakeFiles/libscap_test.dir/test_suites/engines/gvisor/gvisor_platform.cpp.o -o libscap_test -Wl,-rpath,/home/maxim/src/falcosecurity-libs/build4/libscap:/home/maxim/src/falcosecurity-libs/build4/libscap/engine/nodriver:/home/maxim/src/falcosecurity-libs/build4/libscap/engine/test_input:/home/maxim/src/falcosecurity-libs/build4/libscap/engine/source_plugin:/home/maxim/src/falcosecurity-libs/build4/libscap/engine/kmod:/home/maxim/src/falcosecurity-libs/build4/libscap/engine/bpf:/home/maxim/src/falcosecurity-libs/build4/libscap/engine/modern_bpf:/home/maxim/src/falcosecurity-libs/build4/libpman /gnu/store/zkzvc2b0xggy6ah9xxyar1i1z9dj185i-profile/lib/libgtest.so /gnu/store/zkzvc2b0xggy6ah9xxyar1i1z9dj185i-profile/lib/libgtest_main.so ../../libscap/libscap.so.0.0.0 ../../libscap/libscap_engine_util.a ../../libscap/engine/nodriver/libscap_engine_nodriver.so.0.0.0 ../../libscap/engine/test_input/libscap_engine_test_input.so.0.0.0 ../../libscap/engine/savefile/libscap_engine_savefile.a ../../libscap/engine/noop/libscap_engine_noop.a ../../libscap/engine/source_plugin/libscap_engine_source_plugin.so.0.0.0 ../../libscap/engine/kmod/libscap_engine_kmod.so.0.0.0 ../../libscap/engine/bpf/libscap_engine_bpf.so.0.0.0 ../../libscap/engine/modern_bpf/libscap_engine_modern_bpf.so.0.0.0 ../../libscap/libscap_event_schema.a ../../libscap/libdriver_event_schema.a ../../libscap/linux/libscap_platform.a ../../libscap/libscap_error.a ../../libscap/libscap_platform_util.a /gnu/store/zkzvc2b0xggy6ah9xxyar1i1z9dj185i-profile/lib/libz.so -Wl,-rpath-link,/home/maxim/src/falcosecurity-libs/build4/libpman
ld: CMakeFiles/libscap_test.dir/test_suites/engines/gvisor/gvisor_parsers.cpp.o: undefined reference to symbol '_ZN6google8protobuf8internal14ArenaStringPtr3SetERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS0_5ArenaE'
ld: /gnu/store/zkzvc2b0xggy6ah9xxyar1i1z9dj185i-profile/lib/libprotobuf.so.32: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [test/libscap/CMakeFiles/libscap_test.dir/build.make:275: test/libscap/libscap_test] Error 1
make[2]: Leaving directory '/home/maxim/src/falcosecurity-libs/build4'
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Provide feedback via https://github.com/falcosecurity/community.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Provide feedback via https://github.com/falcosecurity/community.
/lifecycle rotten
/remove-lifecycle rotten
Describe the bug
Hi! I'm trying to build from the latest 0.15.1 git tag on my Guix System machine, and I'm getting this build failure:
How to reproduce it
I'm building using system libraries only and with the following CMake flags:
"../source" "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-DCMAKE_INSTALL_PREFIX=/gnu/store/qvsb1bb8q71xgm1x93p6dwpm7phmcppj-falcosecurity-libs-0.15.1" "-DCMAKE_INSTALL_LIBDIR=lib" "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE" "-DCMAKE_INSTALL_RPATH=/gnu/store/qvsb1bb8q71xgm1x93p6dwpm7phmcppj-falcosecurity-libs-0.15.1/lib" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DUSE_BUNDLED_DEPS=OFF" "-DBUILD_DRIVER=OFF" "-DBUILD_LIBSINSP_EXAMPLES=OFF" "-DBUILD_LIBSCAP_EXAMPLES=OFF" "-DBUILD_SHARED_LIBS=ON" "-DENABLE_LIBSCAP_TESTS=ON" "-DFALCOSECURITY_LIBS_VERSION=0.15.1"
Expected behaviour
Build should succeed.