Closed lclin56 closed 2 months ago
Hey @lclin56! Could you please share the cake commands you used? 🙂
Hey @therealbobo! My command is:
cd sysdig
mkdir build
cd build
cmake ..
I can successfully compile in Ubuntu 20.04, but the compiled result cannot run on Ubuntu 18.04 and reports the following error:
/sysdig: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./sysdig)
./sysdig: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by ./sysdig)
I have checked your released binary files, and it seems that they were also compiled with g++-9, but your binaries can run on lower versions of Linux systems (I tested on Ubuntu 16.04). Can you share some information about the compilation environment? I found that the documentation's requirements for gcc and cmake may not be very accurate; at least in my experience, I need cmake version 3.12 or higher and g++-9 or higher to compile successfully.
I built the docker image named sysdig-builder under the docker/builder directory and used this image for compilation. My compilation steps are as follows:
docker run -v $PWD/..:/source -v $PWD/build:/build sysdig/sysdig-builder cmake
docker run -v $PWD/..:/source -v $PWD/build:/build sysdig/sysdig-builder sysdig
But I also encountered compilation issues:
[ 3%] Built target zlib
[ 6%] Built target openssl
[ 8%] Built target c-ares
[ 10%] Built target re2
[ 14%] Built target libelf
[ 16%] Built target yaml-cpp
[ 18%] Built target njson
[ 19%] Built target scap_platform_util
[ 19%] Built target driver_event_schema
[ 20%] Built target scap_error
[ 21%] Built target scap_engine_noop
[ 23%] Built target scap_engine_util
[ 26%] Built target tbb
[ 28%] Built target jq
[ 31%] Built target curl
[ 34%] Built target jsoncpp
[ 36%] Built target valijson
[ 38%] Built target luajit
[ 40%] Built target tinydir
[ 43%] Built target protobuf
[ 46%] Built target libbpf
[ 46%] Built target scap_engine_nodriver
[ 47%] Built target scap_engine_savefile
[ 49%] Built target scap_event_schema
[ 50%] Built target scap_engine_source_plugin
[ 52%] Built target scap_engine_udig
[ 52%] Built target scap_platform
[ 54%] Built target grpc
[ 56%] Built target scap_engine_bpf
[ 56%] Building C object libpman/CMakeFiles/pman.dir/src/stats.c.o
[ 56%] Built target scap_engine_kmod
[ 56%] Building C object libpman/CMakeFiles/pman.dir/src/maps.c.o
Consolidate compiler generated dependencies of target cri_v1
Consolidate compiler generated dependencies of target cri_v1alpha2
[ 57%] Built target cri_v1alpha2
[ 58%] Built target cri_v1
[ 59%] Building C object libpman/CMakeFiles/pman.dir/src/lifecycle.c.o
[ 59%] Building C object libpman/CMakeFiles/pman.dir/src/programs.c.o
In file included from /build/release/falcosecurity-libs-repo/falcosecurity-libs-prefix/src/falcosecurity-libs/userspace/libpman/src/stats.c:18:
/build/release/falcosecurity-libs-repo/falcosecurity-libs-prefix/src/falcosecurity-libs/userspace/libpman/src/state.h:23:10: fatal error: bpf_probe.skel.h: No such file or directory
23 | #include <bpf_probe.skel.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /build/release/falcosecurity-libs-repo/falcosecurity-libs-prefix/src/falcosecurity-libs/userspace/libpman/src/maps.c:18:
/build/release/falcosecurity-libs-repo/falcosecurity-libs-prefix/src/falcosecurity-libs/userspace/libpman/src/state.h:23:10: fatal error: bpf_probe.skel.h: No such file or directory
23 | #include <bpf_probe.skel.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [libpman/CMakeFiles/pman.dir/src/stats.c.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [libpman/CMakeFiles/pman.dir/src/maps.c.o] Error 1
In file included from /build/release/falcosecurity-libs-repo/falcosecurity-libs-prefix/src/falcosecurity-libs/userspace/libpman/src/programs.c:18:
/build/release/falcosecurity-libs-repo/falcosecurity-libs-prefix/src/falcosecurity-libs/userspace/libpman/src/state.h:23:10: fatal error: bpf_probe.skel.h: No such file or directory
23 | #include <bpf_probe.skel.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [libpman/CMakeFiles/pman.dir/src/programs.c.o] Error 1
In file included from /build/release/falcosecurity-libs-repo/falcosecurity-libs-prefix/src/falcosecurity-libs/userspace/libpman/src/lifecycle.c:18:
/build/release/falcosecurity-libs-repo/falcosecurity-libs-prefix/src/falcosecurity-libs/userspace/libpman/src/state.h:23:10: fatal error: bpf_probe.skel.h: No such file or directory
23 | #include <bpf_probe.skel.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [libpman/CMakeFiles/pman.dir/src/lifecycle.c.o] Error 1
make[2]: *** [libpman/CMakeFiles/pman.dir/all] Error 2
make[1]: *** [userspace/sysdig/CMakeFiles/sysdig.dir/rule] Error 2
make: *** [sysdig] Error 2
The bpf_probe.skel.h
is related to the modern probe (that doesn't support your kernel). You can just disable it doing cmake -DBUILD_SYSDIG_MODERN_BPF=OFF
and you should be ok :)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I downloaded the source code package of sysdig version 0.34.1, and I encountered an error during compilation:
My system version and kernel version are as follows:
Linux 5.4.0-152-generic #169~18.04.1-Ubuntu SMP Wed Jun 7 22:22:24 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux