summaryrefslogtreecommitdiff
path: root/dev-util/bcc/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-03-19 11:37:34 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-03-19 11:37:34 +0000
commitb7b97785ebbb2f11d24d14dab8b81ed274f4ce6a (patch)
tree9fd110f9fc996e8a4213eeda994a8c112491b86d /dev-util/bcc/files
parent066d27181e9a797ad9f8fc43b49fc9a10ff2f707 (diff)
gentoo resync : 19.03.2019
Diffstat (limited to 'dev-util/bcc/files')
-rw-r--r--dev-util/bcc/files/bcc-0.9.0-no-luajit-automagic-dep.patch20
-rw-r--r--dev-util/bcc/files/bcc-0.9.0-system-libbpf.patch100
2 files changed, 120 insertions, 0 deletions
diff --git a/dev-util/bcc/files/bcc-0.9.0-no-luajit-automagic-dep.patch b/dev-util/bcc/files/bcc-0.9.0-no-luajit-automagic-dep.patch
new file mode 100644
index 000000000000..ee076efce926
--- /dev/null
+++ b/dev-util/bcc/files/bcc-0.9.0-no-luajit-automagic-dep.patch
@@ -0,0 +1,20 @@
+diff --git a/cmake/FindLuaJIT.cmake b/cmake/FindLuaJIT.cmake
+index 5a2bcf85..7f6e07e4 100644
+--- a/cmake/FindLuaJIT.cmake
++++ b/cmake/FindLuaJIT.cmake
+@@ -28,6 +28,7 @@
+ # 2010 - modified for cronkite to find luajit instead of lua, as it was before.
+ #
+
++if(WITH_LUAJIT)
+ FIND_PATH(LUAJIT_INCLUDE_DIR lua.h
+ HINTS
+ $ENV{LUAJIT_DIR}
+@@ -58,6 +59,7 @@ FIND_LIBRARY(LUAJIT_LIBRARY
+ /opt/csw
+ /opt
+ )
++endif()
+
+ IF(LUAJIT_LIBRARY)
+ IF(UNIX AND NOT APPLE)
diff --git a/dev-util/bcc/files/bcc-0.9.0-system-libbpf.patch b/dev-util/bcc/files/bcc-0.9.0-system-libbpf.patch
new file mode 100644
index 000000000000..18868272dcbe
--- /dev/null
+++ b/dev-util/bcc/files/bcc-0.9.0-system-libbpf.patch
@@ -0,0 +1,100 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 94aac856..33492c27 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -61,6 +61,9 @@ FOREACH(DIR ${LLVM_INCLUDE_DIRS})
+ include_directories("${DIR}/../tools/clang/include")
+ ENDFOREACH()
+
++find_package(PkgConfig)
++pkg_check_modules(LIBBPF REQUIRED libbpf)
++
+ # Set to a string path if system places kernel lib directory in
+ # non-default location.
+ if(NOT DEFINED BCC_KERNEL_MODULES_DIR)
+diff --git a/introspection/CMakeLists.txt b/introspection/CMakeLists.txt
+index 88df6e84..a4033c02 100644
+--- a/introspection/CMakeLists.txt
++++ b/introspection/CMakeLists.txt
+@@ -8,6 +8,6 @@ include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi)
+ option(INSTALL_INTROSPECTION "Install BPF introspection tools" ON)
+
+ add_executable(bps bps.c)
+-target_link_libraries(bps bpf-static)
++target_link_libraries(bps bpf-static ${LIBBPF_LIBRARIES})
+
+ install (TARGETS bps DESTINATION share/bcc/introspection)
+diff --git a/src/cc/CMakeLists.txt b/src/cc/CMakeLists.txt
+index 59a59856..2af70525 100644
+--- a/src/cc/CMakeLists.txt
++++ b/src/cc/CMakeLists.txt
+@@ -28,7 +28,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLLVM_MAJOR_VERSION=${CMAKE_MATCH_1}")
+
+ include(static_libstdc++)
+
+-file(GLOB libbpf_sources "libbpf/src/*.c")
++#file(GLOB libbpf_sources "libbpf/src/*.c")
+ add_library(bpf-static STATIC libbpf.c perf_reader.c ${libbpf_sources})
+ set_target_properties(bpf-static PROPERTIES OUTPUT_NAME bpf)
+ add_library(bpf-shared SHARED libbpf.c perf_reader.c ${libbpf_sources})
+@@ -81,10 +81,10 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${llvm_lib_exclude_f
+ # bcc_common_libs_for_s for shared libraries
+ set(bcc_common_libs_for_a b_frontend clang_frontend bpf-static
+ -Wl,--whole-archive ${clang_libs} ${llvm_libs} -Wl,--no-whole-archive
+- ${LIBELF_LIBRARIES})
++ ${LIBELF_LIBRARIES} ${LIBBPF_LIBRARIES})
+ set(bcc_common_libs_for_s ${bcc_common_libs_for_a})
+ set(bcc_common_libs_for_lua b_frontend clang_frontend bpf-static
+- ${clang_libs} ${llvm_libs} ${LIBELF_LIBRARIES})
++ ${clang_libs} ${llvm_libs} ${LIBELF_LIBRARIES} ${LIBBPF_LIBRARIES})
+
+ if(ENABLE_CPP_API)
+ add_subdirectory(api)
+@@ -115,4 +115,3 @@ install(DIRECTORY libbpf/include/uapi/linux/ DESTINATION include/bcc/compat/linu
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libbcc.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+ endif(ENABLE_CLANG_JIT)
+ install(FILES ${bcc_common_headers} DESTINATION include/bcc)
+-install(TARGETS bpf-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff --git a/src/cc/bcc_btf.cc b/src/cc/bcc_btf.cc
+index 881959af..62f73f54 100644
+--- a/src/cc/bcc_btf.cc
++++ b/src/cc/bcc_btf.cc
+@@ -19,8 +19,8 @@
+ #include <string.h>
+ #include "linux/btf.h"
+ #include "libbpf.h"
+-#include "libbpf/src/libbpf.h"
+-#include "libbpf/src/btf.h"
++#include <bpf/libbpf.h>
++#include <bpf/btf.h>
+ #include <vector>
+
+ #define BCC_MAX_ERRNO 4095
+diff --git a/src/cc/bpf_module.cc b/src/cc/bpf_module.cc
+index cf6ea8f3..1be7b788 100644
+--- a/src/cc/bpf_module.cc
++++ b/src/cc/bpf_module.cc
+@@ -43,7 +43,7 @@
+ #include "exported_files.h"
+ #include "libbpf.h"
+ #include "bcc_btf.h"
+-#include "libbpf/src/bpf.h"
++#include <bpf/bpf.h>
+
+ namespace ebpf {
+
+diff --git a/src/cc/libbpf.c b/src/cc/libbpf.c
+index 9b0024dc..7b3eca4b 100644
+--- a/src/cc/libbpf.c
++++ b/src/cc/libbpf.c
+@@ -51,8 +51,8 @@
+ // TODO: Remove this when CentOS 6 support is not needed anymore
+ #include "setns.h"
+
+-#include "libbpf/src/bpf.h"
+-#include "libbpf/src/libbpf.h"
++#include <bpf/bpf.h>
++#include <bpf/libbpf.h>
+
+ // TODO: remove these defines when linux-libc-dev exports them properly
+