diff options
Diffstat (limited to 'dev-util/bpftrace')
-rw-r--r-- | dev-util/bpftrace/Manifest | 3 | ||||
-rw-r--r-- | dev-util/bpftrace/bpftrace-0.9.4.ebuild | 75 | ||||
-rw-r--r-- | dev-util/bpftrace/files/bpftrace-0.9.4-install-libs.patch | 141 |
3 files changed, 219 insertions, 0 deletions
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest index ebec8b950f0f..aee6ce21555a 100644 --- a/dev-util/bpftrace/Manifest +++ b/dev-util/bpftrace/Manifest @@ -1,9 +1,12 @@ AUX bpftrace-0.10_pre20190614-install-libs.patch 4653 BLAKE2B 66229e4b3f7edc345eeac5f833348f7a434ee7f6c830c344b3c357fafec98b8cc8c725cf37ee01802d085cdbf9deb0fa13d9dd72161b230aff589c75b17890a3 SHA512 63f899bd119f86ee6e9bae0c2ef6e657a37a33c700414ea4757353f0637e89ef9ed3dbf1b70414eec1a5c2658451e8be3e7de1941a0796cac621361bcdd14537 AUX bpftrace-0.9.3-install-libs.patch 5117 BLAKE2B 6cad778dd19ab040f3bd88390329cc49261c83dcc0ff97f9e663d5fb0d55da87d0e4c1efaabbd31b11e383ea0f904fdab8bd7f34fbdd0805abe20d623673c1fc SHA512 0842712b8d32ba4f7bc0767e3748ed4e8517187c9c75d426e1946aacce3a46fd5f7100d4cef0bed655a763d102cfeff160d549065f6b9c6000a7b3f496cb8b87 +AUX bpftrace-0.9.4-install-libs.patch 5481 BLAKE2B 96df784e95fc42e385dc3330d0ea074863a8ba3c3aeb8d7078b29e03708b2e46fccc30f097dbf2c347f0fb4afadee0d2b7cbb038b05a2d81fbd66e4e008302dc SHA512 e74994b020939035fb9a9b646f5572ae3f241f194e7f119c771d5391a651f27ab0733364a4ddcccd7759f5951141e61c4bf019f98a62a820577687109ca50854 AUX bpftrace-mandir.patch 906 BLAKE2B d875e2523b7e719624d92c58a8f058cdd597da07bf6472d2e3dc05eb46be64718ed4056e15a93e4c22264fa35ceb6b79b428febade422ba435a2a2b9e17fb707 SHA512 11544e9e5892ae3657ff903fa2780e71223e380322b4059ddcea4a6edd80c5a7ab8d45188eb577127f64a6705a6ae41d53f3ba7e05bf450853b12a9ba3d84904 DIST bpftrace-0.9.2.tar.gz 715019 BLAKE2B 1f20998bd379b91cb46d7e856a5d892e0de7ad6d9f85cb657fcf6a0c879167c0931d28c78e4be98adab349144fe0bc99871cf70556dd1998e5b8f918fa1702e3 SHA512 5c6ee5fec690a907c370ed0bed85906d304215d7f97b99a2cae90453061f522fa6369627c9524a5a24e97c6cbb595a880a2a1b1d71095fffb693a4cef172a6f0 DIST bpftrace-0.9.3.tar.gz 743506 BLAKE2B d00708bcebaf7f039788dfc52f4a0bb501bb3c52e8b789060f824652b3917ea3950d77dbc7bee04da013f4b552338251bda9781d19a03ec227208b943fded232 SHA512 49b12735fe2fbf4f72d3d0c0372a7a570c7abc92d1f626624d591a863009c8bfabdf86825f133885800c7ea293773651be66e4c792f9cd397f82d250a7af83be +DIST bpftrace-0.9.4.tar.gz 792253 BLAKE2B d34d390a612825141b86ba14482f06820c88bea76580c53c17d19a6480c0e2a5656531f39b79fbcea4e004ecd3eea36877560f22fac584f36a3dffa1e7fe96c5 SHA512 d2b32235fa81d6f06771df32877388a9105230adfc638b0d0ebf4f11a567246e8514d93c14da9c7008dbacd6b2c4108604fc5a2721ef831efa5c596cbe50b1da EBUILD bpftrace-0.9.2.ebuild 1402 BLAKE2B 539e79098fd31d8ade5449f53e9b63d4c8b3ecd3e2716eab76f8a7eab00e11480224502369899f68eb839c9cb48cebc1f5fd6d6c231f93a4a16d58e19e973171 SHA512 9021699f98686a48954e39d653797b10d68cc56b284bdc77a58778dec41c20617031b1ccf8e15283a6b630b366856f6ec0d1013c6150709cc37f25d786f289db EBUILD bpftrace-0.9.3.ebuild 1391 BLAKE2B db3f13374aeac65bc6bbaccc6ae187c6f601c753d7b426562dad7af055c1c4a32965abd1a4d8100eddf96cc6b5cac8c1d839cbc4c9cd2ba4822f83c23bcb6c2c SHA512 1fc37e191621ba5c63d43e55f772b505eddff423f37d3697061a4a03000a5bbc8086cb5e4df87c98d080317213581058128b4a5a40c807e5034e6786ca8d37ee +EBUILD bpftrace-0.9.4.ebuild 1443 BLAKE2B bb82e30e721881ee3b9a73a80fbfada3c408f028a2ecdd44b467ad0bdd20386a36aaa57139b43a3111d8f7075dc5e83bc670c6acb7dbf79ca36e75b724861002 SHA512 6bf0353079eb2451301334942cfccfa89c866677ca7771fa6a2c191e3b758e0688e449cace67487fa8efb784669c65d6fdea7889f0a141b5d414b5d5bb55caeb EBUILD bpftrace-9999.ebuild 1339 BLAKE2B 89932b8689799d37f5730662705d644059796e27abbb187e57f741450dbf1034d5322f3e94a4a493f0341f939fcc3902e3173d8b2357c70695c3f3dd957d7db5 SHA512 b7df8cb8af0c74599fb87a32ff1efff499e3559682c72fea78ea5d53e9513f0738fff86acbc91c54b21e3b20ba0e0ccea8f559e7d80f359e45e8448a7fa94000 MISC metadata.xml 308 BLAKE2B 5440fafa478bdbdf6906c74d697a9542deb8b13b76527a380df723562759d914d597dff029f93ba4567ce4e0f4723fded5a13ea7d2032752253bad1906e753dc SHA512 c27c2ef4795e9167ea133e0c0e2c6d67425d6db754bd563d9cb7a791b4a155ebe855ad0e67c2b29235a9b9761f29dbb14958b124c95a1aaddb97801c763914ba diff --git a/dev-util/bpftrace/bpftrace-0.9.4.ebuild b/dev-util/bpftrace/bpftrace-0.9.4.ebuild new file mode 100644 index 000000000000..0afc8a9890fa --- /dev/null +++ b/dev-util/bpftrace/bpftrace-0.9.4.ebuild @@ -0,0 +1,75 @@ +# Copyright 2019-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs linux-info cmake-utils + +DESCRIPTION="High-level tracing language for eBPF" +HOMEPAGE="https://github.com/iovisor/bpftrace" + +if [[ ${PV} =~ 9{4,} ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/iovisor/${PN}" + BDEPEND="" +else + MY_PV="${PV//_/}" + SRC_URI="https://github.com/iovisor/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm64 ~x86" + BDEPEND="app-arch/xz-utils " +fi + +LICENSE="Apache-2.0" +SLOT="0" +IUSE="test" + +COMMON_DEPEND="dev-util/systemtap + sys-devel/clang:= + dev-libs/libbpf:= + >=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)] + >=dev-util/bcc-0.12.0:= + virtual/libelf" +DEPEND="${COMMON_DEPEND} + test? ( dev-cpp/gtest )" +RDEPEND="${COMMON_DEPEND}" +BDEPEND+="dev-util/cmake + sys-devel/flex + sys-devel/bison" + +S="${WORKDIR}/${PN}-${MY_PV}" +QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so" + +PATCHES=( + "${FILESDIR}/bpftrace-0.9.4-install-libs.patch" + "${FILESDIR}/bpftrace-mandir.patch" +) + +# lots of fixing needed +RESTRICT="test" + +pkg_pretend() { + local CONFIG_CHECK=" + ~BPF + ~BPF_EVENTS + ~BPF_JIT + ~BPF_SYSCALL + ~FTRACE_SYSCALLS + ~HAVE_EBPF_JIT + " + + check_extra_config +} + +src_prepare() { + cmake-utils_src_prepare +} + +src_configure() { + local -a mycmakeargs + mycmakeargs=( + "-DSTATIC_LINKING:BOOL=OFF" + "-DBUILD_TESTING:BOOL=OFF" + ) + + cmake-utils_src_configure +} diff --git a/dev-util/bpftrace/files/bpftrace-0.9.4-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.9.4-install-libs.patch new file mode 100644 index 000000000000..fe3fc29fd9b4 --- /dev/null +++ b/dev-util/bpftrace/files/bpftrace-0.9.4-install-libs.patch @@ -0,0 +1,141 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2b214c1..a787d7d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -85,9 +85,10 @@ find_package(FLEX REQUIRED) + bison_target(bison_parser src/parser.yy ${CMAKE_BINARY_DIR}/parser.tab.cc VERBOSE) + flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc) + add_flex_bison_dependency(flex_lexer bison_parser) +-add_library(parser ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS}) +-target_compile_options(parser PRIVATE "-w") +-target_include_directories(parser PUBLIC src src/ast ${CMAKE_BINARY_DIR}) ++add_library(bpftraceparser ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS}) ++target_compile_options(bpftraceparser PRIVATE "-w") ++target_include_directories(bpftraceparser PUBLIC src src/ast ${CMAKE_BINARY_DIR}) ++install(TARGETS bpftraceparser LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + include(CheckSymbolExists) + set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) +diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt +index a95c60a..f5c4d67 100644 +--- a/resources/CMakeLists.txt ++++ b/resources/CMakeLists.txt +@@ -1,6 +1,7 @@ +-add_library(resources headers.cpp) ++add_library(bpftraceresources headers.cpp) + +-target_include_directories(resources PUBLIC ../src) ++target_include_directories(bpftraceresources PUBLIC ../src) ++install(TARGETS bpftraceresources LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + function(embed_headers output) + file(WRITE ${output} "#include \"headers.h\"\n\nnamespace bpftrace {\n") +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 5b9a95d..b1ccf7a 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -68,7 +68,8 @@ if (ALLOW_UNSAFE_PROBE) + target_compile_definitions(bpftrace PRIVATE HAVE_UNSAFE_PROBE) + endif(ALLOW_UNSAFE_PROBE) + +-target_link_libraries(bpftrace arch ast parser resources) ++target_link_libraries(bpftrace bpftracearch bpftraceast bpftraceparser ++ bpftraceresources) + + if(STATIC_LINKING) + target_link_libraries(bpftrace ${LIBBCC_LIBRARIES}) +diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt +index edb0654..e57c8c5 100644 +--- a/src/arch/CMakeLists.txt ++++ b/src/arch/CMakeLists.txt +@@ -1,8 +1,10 @@ + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") +- add_library(arch aarch64.cpp) ++ add_library(bpftracearch aarch64.cpp) + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64" OR + CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le") +- add_library(arch ppc64.cpp) ++ add_library(bpftracearch ppc64.cpp) + else() +- add_library(arch x86_64.cpp) ++ add_library(bpftracearch x86_64.cpp) + endif() ++ ++install(TARGETS bpftracearch LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +diff --git a/src/ast/CMakeLists.txt b/src/ast/CMakeLists.txt +index f280f47..5db9246 100644 +--- a/src/ast/CMakeLists.txt ++++ b/src/ast/CMakeLists.txt +@@ -1,4 +1,4 @@ +-add_library(ast ++add_library(bpftraceast + ast.cpp + codegen_llvm.cpp + field_analyser.cpp +@@ -7,12 +7,13 @@ add_library(ast + semantic_analyser.cpp + ) + +-target_include_directories(ast PUBLIC ${CMAKE_SOURCE_DIR}/src) +-target_include_directories(ast PUBLIC ${CMAKE_SOURCE_DIR}/src/ast) +-target_include_directories(ast PUBLIC ${CMAKE_BINARY_DIR}) +-target_link_libraries(ast arch) ++target_include_directories(bpftraceast PUBLIC ${CMAKE_SOURCE_DIR}/src) ++target_include_directories(bpftraceast PUBLIC ${CMAKE_SOURCE_DIR}/src/ast) ++target_include_directories(bpftraceast PUBLIC ${CMAKE_BINARY_DIR}) ++target_link_libraries(bpftraceast bpftracearch) + +-add_dependencies(ast parser) ++add_dependencies(bpftraceast bpftraceparser) ++install(TARGETS bpftraceast LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + if (STATIC_LINKING) + set(clang_libs +@@ -36,26 +37,26 @@ if (STATIC_LINKING) + if(EMBED_LIBCLANG_ONLY) + unlink_transitive_dependency("${CLANG_EXPORTED_TARGETS}" "LLVM") + endif() +- target_link_libraries(ast ${CLANG_EMBEDDED_CMAKE_TARGETS}) ++ target_link_libraries(bpftraceast ${CLANG_EMBEDDED_CMAKE_TARGETS}) + else() + list(INSERT clang_libs 0 libclang.a) + endif() + + if(EMBED_LLVM) +- target_link_libraries(ast ${LLVM_EMBEDDED_CMAKE_TARGETS}) ++ target_link_libraries(bpftraceast ${LLVM_EMBEDDED_CMAKE_TARGETS}) + else() + llvm_map_components_to_libnames(llvm_libs bpfcodegen ipo irreader mcjit orcjit ${LLVM_TARGETS_TO_BUILD}) +- target_link_libraries(ast ${clang_libs}) +- target_link_libraries(ast ${llvm_libs}) ++ target_link_libraries(bpftraceast ${clang_libs}) ++ target_link_libraries(bpftraceast ${llvm_libs}) + endif() + else() + find_library(found_LLVM LLVM HINTS ${LLVM_LIBRARY_DIRS}) + if(found_LLVM) +- target_link_libraries(ast LLVM) ++ target_link_libraries(bpftraceast LLVM) + else() + llvm_map_components_to_libnames(_llvm_libs bpfcodegen ipo irreader mcjit orcjit ${LLVM_TARGETS_TO_BUILD}) + llvm_expand_dependencies(llvm_libs ${_llvm_libs}) +- target_link_libraries(ast ${llvm_libs}) ++ target_link_libraries(bpftraceast ${llvm_libs}) + endif() +- target_link_libraries(ast libclang) ++ target_link_libraries(bpftraceast libclang) + endif() +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 211c47b..2fb73ef 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -88,7 +88,8 @@ if(HAVE_BFD_DISASM) + endif(STATIC_LINKING) + endif(HAVE_BFD_DISASM) + +-target_link_libraries(bpftrace_test arch ast parser resources) ++target_link_libraries(bpftrace_test bpftracearch bpftraceast bpftraceparser ++ bpftraceresources) + + if (STATIC_LINKING) + if(EMBED_LLVM OR EMBED_CLANG) |