From fab849d1daed0ba7f2ac497d07985c3dbb692543 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 16 Jun 2019 21:23:20 +0100 Subject: gentoo resync : 16.06.2019 --- dev-util/bcc/Manifest | 4 + dev-util/bcc/bcc-0.10.0.ebuild | 85 ++++++++++ dev-util/bcc/files/bcc-0.10.0-system-libbpf.patch | 182 ++++++++++++++++++++++ 3 files changed, 271 insertions(+) create mode 100644 dev-util/bcc/bcc-0.10.0.ebuild create mode 100644 dev-util/bcc/files/bcc-0.10.0-system-libbpf.patch (limited to 'dev-util/bcc') diff --git a/dev-util/bcc/Manifest b/dev-util/bcc/Manifest index e501db348b0f..8e21510ec458 100644 --- a/dev-util/bcc/Manifest +++ b/dev-util/bcc/Manifest @@ -1,9 +1,13 @@ +AUX bcc-0.10.0-system-libbpf.patch 7201 BLAKE2B c2018dfc9709c6bbf3ea041eec9f731ab3055131558f9fcf07423c06e22a881eac8b6cff757ac3637cd0c12af878a8aaf2f1a13bc0cf859ae23eee75c3e635da SHA512 330d4c69b551fb0e066adc9676358dad4fc75a75cf6e7898a364fa379172829ba6a494aafe82e094218d3cef249e791c89d6a48ebea250597b3b61d0ac7a5f47 AUX bcc-0.9.0-no-luajit-automagic-dep.patch 463 BLAKE2B 286ed298055cbdb22d9c3f3f064c77da685cf75cc8c0ab0cad4d4b473f0eac0b1533ca8eb7e6159108d184d16db7a264b0ea9d30ccdc3d988d88bab28be7310d SHA512 6e5c20de22547410ffa566cb8226a47ee0e8c91183bc5b70eb22637a08fe55cfc96fde169ef3ab8d6e8d7c9e356c35e61b164b3ad675835d3ea8d5239a448979 AUX bcc-0.9.0-system-libbpf.patch 3629 BLAKE2B e3fd70ccd29126bd2ac8582d8094ef0317dbc9dafc8924a05d994105573a6bd1bf382cbd3d6a0bb25390abc3b4ca3edc70293f4663337ccc203434ba380648dd SHA512 e7ca33a66ffbe4cb4b4bf169029d2325b4321018832803872a7fc7f1e99a75338e34bfe55a072f717d45f9759adf119ed5289f0febd45f81303c178999ef5dc7 +DIST bcc-0.10.0.tar.gz 2052430 BLAKE2B 562aa95d34ba329ce966bca3164af45fe6d78487e5f0d370a0a90c5d91af75b4adcc5aa1e6578bf598e55dc51394c5a218fc19e2b57b2f7241cc3fe1f3a4e513 SHA512 92ba0f57d22af610ac81661526fed8bec80d502bcbc8aa5048ba7c50911247c020832db23afdcf9b555b142cd387c228cf7baa0ddc94067165403e362227f235 DIST bcc-0.6.0.tar.gz 1986593 BLAKE2B 514c2c781eb94d99560232d8050b5664ce3565622b236e78cd111be27b3482849965600a1d574f59243917672f00bb3cef65cab63103f6c4a5cf62024c683d9b SHA512 1a8edf6da22f3119a74cf43f03ec83b97ed2f6fc18828d750d8a695ac1451b6b3209e5d2cf48bc87f53fa9447e8813a018a58d31588d477e4aa364a2d0217e80 DIST bcc-0.7.0.tar.gz 2009289 BLAKE2B 370b553521289d983d1165633e76a5e405250b9b09dbf3e78c127d232908e73facce06097ce4dbf0bbccda929b6715a9b7460affe123556087c8ca00b8d62c0b SHA512 ebe6c4cbecba2d587c69af71ddc8cb451b2b8e1d49ef887f291c813320c2c60d49357500fc2751d5b418df2be1d02763c385d89de6efa6e10f049c25acf01b4e DIST bcc-0.9.0-linux-5-bpf.patch.xz 28524 BLAKE2B f0369e50eabd7b1eb9a492b9652cd7647c7c7fda3b01db1e7f2bf716e76357d07d67193b31189b98309e26895ac3dd5c755d4cef6bc592e4674f40710c33539c SHA512 fc5b828a5826da2cf1e1a76758c635f5443d202aecbe3f269d78abcaa0117ad7658bea6c43e7b60e1ecc6bcc65bd19b100217758a1203d278ddb03c5837c43f1 DIST bcc-0.9.0.tar.gz 2036984 BLAKE2B cebbeb57f06af90442d28be1633a54c198bf796786c4fcca3a83dea03bc76949f958dd24f7d85feb2e3402576410f965754f3d031076486b7d378493c56035e8 SHA512 373080181380ec3bcb13469e29ff1f792e924a2df00a614da4647ed54060ad216525dd0f49c5d0afba7946a6d2f4e3475af97250a33db825945af3d165294091 +DIST libbpf-0.0.3.tar.gz 127328 BLAKE2B eaa1be54f0a7fcc6fd41eb2adaad2f405f76db3bd7c7466a5484ead1cca5a9fe775e331838cd5645d7399cb5b1a5b2fcb3814fb45643660fd3f7d84b9986bae6 SHA512 ee489d968cd9a20a1f091dcd2696d3807ab0db2a001613684402de2c696391eea033f3bd961eaf1d0df95c1e15f4f0ccfb7003ff98c3f08f24a7e9a8db22cdad +EBUILD bcc-0.10.0.ebuild 1889 BLAKE2B 4083ff8d78dc4352eda14f27d269fa2cc847640a89d43553afcbf9a6d1df5c2c35bbe6dbdabd8bdd77034758bd580e9c1b8abd4b0b4dd949dc1e2f2d812b4398 SHA512 add2f25b8ff4e15ffb2e9b43247e4de405c857f1226dad3b56455e4c60e9971dee31c8681c2fabd560a7706310705e42b570ce8fdef954f5f2376c41dc07b4fc EBUILD bcc-0.6.0.ebuild 1132 BLAKE2B 4f3fe126841b267c7ac676be765968163e350831a9dad18e9ecf923c6dc5fbbbcade831cce89c9d25d862174deaa512f5310a5a667ede2ee2cd356277ca38f2d SHA512 7359781a42c5470be2d67fed289c5aa45c1495a060e3e022d2e0b8a086b3b03bac422b85f8fd835e7dbe882d42829b24aee364e84c988ec744d2d45913873ca9 EBUILD bcc-0.7.0.ebuild 1134 BLAKE2B a3a89ee433c77d182394f2cd4ab6200059430ef623d000f2e2f651a9c424bcd804414f19598fb1f192f0caf28aaffac3ed858973bb5c3f98e386b2167690fc20 SHA512 2f4ba8cb864ef80e5081d0f84092b0c2e1a2a31f522c3ee5ed8df134bd53023bfd8366e4e15e9c8ff5cd4f81897d28c08befa0ec7655f9d8696f574c9d9719e0 EBUILD bcc-0.9.0-r1.ebuild 1677 BLAKE2B 6d2affa32b03f82c91071ff634e915093cd16baaf1fee9109c4ef4e63f24ae19d2827f954de09d86cf28ad2a3f34da54fb6da5472f3727deddf9d6043639df4f SHA512 076a60b122d350a2041c94fd29d23630e631c713611032aeb1525077c5c3b7ab138d065f4acced277f265e410284df52aeaa3678134f66cafaead924d4f1dc7c diff --git a/dev-util/bcc/bcc-0.10.0.ebuild b/dev-util/bcc/bcc-0.10.0.ebuild new file mode 100644 index 000000000000..e58cc92b1c9b --- /dev/null +++ b/dev-util/bcc/bcc-0.10.0.ebuild @@ -0,0 +1,85 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{5,6,7} ) + +inherit cmake-utils linux-info python-single-r1 python-utils-r1 + +EGIT_COMMIT="v${PV}" +LIBBPF_VER="0.0.3" + +DESCRIPTION="Tools for BPF-based Linux IO analysis, networking, monitoring, and more" +HOMEPAGE="https://iovisor.github.io/bcc/" + +# This bundles libbpf, I tried to unbundle it, but I am not good enough +# with cmake to do it. Patches accepted... +SRC_URI="https://github.com/iovisor/bcc/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz + https://github.com/libbpf/libbpf/archive/${LIBBPF_VER}.tar.gz -> libbpf-${LIBBPF_VER}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" +IUSE="+luajit test" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +RDEPEND=">=sys-kernel/linux-headers-4.18 + >=dev-libs/elfutils-0.166:= + sys-devel/clang:= + >=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)] + luajit? ( dev-lang/luajit ) + ${PYTHON_DEPS}" +DEPEND="${RDEPEND} + test? ( + || ( + net-misc/iputils[arping] + net-analyzer/arping + ) + net-analyzer/netperf + net-misc/iperf:* + )" +BDEPEND="dev-util/cmake + virtual/pkgconfig" + +S=${WORKDIR}/${PN}-${EGIT_COMMIT#v} + +PATCHES=( + "${FILESDIR}/bcc-0.9.0-no-luajit-automagic-dep.patch" +) + +# tests need root access +RESTRICT="test" + +pkg_pretend() { + local CONFIG_CHECK="~BPF ~BPF_SYSCALL ~NET_CLS_BPF ~NET_ACT_BPF + ~BPF_JIT ~BPF_EVENTS ~DEBUG_INFO ~FUNCTION_TRACER ~KALLSYMS_ALL + ~KPROBES" + + check_extra_config +} + +pkg_setup() { + python-single-r1_pkg_setup +} + +src_prepare() { + rmdir src/cc/libbpf || die + mv "${WORKDIR}"/libbpf-${LIBBPF_VER} src/cc/libbpf || die + + cmake-utils_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DREVISION=${PV%%_*} + $(usex luajit '-DWITH_LUAJIT=1' '' '' '') + ) + + cmake-utils_src_configure +} + +src_install() { + cmake-utils_src_install + python_fix_shebang "${ED}" +} diff --git a/dev-util/bcc/files/bcc-0.10.0-system-libbpf.patch b/dev-util/bcc/files/bcc-0.10.0-system-libbpf.patch new file mode 100644 index 000000000000..fabb3f3f2e63 --- /dev/null +++ b/dev-util/bcc/files/bcc-0.10.0-system-libbpf.patch @@ -0,0 +1,182 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 94aac856..bd454226 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,12 +9,6 @@ endif() + + enable_testing() + +-# populate submodules (libbpf) +-if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf/src) +- execute_process(COMMAND git submodule update --init --recursive +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +-endif() +- + include(cmake/GetGitRevisionDescription.cmake) + include(cmake/version.cmake) + include(CMakeDependentOption) +@@ -61,6 +55,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/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt +index 906c9aaf..210f0f75 100644 +--- a/examples/cpp/CMakeLists.txt ++++ b/examples/cpp/CMakeLists.txt +@@ -3,7 +3,7 @@ + + include_directories(${CMAKE_SOURCE_DIR}/src/cc) + include_directories(${CMAKE_SOURCE_DIR}/src/cc/api) +-include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi) ++include_directories(${LIBBPF_INCLUDE_DIRS}) + + option(INSTALL_CPP_EXAMPLES "Install C++ examples. Those binaries are statically linked and can take plenty of disk space" OFF) + +diff --git a/examples/cpp/pyperf/CMakeLists.txt b/examples/cpp/pyperf/CMakeLists.txt +index 6f963c66..e8dd66f6 100644 +--- a/examples/cpp/pyperf/CMakeLists.txt ++++ b/examples/cpp/pyperf/CMakeLists.txt +@@ -3,7 +3,7 @@ + + include_directories(${CMAKE_SOURCE_DIR}/src/cc) + include_directories(${CMAKE_SOURCE_DIR}/src/cc/api) +-include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi) ++include_directories(${LIBBPF_INCLUDE_DIRS}) + + add_executable(PyPerf PyPerf.cc PyPerfUtil.cc PyPerfBPFProgram.cc PyPerfLoggingHelper.cc PyPerfDefaultPrinter.cc Py36Offsets.cc) + target_link_libraries(PyPerf bcc-static) +diff --git a/introspection/CMakeLists.txt b/introspection/CMakeLists.txt +index 88df6e84..de8a6464 100644 +--- a/introspection/CMakeLists.txt ++++ b/introspection/CMakeLists.txt +@@ -3,11 +3,11 @@ + + include_directories(${CMAKE_SOURCE_DIR}/src/cc) + include_directories(${CMAKE_SOURCE_DIR}/src/cc/api) +-include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi) ++include_directories(${LIBBPF_INCLUDE_DIRS}) + + option(INSTALL_INTROSPECTION "Install BPF introspection tools" ON) + + add_executable(bps bps.c) +-target_link_libraries(bps bpf-static) ++target_link_libraries(bps ${LIBBPF_LIBRARIES}) + + install (TARGETS bps DESTINATION share/bcc/introspection) +diff --git a/src/cc/CMakeLists.txt b/src/cc/CMakeLists.txt +index bd34fd48..dfbeb596 100644 +--- a/src/cc/CMakeLists.txt ++++ b/src/cc/CMakeLists.txt +@@ -10,8 +10,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frontends/clang) + include_directories(${LLVM_INCLUDE_DIRS}) + include_directories(${LIBELF_INCLUDE_DIRS}) + # todo: if check for kernel version +-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libbpf/include) +-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libbpf/include/uapi) ++include_directories(${LIBBPF_INCLUDE_DIRS}) + add_definitions(${LLVM_DEFINITIONS}) + configure_file(libbcc.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libbcc.pc @ONLY) + +@@ -28,13 +27,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLLVM_MAJOR_VERSION=${CMAKE_MATCH_1}") + + include(static_libstdc++) + +-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 bcc_bpf) +-add_library(bpf-shared SHARED libbpf.c perf_reader.c ${libbpf_sources}) +-set_target_properties(bpf-shared PROPERTIES VERSION ${REVISION_LAST} SOVERSION 0) +-set_target_properties(bpf-shared PROPERTIES OUTPUT_NAME bcc_bpf) +- + set(bcc_common_sources bcc_common.cc bpf_module.cc bcc_btf.cc exported_files.cc) + if (${LLVM_PACKAGE_VERSION} VERSION_EQUAL 6 OR ${LLVM_PACKAGE_VERSION} VERSION_GREATER 6) + set(bcc_common_sources ${bcc_common_sources} bcc_debug.cc) +@@ -79,12 +71,12 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${llvm_lib_exclude_f + + # bcc_common_libs_for_a for archive libraries + # bcc_common_libs_for_s for shared libraries +-set(bcc_common_libs_for_a b_frontend clang_frontend bpf-static ++set(bcc_common_libs_for_a b_frontend clang_frontend + -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}) ++set(bcc_common_libs_for_lua b_frontend clang_frontend ++ ${clang_libs} ${llvm_libs} ${LIBELF_LIBRARIES} ${LIBBPF_LIBRARIES}) + + if(ENABLE_CPP_API) + add_subdirectory(api) +@@ -111,8 +103,7 @@ set(bcc-lua-static ${bcc-lua-static} ${bcc_common_libs_for_lua}) + install(TARGETS bcc-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES ${bcc_table_headers} DESTINATION include/bcc) + install(FILES ${bcc_api_headers} DESTINATION include/bcc) +-install(DIRECTORY libbpf/include/uapi/linux/ DESTINATION include/bcc/compat/linux FILES_MATCHING PATTERN "*.h") ++#install(DIRECTORY libbpf/include/uapi/linux/ DESTINATION include/bcc/compat/linux FILES_MATCHING PATTERN "*.h") + 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 12816757..29e4c707 100644 +--- a/src/cc/bcc_btf.cc ++++ b/src/cc/bcc_btf.cc +@@ -19,8 +19,8 @@ + #include + #include "linux/btf.h" + #include "libbpf.h" +-#include "libbpf/src/libbpf.h" +-#include "libbpf/src/btf.h" ++#include ++#include + #include + + #define BCC_MAX_ERRNO 4095 +diff --git a/src/cc/bpf_module.cc b/src/cc/bpf_module.cc +index 836c458f..eb03ce59 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 + + namespace ebpf { + +diff --git a/src/cc/libbpf.c b/src/cc/libbpf.c +index 63f4894e..83147dbe 100644 +--- a/src/cc/libbpf.c ++++ b/src/cc/libbpf.c +@@ -52,8 +52,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 ++#include + + // TODO: remove these defines when linux-libc-dev exports them properly + +diff --git a/tests/cc/CMakeLists.txt b/tests/cc/CMakeLists.txt +index a47abe14..ae710eb4 100644 +--- a/tests/cc/CMakeLists.txt ++++ b/tests/cc/CMakeLists.txt +@@ -3,7 +3,7 @@ + + include_directories(${CMAKE_SOURCE_DIR}/src/cc) + include_directories(${CMAKE_SOURCE_DIR}/src/cc/api) +-include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi) ++include_directories(${LIBBPF_INCLUDE_DIRS}) + + add_executable(test_static test_static.c) + target_link_libraries(test_static bcc-static) -- cgit v1.2.3