From 5b6352cd17e3e51c21b38fb824b990e27b5919ff Mon Sep 17 00:00:00 2001 From: Alastair Robertson Date: Mon, 18 Mar 2019 00:27:06 +0000 Subject: [PATCH] Revert "Stop linking against bcc-loader-static" This reverts commit 5fbb7a7d634e75d0dbe01707705abadbfb90cac0. --- cmake/FindLibBcc.cmake | 12 ++++++++++++ src/CMakeLists.txt | 1 + tests/CMakeLists.txt | 1 + 3 files changed, 14 insertions(+) diff --git a/cmake/FindLibBcc.cmake b/cmake/FindLibBcc.cmake index cc6baf735f1..921df972878 100644 --- a/cmake/FindLibBcc.cmake +++ b/cmake/FindLibBcc.cmake @@ -6,6 +6,7 @@ # LIBBCC_LIBRARIES - Link these to use libbcc # LIBBCC_DEFINITIONS - Compiler switches required for using libbcc # LIBBPF_LIBRARY_STATIC - libbpf static library (for static compilation) +# LIBBCC_LOADER_LIBRARY_STATIC - libbcc helper static library (for static compilation) if (LIBBCC_LIBRARIES AND LIBBCC_INCLUDE_DIRS) set (LibBcc_FIND_QUIETLY TRUE) @@ -48,6 +49,17 @@ find_library (LIBBPF_LIBRARY_STATIC ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) +find_library (LIBBCC_LOADER_LIBRARY_STATIC + NAMES + bcc-loader-static + PATHS + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + ENV LIBRARY_PATH + ENV LD_LIBRARY_PATH) + include (FindPackageHandleStandardArgs) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b47f66de88a..964ba53aa1d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,6 +32,7 @@ target_link_libraries(bpftrace arch ast parser resources) if (STATIC_LINKING) target_link_libraries(bpftrace ${LIBBCC_LIBRARIES}) target_link_libraries(bpftrace ${LIBBPF_LIBRARY_STATIC}) + target_link_libraries(bpftrace ${LIBBCC_LOADER_LIBRARY_STATIC}) else() target_link_libraries(bpftrace ${LIBBCC_LIBRARIES}) endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 987431ae08f..66e0c1175cd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -44,6 +44,7 @@ target_link_libraries(bpftrace_test arch ast parser resources) if (STATIC_LINKING) target_link_libraries(bpftrace_test ${LIBBCC_LIBRARIES}) target_link_libraries(bpftrace_test ${LIBBPF_LIBRARY_STATIC}) + target_link_libraries(bpftrace_test ${LIBBCC_LOADER_LIBRARY_STATIC}) else() target_link_libraries(bpftrace_test ${LIBBCC_LIBRARIES}) endif()