diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-04-30 12:37:28 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-04-30 12:37:28 +0100 |
commit | be9d77d3ac6af8f4ead98d89706f356b65578c93 (patch) | |
tree | f82923fbca262493e83dd1382e561a2fae24cc46 /dev-util/bpftrace | |
parent | 7ec0832ab5dafbf70de83e0c2f3ee740416a0950 (diff) | |
parent | 6faaec2b812feecd9c8751b8a19004da4a17ea5b (diff) |
Merge branch 'edge' into next
Diffstat (limited to 'dev-util/bpftrace')
-rw-r--r-- | dev-util/bpftrace/Manifest | 4 | ||||
-rw-r--r-- | dev-util/bpftrace/bpftrace-0.10.0.ebuild | 75 | ||||
-rw-r--r-- | dev-util/bpftrace/files/bpftrace-0.10.0-dont-compress-man.patch | 18 | ||||
-rw-r--r-- | dev-util/bpftrace/files/bpftrace-0.10.0-install-libs.patch | 148 |
4 files changed, 245 insertions, 0 deletions
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest index ded215c8ba13..093497a48cfb 100644 --- a/dev-util/bpftrace/Manifest +++ b/dev-util/bpftrace/Manifest @@ -1,11 +1,15 @@ +AUX bpftrace-0.10.0-dont-compress-man.patch 722 BLAKE2B 583969e9f4457a49f17f33d984ab2585ec2e6f6976846af4d39084ce41bf334892b0971d1a1571e9495d4a05eea680412899d1fb23a8eb25a9b9cab84c3b101b SHA512 1f588dd589933c2fbb0ca79a5782c542cb137e748a442b9904153f76d142ae117755e1c24acfc50947e6040afbad78f31ef0c181082695f63ebb61b3acbe4b6a +AUX bpftrace-0.10.0-install-libs.patch 5790 BLAKE2B 93f12b430f8ba5772423fc0350c59d0f43b9de05fbbc03c4ef46c113886b74a330c397122daa6a423f4a6111b1d113679503b06d7e507f23a837dc06a4c662ca SHA512 585b1128e1a7d4cb92a38eb4043ff824179aed5767f9884d54714dbcc5148d95ca1e95b1fadbde520f57be60501d850c217204f7aed1c556ea5924e422c661bd 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-0.9.4-llvm-10.patch 7123 BLAKE2B 61fe740aae135de1c039e73b3c4e8bd79a8a7412c3d06ad7a8ab3d8d3c0ec825053b4e6b1fcd208a7847cf8f0ff8436ed988aa403485f90755c0e59d5c2a5c8c SHA512 eaba150ea6dafb9e7ab13f1f23246ce064241369882b16bf7eb3a9dc74545064c604e4435c6567c6f0a0df9ac939120c5b3ac5ee95bdc669f9d0e82ededc9c95 AUX bpftrace-mandir.patch 906 BLAKE2B d875e2523b7e719624d92c58a8f058cdd597da07bf6472d2e3dc05eb46be64718ed4056e15a93e4c22264fa35ceb6b79b428febade422ba435a2a2b9e17fb707 SHA512 11544e9e5892ae3657ff903fa2780e71223e380322b4059ddcea4a6edd80c5a7ab8d45188eb577127f64a6705a6ae41d53f3ba7e05bf450853b12a9ba3d84904 +DIST bpftrace-0.10.0.tar.gz 835854 BLAKE2B 623369bb2a2ad8d5eec364afa98bdae3fbe5e66182d8f1187fe86a8bd70ee357a554eb063fdbe5476eab23912adf2cf027092cac3e6989d8f716e91aa5d01212 SHA512 da400efe78cea505a32deead594b047ec4394d3eefe86e7b6853fe2dc715c5847a3abcbd26c1fac39d0a534f1e57d6c0bc3625e0c3f1054b0d84b7b1d6eb69b9 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.10.0.ebuild 1462 BLAKE2B 79df1f16f7fc2f969fb266a5a7492ba4af1611d96c84076e9501b74924b83a5ec825ee5398a0a440f1925b9ed025cd6abdc0ea2fda30716417a190727e50b96b SHA512 4b4e0dbf7961ea973ceedb50d411b82f725e52dca84111f0626c5b6cbd7b132f0d5df9201c58e3811d38bb3bcecef2db0473771c13650a34187f75c7faadac7f 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 1487 BLAKE2B 1003d7865410fb246ac9aa58adafa018e3979a331543dffd7fdce772517875043f6602d7d2856aecf7eb76094d7bf6531f9cbd5e3f296c98f8e0e55178c069b7 SHA512 e122a7c9ab7db361447eb3a7ce79b416ede14b0eebe5ea0b507344fd4203f9e0cf9c9375f526494c4ec1f5c4bafc3153a97dc6bc8554001aac3e609f0f7b233e diff --git a/dev-util/bpftrace/bpftrace-0.10.0.ebuild b/dev-util/bpftrace/bpftrace-0.10.0.ebuild new file mode 100644 index 000000000000..3070afa1505c --- /dev/null +++ b/dev-util/bpftrace/bpftrace-0.10.0.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.10.0-install-libs.patch" + "${FILESDIR}/bpftrace-0.10.0-dont-compress-man.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.10.0-dont-compress-man.patch b/dev-util/bpftrace/files/bpftrace-0.10.0-dont-compress-man.patch new file mode 100644 index 000000000000..750ed4f712a3 --- /dev/null +++ b/dev-util/bpftrace/files/bpftrace-0.10.0-dont-compress-man.patch @@ -0,0 +1,18 @@ +diff --git a/man/man8/CMakeLists.txt b/man/man8/CMakeLists.txt +index f1fc334..7ee58ed 100644 +--- a/man/man8/CMakeLists.txt ++++ b/man/man8/CMakeLists.txt +@@ -1,12 +1,3 @@ +-find_program(GZIP gzip) + file(GLOB FILES *.8) +-set(GZFILES "") +-foreach(FIL ${FILES}) +- get_filename_component(NAME ${FIL} NAME) +- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz +- COMMAND ${GZIP} -c ${FIL} > ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz +- DEPENDS ${FIL}) +- list(APPEND GZFILES "${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz") +-endforeach() + add_custom_target(man ALL DEPENDS ${GZFILES}) +-install(FILES ${GZFILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man8) ++install(FILES ${FILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man8) diff --git a/dev-util/bpftrace/files/bpftrace-0.10.0-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.10.0-install-libs.patch new file mode 100644 index 000000000000..cf5ed9d76b96 --- /dev/null +++ b/dev-util/bpftrace/files/bpftrace-0.10.0-install-libs.patch @@ -0,0 +1,148 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e89a6a9..efa2ff3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -90,9 +90,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 4fa0418..4d0c2a9 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -75,7 +75,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) + + target_link_libraries(bpftrace ${LIBBCC_LIBRARIES}) + if(STATIC_LINKING) +diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt +index 7156276..32faeae 100644 +--- a/src/arch/CMakeLists.txt ++++ b/src/arch/CMakeLists.txt +@@ -1,10 +1,12 @@ + 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) + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") +- add_library(arch x86_64.cpp) ++ add_library(bpftracearch x86_64.cpp) + else() + message(FATAL_ERROR "Unsupported architecture: {CMAKE_SYSTEM_PROCESSOR}") + endif() ++ ++install(TARGETS bpftracearch LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +diff --git a/src/ast/CMakeLists.txt b/src/ast/CMakeLists.txt +index 0d58cd9..e33d585 100644 +--- a/src/ast/CMakeLists.txt ++++ b/src/ast/CMakeLists.txt +@@ -1,4 +1,4 @@ +-add_library(ast ++add_library(bpftraceast + ast.cpp + attachpoint_parser.cpp + codegen_llvm.cpp +@@ -8,16 +8,17 @@ 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) ++install(TARGETS bpftraceast LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + if (HAVE_KFUNC) +- target_compile_definitions(ast PRIVATE HAVE_KFUNC) ++ target_compile_definitions(bpftraceast PRIVATE HAVE_KFUNC) + endif(HAVE_KFUNC) + +-add_dependencies(ast parser) ++add_dependencies(bpftraceast bpftraceparser) + + if (STATIC_LINKING) + set(clang_libs +@@ -41,26 +42,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 56bcb4a..3f874f8 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -93,7 +93,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) + + target_link_libraries(bpftrace_test ${LIBBCC_LIBRARIES}) + if (STATIC_LINKING) |