Explicitly link runtime against libbpf to fix "DSO missing from command line" error --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -163,6 +163,7 @@ if(STATIC_LINKING) set_property(TARGET LIBELF PROPERTY IMPORTED_LOCATION ${LIBELF_LIBRARIES}) target_link_libraries(runtime LIBELF) else() + target_link_libraries(runtime ${LIBBPF_LIBRARIES}) target_link_libraries(runtime ${LIBELF_LIBRARIES}) endif(STATIC_LINKING)