0002-Link-against-libabseil-cpp-which-grpc-uses.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From a7fb3b863c3574470c45fdf6084dcc40931ca017 Mon Sep 17 00:00:00 2001
  2. From: Francis Laniel <flaniel@linux.microsoft.com>
  3. Date: Thu, 7 Apr 2022 18:30:23 +0100
  4. Subject: [PATCH] Link against libabseil-cpp which grpc uses.
  5. This patch was taken from:
  6. 55c96b61f7b9 ("sysdig: make extra linking against abseil conditional") [1]
  7. from hhoffstaette/portage.
  8. [1] https://github.com/hhoffstaette/portage/blob/55c96b61f7b91e4d91bed6723e86c00dd91f8d16/dev-util/sysdig/files/0.27.1-grpc-absl-sync.patch
  9. Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
  10. ---
  11. CMakeLists.txt | 1 +
  12. userspace/libsinsp/CMakeLists.txt | 4 ++++
  13. 2 files changed, 5 insertions(+)
  14. diff --git a/CMakeLists.txt b/CMakeLists.txt
  15. index 1f34f1d6..c0354b29 100644
  16. --- a/CMakeLists.txt
  17. +++ b/CMakeLists.txt
  18. @@ -552,6 +552,7 @@ if(NOT WIN32 AND NOT APPLE)
  19. else()
  20. message(FATAL_ERROR "Couldn't find system grpc")
  21. endif()
  22. + find_library(ABSL_SYNC_LIB NAMES absl_synchronization)
  23. find_program(GRPC_CPP_PLUGIN grpc_cpp_plugin)
  24. if(NOT GRPC_CPP_PLUGIN)
  25. message(FATAL_ERROR "System grpc_cpp_plugin not found")
  26. diff --git a/userspace/libsinsp/CMakeLists.txt b/userspace/libsinsp/CMakeLists.txt
  27. index d72f9115..d1b7ea02 100644
  28. --- a/userspace/libsinsp/CMakeLists.txt
  29. +++ b/userspace/libsinsp/CMakeLists.txt
  30. @@ -214,6 +214,10 @@ if(NOT WIN32)
  31. "${JQ_LIB}"
  32. "${B64_LIB}")
  33. + if(ABSL_SYNC_LIB)
  34. + target_link_libraries(sinsp "${ABSL_SYNC_LIB}")
  35. + endif()
  36. +
  37. if(NOT MUSL_OPTIMIZED_BUILD)
  38. target_link_libraries(sinsp
  39. rt
  40. --
  41. 2.25.1