* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2019-06-14 21:03 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2019-06-14 21:03 UTC (permalink / raw
To: gentoo-commits
commit: 4755d09cbd780ec84807b1190364591c76988de5
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Fri Jun 14 21:03:02 2019 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Fri Jun 14 21:03:36 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4755d09c
dev-util/bpftrace: Update live ebuild to work with current git
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.67, Repoman-2.3.14
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/bpftrace-9999.ebuild | 8 +-
.../bpftrace-0.10_pre20190614-install-libs.patch | 115 +++++++++++++++++++++
2 files changed, 119 insertions(+), 4 deletions(-)
diff --git a/dev-util/bpftrace/bpftrace-9999.ebuild b/dev-util/bpftrace/bpftrace-9999.ebuild
index 74351e85e8c..659b5f9766a 100644
--- a/dev-util/bpftrace/bpftrace-9999.ebuild
+++ b/dev-util/bpftrace/bpftrace-9999.ebuild
@@ -22,10 +22,11 @@ LICENSE="Apache-2.0"
SLOT="0"
IUSE="test"
-COMMON_DEPEND="sys-devel/clang:=
+COMMON_DEPEND="dev-util/systemtap
+ sys-devel/clang:=
dev-libs/libbpf:=
>=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)]
- >=dev-util/bcc-0.9.0:=
+ >=dev-util/bcc-0.10.0:=
virtual/libelf"
DEPEND="${COMMON_DEPEND}
test? ( dev-cpp/gtest )"
@@ -37,9 +38,8 @@ BDEPEND+="dev-util/cmake
QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so"
PATCHES=(
- "${FILESDIR}/bpftrace-0.9_pre20190311-install-libs.patch"
+ "${FILESDIR}/bpftrace-0.10_pre20190614-install-libs.patch"
"${FILESDIR}/bpftrace-mandir.patch"
- "${FILESDIR}/bpftrace-0.9-llvm-8.patch"
)
# lots of fixing needed
diff --git a/dev-util/bpftrace/files/bpftrace-0.10_pre20190614-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.10_pre20190614-install-libs.patch
new file mode 100644
index 00000000000..f4483570c99
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.10_pre20190614-install-libs.patch
@@ -0,0 +1,115 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e8870c6..a55385d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -47,9 +47,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 b8b0d96..0803c1e 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 e737119..b2b17e2 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -30,7 +30,8 @@ endif(HAVE_BCC_ELF_FOREACH_SYM)
+ if(HAVE_GET_CURRENT_CGROUP_ID)
+ target_compile_definitions(bpftrace PRIVATE HAVE_GET_CURRENT_CGROUP_ID)
+ endif(HAVE_GET_CURRENT_CGROUP_ID)
+-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 a26f610..53627e2 100644
+--- a/src/arch/CMakeLists.txt
++++ b/src/arch/CMakeLists.txt
+@@ -1,5 +1,7 @@
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
+- add_library(arch aarch64.cpp)
++ add_library(bpftracearch aarch64.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 4d77c9f..2a00572 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
+ irbuilderbpf.cpp
+@@ -7,15 +7,16 @@ add_library(ast
+ )
+
+ if(HAVE_GET_CURRENT_CGROUP_ID)
+- target_compile_definitions(ast PRIVATE HAVE_GET_CURRENT_CGROUP_ID)
++ target_compile_definitions(bpftraceast PRIVATE HAVE_GET_CURRENT_CGROUP_ID)
+ endif(HAVE_GET_CURRENT_CGROUP_ID)
+
+-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
+@@ -35,16 +36,16 @@ if (STATIC_LINKING)
+ clangSerialization
+ clangToolingCore)
+ 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})
+ 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()
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2019-11-21 18:29 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2019-11-21 18:29 UTC (permalink / raw
To: gentoo-commits
commit: 40e25a062ce4caa651d87a321d00b72f9e406d7e
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Thu Nov 21 18:27:23 2019 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Thu Nov 21 18:27:23 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40e25a06
dev-util/bpftrace: Version bump to 0.9.3
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.79, Repoman-2.3.18
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/Manifest | 1 +
...{bpftrace-9999.ebuild => bpftrace-0.9.3.ebuild} | 6 +-
dev-util/bpftrace/bpftrace-9999.ebuild | 2 +-
.../files/bpftrace-0.9.3-install-libs.patch | 129 +++++++++++++++++++++
4 files changed, 135 insertions(+), 3 deletions(-)
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest
index 8781df460c0..2b07beb3911 100644
--- a/dev-util/bpftrace/Manifest
+++ b/dev-util/bpftrace/Manifest
@@ -1,3 +1,4 @@
DIST bpftrace-0.9.1.tar.gz 704365 BLAKE2B 03c73eac9cc116df916536239124a6a649aa1a390c97848baedaf5b329f5eda8752c9e39053e741a485d623240954f6659099f0c0ab65cc4bbf00fc6e52d0b46 SHA512 e813c598b3acb85d94e1cb02f75b5fa849f10ee1cc39fb73e843a797946d7642463bcc3d083ff377d68b9e2a1aabb56995ab4ebe2be822f4f393448c7f02ca4b
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.tar.gz 668655 BLAKE2B 650756ed7334cb92a64adc36a0bd86fff5c16c53fb94d57cc570dd3cd893d467e754da80c98da36c1ec1d14327fa6025b194d963e4a2d1bec99ebb868555b6bc SHA512 771c412a6b1ee7a7d5bba9e0910633056c6f5523e5d1efd9d7ccb5b9f9b462b7bda8d170c5ed0653f3c1bfd5cc77fce2fd552f12eb8222a8747620b3dc9b49f8
diff --git a/dev-util/bpftrace/bpftrace-9999.ebuild b/dev-util/bpftrace/bpftrace-0.9.3.ebuild
similarity index 86%
copy from dev-util/bpftrace/bpftrace-9999.ebuild
copy to dev-util/bpftrace/bpftrace-0.9.3.ebuild
index 659b5f9766a..74f1dd849d2 100644
--- a/dev-util/bpftrace/bpftrace-9999.ebuild
+++ b/dev-util/bpftrace/bpftrace-0.9.3.ebuild
@@ -13,7 +13,8 @@ if [[ ${PV} =~ 9{4,} ]]; then
EGIT_REPO_URI="https://github.com/iovisor/${PN}"
BDEPEND=""
else
- SRC_URI="https://github.com/iovisor/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ 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
@@ -35,10 +36,11 @@ 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_pre20190614-install-libs.patch"
+ "${FILESDIR}/bpftrace-0.9.3-install-libs.patch"
"${FILESDIR}/bpftrace-mandir.patch"
)
diff --git a/dev-util/bpftrace/bpftrace-9999.ebuild b/dev-util/bpftrace/bpftrace-9999.ebuild
index 659b5f9766a..ccad41e9941 100644
--- a/dev-util/bpftrace/bpftrace-9999.ebuild
+++ b/dev-util/bpftrace/bpftrace-9999.ebuild
@@ -38,7 +38,7 @@ BDEPEND+="dev-util/cmake
QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so"
PATCHES=(
- "${FILESDIR}/bpftrace-0.10_pre20190614-install-libs.patch"
+ "${FILESDIR}/bpftrace-0.9.3-install-libs.patch"
"${FILESDIR}/bpftrace-mandir.patch"
)
diff --git a/dev-util/bpftrace/files/bpftrace-0.9.3-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.9.3-install-libs.patch
new file mode 100644
index 00000000000..0ddb07b4740
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.9.3-install-libs.patch
@@ -0,0 +1,129 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5e0d770..d51edf6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -51,9 +51,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 b8b0d96..0803c1e 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 65f3a34..b001a83 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -56,7 +56,8 @@ if (ALLOW_UNSAFE_UPROBE)
+ target_compile_definitions(bpftrace PRIVATE HAVE_UNSAFE_UPROBE)
+ endif(ALLOW_UNSAFE_UPROBE)
+
+-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 a26f610..53627e2 100644
+--- a/src/arch/CMakeLists.txt
++++ b/src/arch/CMakeLists.txt
+@@ -1,5 +1,7 @@
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
+- add_library(arch aarch64.cpp)
++ add_library(bpftracearch aarch64.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 4d77c9f..2a00572 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
+ irbuilderbpf.cpp
+@@ -7,15 +7,16 @@ add_library(ast
+ )
+
+ if(HAVE_GET_CURRENT_CGROUP_ID)
+- target_compile_definitions(ast PRIVATE HAVE_GET_CURRENT_CGROUP_ID)
++ target_compile_definitions(bpftraceast PRIVATE HAVE_GET_CURRENT_CGROUP_ID)
+ endif(HAVE_GET_CURRENT_CGROUP_ID)
+
+-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
+@@ -35,16 +36,16 @@ if (STATIC_LINKING)
+ clangSerialization
+ clangToolingCore)
+ 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})
+ 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 2d18277..f66a8b7 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -76,7 +76,8 @@ if(HAVE_BFD_DISASM)
+ target_link_libraries(bpftrace_test ${LIBOPCODES_LIBRARIES})
+ 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)
+ target_link_libraries(bpftrace_test ${LIBBCC_LIBRARIES})
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2020-02-04 21:19 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2020-02-04 21:19 UTC (permalink / raw
To: gentoo-commits
commit: 6869606d41d3d576f5226df752a3a5ea9b997677
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Tue Feb 4 21:19:12 2020 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Feb 4 21:19:33 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6869606d
dev-util/bpftrace-0.9.4: Version bump
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.87, Repoman-2.3.20
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/Manifest | 1 +
dev-util/bpftrace/bpftrace-0.9.4.ebuild | 75 +++++++++++
.../files/bpftrace-0.9.4-install-libs.patch | 141 +++++++++++++++++++++
3 files changed, 217 insertions(+)
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest
index f81c8a38367..2414ad795d3 100644
--- a/dev-util/bpftrace/Manifest
+++ b/dev-util/bpftrace/Manifest
@@ -1,2 +1,3 @@
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
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 00000000000..0afc8a9890f
--- /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 00000000000..fe3fc29fd9b
--- /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)
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2020-05-28 20:26 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2020-05-28 20:26 UTC (permalink / raw
To: gentoo-commits
commit: 0c58230e0fc74178013f49bf1adc9f856e9ea247
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Thu May 28 20:26:30 2020 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Thu May 28 20:26:48 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c58230e
dev-util/bpftrace-0.10.0-r1: Bump, patch llvm-10 segfault (bug #724382)
Closes: https://bugs.gentoo.org/724382
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
...ace-0.10.0.ebuild => bpftrace-0.10.0-r1.ebuild} | 3 ++
.../files/bpftrace-0.10.0-llvm-multi.patch | 60 ++++++++++++++++++++++
2 files changed, 63 insertions(+)
diff --git a/dev-util/bpftrace/bpftrace-0.10.0.ebuild b/dev-util/bpftrace/bpftrace-0.10.0-r1.ebuild
similarity index 92%
rename from dev-util/bpftrace/bpftrace-0.10.0.ebuild
rename to dev-util/bpftrace/bpftrace-0.10.0-r1.ebuild
index 3070afa1505..196615ab2a9 100644
--- a/dev-util/bpftrace/bpftrace-0.10.0.ebuild
+++ b/dev-util/bpftrace/bpftrace-0.10.0-r1.ebuild
@@ -27,6 +27,8 @@ COMMON_DEPEND="dev-util/systemtap
sys-devel/clang:=
dev-libs/libbpf:=
>=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)]
+ <sys-devel/clang-10:=
+ <sys-devel/llvm-10:=[llvm_targets_BPF(+)]
>=dev-util/bcc-0.12.0:=
virtual/libelf"
DEPEND="${COMMON_DEPEND}
@@ -42,6 +44,7 @@ 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"
+ "${FILESDIR}/bpftrace-0.10.0-llvm-multi.patch"
)
# lots of fixing needed
diff --git a/dev-util/bpftrace/files/bpftrace-0.10.0-llvm-multi.patch b/dev-util/bpftrace/files/bpftrace-0.10.0-llvm-multi.patch
new file mode 100644
index 00000000000..48eeeb8e200
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.10.0-llvm-multi.patch
@@ -0,0 +1,60 @@
+diff -ru a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 2020-05-20 21:00:22.789744736 -0500
++++ b/CMakeLists.txt 2020-05-20 18:52:38.241091110 -0500
+@@ -30,6 +30,11 @@
+ elseif(STATIC_LIBC)
+ message(WARNING "static libc is known to cause problems, consider STATIC_LIBC=OFF. Proceed at your own risk") #iovisor/bpftrace/issues/266
+ endif()
++else()
++ find_package(LLVM 9 REQUIRED CONFIG)
++
++ message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
++ message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
+ endif()
+
+ if(EMBED_LIBCLANG_ONLY AND NOT EMBED_CLANG)
+diff -ru a/src/ast/CMakeLists.txt b/src/ast/CMakeLists.txt
+--- a/src/ast/CMakeLists.txt 2020-05-20 21:00:22.777744534 -0500
++++ b/src/ast/CMakeLists.txt 2020-05-20 20:52:39.657888690 -0500
+@@ -42,26 +41,29 @@
+ if(EMBED_LIBCLANG_ONLY)
+ unlink_transitive_dependency("${CLANG_EXPORTED_TARGETS}" "LLVM")
+ endif()
+- target_link_libraries(bpftraceast ${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(bpftraceast ${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(bpftraceast ${clang_libs})
+- target_link_libraries(bpftraceast ${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(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(bpftraceast ${llvm_libs})
++ find_package(LLVM 9 REQUIRED CONFIG)
++
++ include_directories(${LLVM_INCLUDE_DIRS})
++ add_definitions(${LLVM_DEFINITIONS})
++
++ find_library(found_clang clang HINTS ${LLVM_LIBRARY_DIRS})
++ if(found_clang)
++ target_link_libraries(bpftraceast ${found_clang})
+ endif()
+- target_link_libraries(bpftraceast libclang)
++ 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(bpftraceast ${llvm_libs})
+ endif()
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2020-07-15 19:09 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2020-07-15 19:09 UTC (permalink / raw
To: gentoo-commits
commit: 7b55743aa30fdbdbdfdc15d10465a5d3384917cf
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 15 19:08:38 2020 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Wed Jul 15 19:09:21 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b55743a
dev-util/bpftrace-0.11.0: Version bump, sync 9999
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/Manifest | 1 +
...bpftrace-9999.ebuild => bpftrace-0.11.0.ebuild} | 48 +++++--
dev-util/bpftrace/bpftrace-9999.ebuild | 48 +++++--
.../files/bpftrace-0.11.0-install-libs.patch | 156 +++++++++++++++++++++
4 files changed, 225 insertions(+), 28 deletions(-)
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest
index 44a6444f74b..76af8334ccf 100644
--- a/dev-util/bpftrace/Manifest
+++ b/dev-util/bpftrace/Manifest
@@ -1,4 +1,5 @@
DIST bpftrace-0.10.0.tar.gz 835854 BLAKE2B 623369bb2a2ad8d5eec364afa98bdae3fbe5e66182d8f1187fe86a8bd70ee357a554eb063fdbe5476eab23912adf2cf027092cac3e6989d8f716e91aa5d01212 SHA512 da400efe78cea505a32deead594b047ec4394d3eefe86e7b6853fe2dc715c5847a3abcbd26c1fac39d0a534f1e57d6c0bc3625e0c3f1054b0d84b7b1d6eb69b9
+DIST bpftrace-0.11.0.tar.gz 867444 BLAKE2B a99255befadea0b4cb54299a8318c0a7a667ac2258b612750705b4d351ac59f4411f2567bc0100929291e3c9756d276671e41af9d398b118b3d486dace2953d7 SHA512 32bf0c23a7b0e1a57d0e0b8fc845a9e184e201ac3f6018a3d3cee8c97096093b333578cb898ede02fb3ab8d55ba9bcd2bb67ac70b81a49461c0f6e5c03c2a6f5
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
diff --git a/dev-util/bpftrace/bpftrace-9999.ebuild b/dev-util/bpftrace/bpftrace-0.11.0.ebuild
similarity index 52%
copy from dev-util/bpftrace/bpftrace-9999.ebuild
copy to dev-util/bpftrace/bpftrace-0.11.0.ebuild
index ccad41e9941..eab73335433 100644
--- a/dev-util/bpftrace/bpftrace-9999.ebuild
+++ b/dev-util/bpftrace/bpftrace-0.11.0.ebuild
@@ -1,9 +1,9 @@
-# Copyright 2019 Gentoo Authors
+# 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
+inherit toolchain-funcs llvm linux-info cmake
DESCRIPTION="High-level tracing language for eBPF"
HOMEPAGE="https://github.com/iovisor/bpftrace"
@@ -13,7 +13,8 @@ if [[ ${PV} =~ 9{4,} ]]; then
EGIT_REPO_URI="https://github.com/iovisor/${PN}"
BDEPEND=""
else
- SRC_URI="https://github.com/iovisor/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ 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
@@ -22,37 +23,56 @@ LICENSE="Apache-2.0"
SLOT="0"
IUSE="test"
-COMMON_DEPEND="dev-util/systemtap
+COMMON_DEPEND="
+ dev-util/systemtap
sys-devel/clang:=
dev-libs/libbpf:=
>=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)]
- >=dev-util/bcc-0.10.0:=
- virtual/libelf"
+ <sys-devel/clang-10:=
+ <sys-devel/llvm-10:=[llvm_targets_BPF(+)]
+ >=dev-util/bcc-0.13.0:=
+ virtual/libelf
+"
DEPEND="${COMMON_DEPEND}
- test? ( dev-cpp/gtest )"
+ test? ( dev-cpp/gtest )
+"
RDEPEND="${COMMON_DEPEND}"
-BDEPEND+="dev-util/cmake
+BDEPEND+="
+ >=dev-util/cmake-3.8
sys-devel/flex
- sys-devel/bison"
+ sys-devel/bison
+"
+S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so"
PATCHES=(
- "${FILESDIR}/bpftrace-0.9.3-install-libs.patch"
- "${FILESDIR}/bpftrace-mandir.patch"
+ "${FILESDIR}/bpftrace-0.11.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_SYSCALL ~BPF_JIT ~BPF_EVENTS"
+ local CONFIG_CHECK="
+ ~BPF
+ ~BPF_EVENTS
+ ~BPF_JIT
+ ~BPF_SYSCALL
+ ~FTRACE_SYSCALLS
+ ~HAVE_EBPF_JIT
+ "
check_extra_config
}
+pkg_setup() {
+ LLVM_MAX_SLOT=9 llvm_pkg_setup
+}
+
src_prepare() {
- cmake-utils_src_prepare
+ cmake_src_prepare
}
src_configure() {
@@ -62,5 +82,5 @@ src_configure() {
"-DBUILD_TESTING:BOOL=OFF"
)
- cmake-utils_src_configure
+ cmake_src_configure
}
diff --git a/dev-util/bpftrace/bpftrace-9999.ebuild b/dev-util/bpftrace/bpftrace-9999.ebuild
index ccad41e9941..eab73335433 100644
--- a/dev-util/bpftrace/bpftrace-9999.ebuild
+++ b/dev-util/bpftrace/bpftrace-9999.ebuild
@@ -1,9 +1,9 @@
-# Copyright 2019 Gentoo Authors
+# 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
+inherit toolchain-funcs llvm linux-info cmake
DESCRIPTION="High-level tracing language for eBPF"
HOMEPAGE="https://github.com/iovisor/bpftrace"
@@ -13,7 +13,8 @@ if [[ ${PV} =~ 9{4,} ]]; then
EGIT_REPO_URI="https://github.com/iovisor/${PN}"
BDEPEND=""
else
- SRC_URI="https://github.com/iovisor/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ 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
@@ -22,37 +23,56 @@ LICENSE="Apache-2.0"
SLOT="0"
IUSE="test"
-COMMON_DEPEND="dev-util/systemtap
+COMMON_DEPEND="
+ dev-util/systemtap
sys-devel/clang:=
dev-libs/libbpf:=
>=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)]
- >=dev-util/bcc-0.10.0:=
- virtual/libelf"
+ <sys-devel/clang-10:=
+ <sys-devel/llvm-10:=[llvm_targets_BPF(+)]
+ >=dev-util/bcc-0.13.0:=
+ virtual/libelf
+"
DEPEND="${COMMON_DEPEND}
- test? ( dev-cpp/gtest )"
+ test? ( dev-cpp/gtest )
+"
RDEPEND="${COMMON_DEPEND}"
-BDEPEND+="dev-util/cmake
+BDEPEND+="
+ >=dev-util/cmake-3.8
sys-devel/flex
- sys-devel/bison"
+ sys-devel/bison
+"
+S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so"
PATCHES=(
- "${FILESDIR}/bpftrace-0.9.3-install-libs.patch"
- "${FILESDIR}/bpftrace-mandir.patch"
+ "${FILESDIR}/bpftrace-0.11.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_SYSCALL ~BPF_JIT ~BPF_EVENTS"
+ local CONFIG_CHECK="
+ ~BPF
+ ~BPF_EVENTS
+ ~BPF_JIT
+ ~BPF_SYSCALL
+ ~FTRACE_SYSCALLS
+ ~HAVE_EBPF_JIT
+ "
check_extra_config
}
+pkg_setup() {
+ LLVM_MAX_SLOT=9 llvm_pkg_setup
+}
+
src_prepare() {
- cmake-utils_src_prepare
+ cmake_src_prepare
}
src_configure() {
@@ -62,5 +82,5 @@ src_configure() {
"-DBUILD_TESTING:BOOL=OFF"
)
- cmake-utils_src_configure
+ cmake_src_configure
}
diff --git a/dev-util/bpftrace/files/bpftrace-0.11.0-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.11.0-install-libs.patch
new file mode 100644
index 00000000000..a28e37564ea
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.11.0-install-libs.patch
@@ -0,0 +1,156 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1bca8d6..1482b29 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -91,9 +91,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 487fa9b..61b7b38 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -84,7 +84,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 a26c1c8..ffb5900 100644
+--- a/src/arch/CMakeLists.txt
++++ b/src/arch/CMakeLists.txt
+@@ -1,13 +1,15 @@
+ 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 "s390" OR
+ CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x")
+- add_library(arch s390.cpp)
++ add_library(bpftracearch s390.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 649bf0a..b969b9c 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
+@@ -7,17 +7,18 @@ add_library(ast
+ printer.cpp
+ semantic_analyser.cpp
+ )
++install(TARGETS bpftraceast LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+-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)
+
+ if (HAVE_BCC_KFUNC)
+- target_compile_definitions(ast PRIVATE HAVE_BCC_KFUNC)
++ target_compile_definitions(bpftraceast PRIVATE HAVE_BCC_KFUNC)
+ endif(HAVE_BCC_KFUNC)
+
+-add_dependencies(ast parser)
++add_dependencies(bpftraceast bpftraceparser)
+
+ if (STATIC_LINKING)
+ set(clang_libs
+@@ -41,17 +42,17 @@ 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 option 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()
+
+ if(STATIC_LIBC)
+@@ -60,11 +61,11 @@ if (STATIC_LINKING)
+ 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 4104a57..59486de 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -101,7 +101,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)
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2020-08-25 0:19 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2020-08-25 0:19 UTC (permalink / raw
To: gentoo-commits
commit: d462006c30f8bcaa267ad7acff1692e88128429c
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 25 00:18:56 2020 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Aug 25 00:18:56 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d462006c
dev-util/bpftrace: Remove old
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/Manifest | 3 -
dev-util/bpftrace/bpftrace-0.11.0.ebuild | 86 ------------
dev-util/bpftrace/bpftrace-0.9.2.ebuild | 68 ----------
dev-util/bpftrace/bpftrace-0.9.3.ebuild | 68 ----------
dev-util/bpftrace/bpftrace-0.9.4.ebuild | 76 -----------
.../bpftrace-0.10_pre20190614-install-libs.patch | 115 ----------------
.../files/bpftrace-0.9.3-install-libs.patch | 129 ------------------
.../files/bpftrace-0.9.4-install-libs.patch | 141 --------------------
.../bpftrace/files/bpftrace-0.9.4-llvm-10.patch | 144 ---------------------
9 files changed, 830 deletions(-)
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest
index 76af8334ccf..05368aaf51b 100644
--- a/dev-util/bpftrace/Manifest
+++ b/dev-util/bpftrace/Manifest
@@ -1,5 +1,2 @@
DIST bpftrace-0.10.0.tar.gz 835854 BLAKE2B 623369bb2a2ad8d5eec364afa98bdae3fbe5e66182d8f1187fe86a8bd70ee357a554eb063fdbe5476eab23912adf2cf027092cac3e6989d8f716e91aa5d01212 SHA512 da400efe78cea505a32deead594b047ec4394d3eefe86e7b6853fe2dc715c5847a3abcbd26c1fac39d0a534f1e57d6c0bc3625e0c3f1054b0d84b7b1d6eb69b9
DIST bpftrace-0.11.0.tar.gz 867444 BLAKE2B a99255befadea0b4cb54299a8318c0a7a667ac2258b612750705b4d351ac59f4411f2567bc0100929291e3c9756d276671e41af9d398b118b3d486dace2953d7 SHA512 32bf0c23a7b0e1a57d0e0b8fc845a9e184e201ac3f6018a3d3cee8c97096093b333578cb898ede02fb3ab8d55ba9bcd2bb67ac70b81a49461c0f6e5c03c2a6f5
-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
diff --git a/dev-util/bpftrace/bpftrace-0.11.0.ebuild b/dev-util/bpftrace/bpftrace-0.11.0.ebuild
deleted file mode 100644
index eab73335433..00000000000
--- a/dev-util/bpftrace/bpftrace-0.11.0.ebuild
+++ /dev/null
@@ -1,86 +0,0 @@
-# Copyright 2019-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit toolchain-funcs llvm linux-info cmake
-
-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(+)]
- <sys-devel/clang-10:=
- <sys-devel/llvm-10:=[llvm_targets_BPF(+)]
- >=dev-util/bcc-0.13.0:=
- virtual/libelf
-"
-DEPEND="${COMMON_DEPEND}
- test? ( dev-cpp/gtest )
-"
-RDEPEND="${COMMON_DEPEND}"
-BDEPEND+="
- >=dev-util/cmake-3.8
- sys-devel/flex
- sys-devel/bison
-"
-
-S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
-QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so"
-
-PATCHES=(
- "${FILESDIR}/bpftrace-0.11.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
-}
-
-pkg_setup() {
- LLVM_MAX_SLOT=9 llvm_pkg_setup
-}
-
-src_prepare() {
- cmake_src_prepare
-}
-
-src_configure() {
- local -a mycmakeargs
- mycmakeargs=(
- "-DSTATIC_LINKING:BOOL=OFF"
- "-DBUILD_TESTING:BOOL=OFF"
- )
-
- cmake_src_configure
-}
diff --git a/dev-util/bpftrace/bpftrace-0.9.2.ebuild b/dev-util/bpftrace/bpftrace-0.9.2.ebuild
deleted file mode 100644
index 5fcb41040f5..00000000000
--- a/dev-util/bpftrace/bpftrace-0.9.2.ebuild
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright 2019 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.10.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_pre20190614-install-libs.patch"
- "${FILESDIR}/bpftrace-mandir.patch"
-)
-
-# lots of fixing needed
-RESTRICT="test"
-
-pkg_pretend() {
- local CONFIG_CHECK="~BPF ~BPF_SYSCALL ~BPF_JIT ~BPF_EVENTS"
-
- 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/bpftrace-0.9.3.ebuild b/dev-util/bpftrace/bpftrace-0.9.3.ebuild
deleted file mode 100644
index 74f1dd849d2..00000000000
--- a/dev-util/bpftrace/bpftrace-0.9.3.ebuild
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright 2019 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.10.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.3-install-libs.patch"
- "${FILESDIR}/bpftrace-mandir.patch"
-)
-
-# lots of fixing needed
-RESTRICT="test"
-
-pkg_pretend() {
- local CONFIG_CHECK="~BPF ~BPF_SYSCALL ~BPF_JIT ~BPF_EVENTS"
-
- 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/bpftrace-0.9.4.ebuild b/dev-util/bpftrace/bpftrace-0.9.4.ebuild
deleted file mode 100644
index ad25d1221e1..00000000000
--- a/dev-util/bpftrace/bpftrace-0.9.4.ebuild
+++ /dev/null
@@ -1,76 +0,0 @@
-# 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-llvm-10.patch"
- "${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.10_pre20190614-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.10_pre20190614-install-libs.patch
deleted file mode 100644
index f4483570c99..00000000000
--- a/dev-util/bpftrace/files/bpftrace-0.10_pre20190614-install-libs.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index e8870c6..a55385d 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -47,9 +47,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 b8b0d96..0803c1e 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 e737119..b2b17e2 100644
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -30,7 +30,8 @@ endif(HAVE_BCC_ELF_FOREACH_SYM)
- if(HAVE_GET_CURRENT_CGROUP_ID)
- target_compile_definitions(bpftrace PRIVATE HAVE_GET_CURRENT_CGROUP_ID)
- endif(HAVE_GET_CURRENT_CGROUP_ID)
--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 a26f610..53627e2 100644
---- a/src/arch/CMakeLists.txt
-+++ b/src/arch/CMakeLists.txt
-@@ -1,5 +1,7 @@
- if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
-- add_library(arch aarch64.cpp)
-+ add_library(bpftracearch aarch64.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 4d77c9f..2a00572 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
- irbuilderbpf.cpp
-@@ -7,15 +7,16 @@ add_library(ast
- )
-
- if(HAVE_GET_CURRENT_CGROUP_ID)
-- target_compile_definitions(ast PRIVATE HAVE_GET_CURRENT_CGROUP_ID)
-+ target_compile_definitions(bpftraceast PRIVATE HAVE_GET_CURRENT_CGROUP_ID)
- endif(HAVE_GET_CURRENT_CGROUP_ID)
-
--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
-@@ -35,16 +36,16 @@ if (STATIC_LINKING)
- clangSerialization
- clangToolingCore)
- 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})
- 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/dev-util/bpftrace/files/bpftrace-0.9.3-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.9.3-install-libs.patch
deleted file mode 100644
index 0ddb07b4740..00000000000
--- a/dev-util/bpftrace/files/bpftrace-0.9.3-install-libs.patch
+++ /dev/null
@@ -1,129 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 5e0d770..d51edf6 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -51,9 +51,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 b8b0d96..0803c1e 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 65f3a34..b001a83 100644
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -56,7 +56,8 @@ if (ALLOW_UNSAFE_UPROBE)
- target_compile_definitions(bpftrace PRIVATE HAVE_UNSAFE_UPROBE)
- endif(ALLOW_UNSAFE_UPROBE)
-
--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 a26f610..53627e2 100644
---- a/src/arch/CMakeLists.txt
-+++ b/src/arch/CMakeLists.txt
-@@ -1,5 +1,7 @@
- if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
-- add_library(arch aarch64.cpp)
-+ add_library(bpftracearch aarch64.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 4d77c9f..2a00572 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
- irbuilderbpf.cpp
-@@ -7,15 +7,16 @@ add_library(ast
- )
-
- if(HAVE_GET_CURRENT_CGROUP_ID)
-- target_compile_definitions(ast PRIVATE HAVE_GET_CURRENT_CGROUP_ID)
-+ target_compile_definitions(bpftraceast PRIVATE HAVE_GET_CURRENT_CGROUP_ID)
- endif(HAVE_GET_CURRENT_CGROUP_ID)
-
--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
-@@ -35,16 +36,16 @@ if (STATIC_LINKING)
- clangSerialization
- clangToolingCore)
- 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})
- 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 2d18277..f66a8b7 100644
---- a/tests/CMakeLists.txt
-+++ b/tests/CMakeLists.txt
-@@ -76,7 +76,8 @@ if(HAVE_BFD_DISASM)
- target_link_libraries(bpftrace_test ${LIBOPCODES_LIBRARIES})
- 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)
- target_link_libraries(bpftrace_test ${LIBBCC_LIBRARIES})
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
deleted file mode 100644
index fe3fc29fd9b..00000000000
--- a/dev-util/bpftrace/files/bpftrace-0.9.4-install-libs.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-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)
diff --git a/dev-util/bpftrace/files/bpftrace-0.9.4-llvm-10.patch b/dev-util/bpftrace/files/bpftrace-0.9.4-llvm-10.patch
deleted file mode 100644
index c2131cbbc30..00000000000
--- a/dev-util/bpftrace/files/bpftrace-0.9.4-llvm-10.patch
+++ /dev/null
@@ -1,144 +0,0 @@
-diff --git a/src/ast/codegen_llvm.cpp b/src/ast/codegen_llvm.cpp
-index f81906c..bcc2c7d 100644
---- a/src/ast/codegen_llvm.cpp
-+++ b/src/ast/codegen_llvm.cpp
-@@ -41,7 +41,7 @@ void CodegenLLVM::visit(PositionalParameter ¶m)
- {
- Constant *const_str = ConstantDataArray::getString(module_->getContext(), pstr, true);
- AllocaInst *buf = b_.CreateAllocaBPF(ArrayType::get(b_.getInt8Ty(), pstr.length() + 1), "str");
-- b_.CreateMemSet(buf, b_.getInt8(0), pstr.length() + 1, 1);
-+ b_.CREATE_MEMSET(buf, b_.getInt8(0), pstr.length() + 1, 1);
- b_.CreateStore(const_str, buf);
- expr_ = buf;
- }
-@@ -156,7 +156,7 @@ void CodegenLLVM::visit(Builtin &builtin)
- {
- AllocaInst *buf = b_.CreateAllocaBPF(builtin.type, "comm");
- // initializing memory needed for older kernels:
-- b_.CreateMemSet(buf, b_.getInt8(0), builtin.type.size, 1);
-+ b_.CREATE_MEMSET(buf, b_.getInt8(0), builtin.type.size, 1);
- b_.CreateGetCurrentComm(buf, builtin.type.size);
- expr_ = buf;
- }
-@@ -189,7 +189,7 @@ void CodegenLLVM::visit(Builtin &builtin)
- if (builtin.type.type == Type::usym)
- {
- AllocaInst *buf = b_.CreateAllocaBPF(builtin.type, "func");
-- b_.CreateMemSet(buf, b_.getInt8(0), builtin.type.size, 1);
-+ b_.CREATE_MEMSET(buf, b_.getInt8(0), builtin.type.size, 1);
- Value *pid = b_.CreateLShr(b_.CreateGetPidTgid(), 32);
- Value *addr_offset = b_.CreateGEP(buf, b_.getInt64(0));
- Value *pid_offset = b_.CreateGEP(buf, {b_.getInt64(0), b_.getInt64(8)});
-@@ -444,7 +444,7 @@ void CodegenLLVM::visit(Call &call)
- else if (call.func == "str")
- {
- AllocaInst *strlen = b_.CreateAllocaBPF(b_.getInt64Ty(), "strlen");
-- b_.CreateMemSet(strlen, b_.getInt8(0), sizeof(uint64_t), 1);
-+ b_.CREATE_MEMSET(strlen, b_.getInt8(0), sizeof(uint64_t), 1);
- if (call.vargs->size() > 1) {
- call.vargs->at(1)->accept(*this);
- Value *proposed_strlen = b_.CreateAdd(expr_, b_.getInt64(1)); // add 1 to accommodate probe_read_str's null byte
-@@ -462,7 +462,7 @@ void CodegenLLVM::visit(Call &call)
- b_.CreateStore(b_.getInt64(bpftrace_.strlen_), strlen);
- }
- AllocaInst *buf = b_.CreateAllocaBPF(bpftrace_.strlen_, "str");
-- b_.CreateMemSet(buf, b_.getInt8(0), bpftrace_.strlen_, 1);
-+ b_.CREATE_MEMSET(buf, b_.getInt8(0), bpftrace_.strlen_, 1);
- call.vargs->front()->accept(*this);
- b_.CreateProbeReadStr(buf, b_.CreateLoad(strlen), expr_);
- b_.CreateLifetimeEnd(strlen);
-@@ -541,7 +541,7 @@ void CodegenLLVM::visit(Call &call)
- {
- // store uint64_t[2] with: [0]: (uint64_t)addr, [1]: (uint64_t)pid
- AllocaInst *buf = b_.CreateAllocaBPF(call.type, "usym");
-- b_.CreateMemSet(buf, b_.getInt8(0), call.type.size, 1);
-+ b_.CREATE_MEMSET(buf, b_.getInt8(0), call.type.size, 1);
- Value *pid = b_.CreateLShr(b_.CreateGetPidTgid(), 32);
- Value *addr_offset = b_.CreateGEP(buf, b_.getInt64(0));
- Value *pid_offset = b_.CreateGEP(buf, {b_.getInt64(0), b_.getInt64(8)});
-@@ -592,7 +592,7 @@ void CodegenLLVM::visit(Call &call)
- b_.CreateStore(af_type, af_offset);
-
- Value *inet_offset = b_.CreateGEP(buf, {b_.getInt32(0), b_.getInt32(1)});
-- b_.CreateMemSet(inet_offset, b_.getInt8(0), 16, 1);
-+ b_.CREATE_MEMSET(inet_offset, b_.getInt8(0), 16, 1);
-
- inet->accept(*this);
- if (inet->type.type == Type::array)
-@@ -663,7 +663,7 @@ void CodegenLLVM::visit(Call &call)
- auto &map = static_cast<Map&>(arg);
- Constant *const_str = ConstantDataArray::getString(module_->getContext(), map.ident, true);
- AllocaInst *str_buf = b_.CreateAllocaBPF(ArrayType::get(b_.getInt8Ty(), map.ident.length() + 1), "str");
-- b_.CreateMemSet(str_buf, b_.getInt8(0), map.ident.length() + 1, 1);
-+ b_.CREATE_MEMSET(str_buf, b_.getInt8(0), map.ident.length() + 1, 1);
- b_.CreateStore(const_str, str_buf);
- ArrayType *perfdata_type = ArrayType::get(b_.getInt8Ty(), sizeof(uint64_t) + 2 * sizeof(uint64_t) + map.ident.length() + 1);
- AllocaInst *perfdata = b_.CreateAllocaBPF(perfdata_type, "perfdata");
-@@ -707,7 +707,7 @@ void CodegenLLVM::visit(Call &call)
- auto &map = static_cast<Map&>(arg);
- Constant *const_str = ConstantDataArray::getString(module_->getContext(), map.ident, true);
- AllocaInst *str_buf = b_.CreateAllocaBPF(ArrayType::get(b_.getInt8Ty(), map.ident.length() + 1), "str");
-- b_.CreateMemSet(str_buf, b_.getInt8(0), map.ident.length() + 1, 1);
-+ b_.CREATE_MEMSET(str_buf, b_.getInt8(0), map.ident.length() + 1, 1);
- b_.CreateStore(const_str, str_buf);
- ArrayType *perfdata_type = ArrayType::get(b_.getInt8Ty(), sizeof(uint64_t) + map.ident.length() + 1);
- AllocaInst *perfdata = b_.CreateAllocaBPF(perfdata_type, "perfdata");
-@@ -1204,7 +1204,7 @@ void CodegenLLVM::visit(FieldAccess &acc)
- {
- AllocaInst *dst = b_.CreateAllocaBPF(field.type, type.cast_type + "." + acc.field);
- // memset so verifier doesn't complain about reading uninitialized stack
-- b_.CreateMemSet(dst, b_.getInt8(0), field.type.size, 1);
-+ b_.CREATE_MEMSET(dst, b_.getInt8(0), field.type.size, 1);
- b_.CreateProbeRead(dst, field.bitfield.read_bytes, src);
- Value *raw = b_.CreateLoad(dst);
- Value *shifted = b_.CreateLShr(raw, field.bitfield.access_rshift);
-@@ -1906,7 +1906,7 @@ void CodegenLLVM::createFormatStringCall(Call &call, int &id, CallArgs &call_arg
- }
-
- AllocaInst *fmt_args = b_.CreateAllocaBPF(fmt_struct, call_name + "_args");
-- b_.CreateMemSet(fmt_args, b_.getInt8(0), struct_size, 1);
-+ b_.CREATE_MEMSET(fmt_args, b_.getInt8(0), struct_size, 1);
-
- Value *id_offset = b_.CreateGEP(fmt_args, {b_.getInt32(0), b_.getInt32(0)});
- b_.CreateStore(b_.getInt64(id + asyncactionint(async_action)), id_offset);
-diff --git a/src/ast/irbuilderbpf.cpp b/src/ast/irbuilderbpf.cpp
-index eb84f7b..5dd72d0 100644
---- a/src/ast/irbuilderbpf.cpp
-+++ b/src/ast/irbuilderbpf.cpp
-@@ -82,7 +82,7 @@ AllocaInst *IRBuilderBPF::CreateAllocaBPFInit(const SizedType &stype, const std:
- }
- else
- {
-- CreateMemSet(alloca, getInt64(0), stype.size, 1);
-+ CREATE_MEMSET(alloca, getInt64(0), stype.size, 1);
- }
-
- restoreIP(ip);
-@@ -226,7 +226,7 @@ Value *IRBuilderBPF::CreateMapLookupElem(int mapfd, AllocaInst *key, SizedType &
-
- SetInsertPoint(lookup_failure_block);
- if (is_array)
-- CreateMemSet(value, getInt8(0), type.size, 1);
-+ CREATE_MEMSET(value, getInt8(0), type.size, 1);
- else
- CreateStore(getInt64(0), value);
- CreateBr(lookup_merge_block);
-diff --git a/src/ast/irbuilderbpf.h b/src/ast/irbuilderbpf.h
-index 58e6882..6b2e7f1 100644
---- a/src/ast/irbuilderbpf.h
-+++ b/src/ast/irbuilderbpf.h
-@@ -18,6 +18,14 @@
- #error Unsupported LLVM version
- #endif
-
-+#if LLVM_VERSION_MAJOR >= 10
-+#define CREATE_MEMSET(ptr, val, size, align) \
-+ CreateMemSet((ptr), (val), (size), MaybeAlign((align)))
-+#else
-+#define CREATE_MEMSET(ptr, val, size, align) \
-+ CreateMemSet((ptr), (val), (size), (align))
-+#endif
-+
- namespace bpftrace {
- namespace ast {
-
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2020-11-14 1:30 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2020-11-14 1:30 UTC (permalink / raw
To: gentoo-commits
commit: 246efe903747c7a63efba8913a1949074fdbde35
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 14 01:30:13 2020 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Sat Nov 14 01:30:13 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=246efe90
dev-util/bpftrace: Remove old
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/Manifest | 4 -
dev-util/bpftrace/bpftrace-0.10.0-r1.ebuild | 80 --------------------
dev-util/bpftrace/bpftrace-0.11.0-r1.ebuild | 85 ---------------------
dev-util/bpftrace/bpftrace-0.11.1.ebuild | 85 ---------------------
dev-util/bpftrace/bpftrace-0.11.2.ebuild | 86 ----------------------
dev-util/bpftrace/bpftrace-9999.ebuild | 6 +-
.../files/bpftrace-0.10.0-llvm-multi.patch | 60 ---------------
.../bpftrace-0.10.0-no-bpf_detach_kfunc.patch | 13 ----
8 files changed, 3 insertions(+), 416 deletions(-)
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest
index 04ce369b610..6aab218fe7e 100644
--- a/dev-util/bpftrace/Manifest
+++ b/dev-util/bpftrace/Manifest
@@ -1,5 +1 @@
-DIST bpftrace-0.10.0.tar.gz 835854 BLAKE2B 623369bb2a2ad8d5eec364afa98bdae3fbe5e66182d8f1187fe86a8bd70ee357a554eb063fdbe5476eab23912adf2cf027092cac3e6989d8f716e91aa5d01212 SHA512 da400efe78cea505a32deead594b047ec4394d3eefe86e7b6853fe2dc715c5847a3abcbd26c1fac39d0a534f1e57d6c0bc3625e0c3f1054b0d84b7b1d6eb69b9
-DIST bpftrace-0.11.0.tar.gz 867444 BLAKE2B a99255befadea0b4cb54299a8318c0a7a667ac2258b612750705b4d351ac59f4411f2567bc0100929291e3c9756d276671e41af9d398b118b3d486dace2953d7 SHA512 32bf0c23a7b0e1a57d0e0b8fc845a9e184e201ac3f6018a3d3cee8c97096093b333578cb898ede02fb3ab8d55ba9bcd2bb67ac70b81a49461c0f6e5c03c2a6f5
-DIST bpftrace-0.11.1.tar.gz 867481 BLAKE2B d77e69e21a1cdd65c610b57a8e16d02ff2da69bbb6fd207ff312d2ee3dd4ccbaded205e4b9f16a7ff24177fbc227304ffbb447cd974f44c7828d54f38ad573d5 SHA512 361cedc6ce8a950188717db5ffd005b9709371010810cf6bc870ca945c1db9bdc7ab99b55b694345d580d03145b3eb6ca169f2f1f9909f3e9fc34250df9999f3
-DIST bpftrace-0.11.2.tar.gz 867724 BLAKE2B 6d0a10c8a4261277fc3a6e5f422e26238673dcd76abcae6bd8079cc98ee713d3d34d3e09284f5c79ba323d7203d6d944999da17f73ab2afbf1d403cb0dd1a392 SHA512 25bcc9863d24646108252f0010b96afb823eb795c8c6d94112b7804740d7688139ead7d862a205a1b44b86ef135b412e533fc119939ce550e5509b1bd37952fa
DIST bpftrace-0.11.3.tar.gz 867967 BLAKE2B 950362e4a4c0f61d67056eacfde0b54a9be9b65285b243cbbb137d113020868f01b1792fddaffbaf41ed174b47cd2f197c0aa89f78690d3e71dae4b7a4c05e3e SHA512 76f6b19ce2a2f3989ebafc49a4df337c6b5f3acf39e7415846b16ee08e2fa7a59821cd18de3c9ed29420b323de8458d1411ccf801e9cd5f3ac64f2bd981e2c3c
diff --git a/dev-util/bpftrace/bpftrace-0.10.0-r1.ebuild b/dev-util/bpftrace/bpftrace-0.10.0-r1.ebuild
deleted file mode 100644
index 26c1753afef..00000000000
--- a/dev-util/bpftrace/bpftrace-0.10.0-r1.ebuild
+++ /dev/null
@@ -1,80 +0,0 @@
-# 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(+)]
- <sys-devel/clang-10:=
- <sys-devel/llvm-10:=[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"
- "${FILESDIR}/bpftrace-0.10.0-llvm-multi.patch"
- # bpf_detach_kfunc has always been a noop
- "${FILESDIR}/bpftrace-0.10.0-no-bpf_detach_kfunc.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/bpftrace-0.11.0-r1.ebuild b/dev-util/bpftrace/bpftrace-0.11.0-r1.ebuild
deleted file mode 100644
index 6eeeb6c28d6..00000000000
--- a/dev-util/bpftrace/bpftrace-0.11.0-r1.ebuild
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright 2019-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit toolchain-funcs llvm linux-info cmake
-
-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(+)]
- sys-devel/clang:=
- >=dev-util/bcc-0.13.0:=
- virtual/libelf
-"
-DEPEND="${COMMON_DEPEND}
- test? ( dev-cpp/gtest )
-"
-RDEPEND="${COMMON_DEPEND}"
-BDEPEND+="
- >=dev-util/cmake-3.8
- sys-devel/flex
- sys-devel/bison
-"
-
-S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
-QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so"
-
-PATCHES=(
- "${FILESDIR}/bpftrace-0.11.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
-}
-
-pkg_setup() {
- LLVM_MAX_SLOT=11 llvm_pkg_setup
-}
-
-src_prepare() {
- cmake_src_prepare
-}
-
-src_configure() {
- local -a mycmakeargs
- mycmakeargs=(
- "-DSTATIC_LINKING:BOOL=OFF"
- "-DBUILD_TESTING:BOOL=OFF"
- )
-
- cmake_src_configure
-}
diff --git a/dev-util/bpftrace/bpftrace-0.11.1.ebuild b/dev-util/bpftrace/bpftrace-0.11.1.ebuild
deleted file mode 100644
index 6eeeb6c28d6..00000000000
--- a/dev-util/bpftrace/bpftrace-0.11.1.ebuild
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright 2019-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit toolchain-funcs llvm linux-info cmake
-
-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(+)]
- sys-devel/clang:=
- >=dev-util/bcc-0.13.0:=
- virtual/libelf
-"
-DEPEND="${COMMON_DEPEND}
- test? ( dev-cpp/gtest )
-"
-RDEPEND="${COMMON_DEPEND}"
-BDEPEND+="
- >=dev-util/cmake-3.8
- sys-devel/flex
- sys-devel/bison
-"
-
-S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
-QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so"
-
-PATCHES=(
- "${FILESDIR}/bpftrace-0.11.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
-}
-
-pkg_setup() {
- LLVM_MAX_SLOT=11 llvm_pkg_setup
-}
-
-src_prepare() {
- cmake_src_prepare
-}
-
-src_configure() {
- local -a mycmakeargs
- mycmakeargs=(
- "-DSTATIC_LINKING:BOOL=OFF"
- "-DBUILD_TESTING:BOOL=OFF"
- )
-
- cmake_src_configure
-}
diff --git a/dev-util/bpftrace/bpftrace-0.11.2.ebuild b/dev-util/bpftrace/bpftrace-0.11.2.ebuild
deleted file mode 100644
index 263e993188e..00000000000
--- a/dev-util/bpftrace/bpftrace-0.11.2.ebuild
+++ /dev/null
@@ -1,86 +0,0 @@
-# Copyright 2019-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit toolchain-funcs llvm linux-info cmake
-
-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
- <dev-libs/libbpf-0.2:=
- >=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)]
- <=sys-devel/llvm-12:=[llvm_targets_BPF(+)]
- <=sys-devel/clang-12:=
- >=dev-util/bcc-0.13.0:=
- <dev-util/bcc-0.17.0:=
- virtual/libelf
-"
-DEPEND="${COMMON_DEPEND}
- test? ( dev-cpp/gtest )
-"
-RDEPEND="${COMMON_DEPEND}"
-BDEPEND+="
- >=dev-util/cmake-3.8
- sys-devel/flex
- sys-devel/bison
-"
-
-S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
-QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so"
-
-PATCHES=(
- "${FILESDIR}/bpftrace-0.11.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
-}
-
-pkg_setup() {
- LLVM_MAX_SLOT=11 llvm_pkg_setup
-}
-
-src_prepare() {
- cmake_src_prepare
-}
-
-src_configure() {
- local -a mycmakeargs
- mycmakeargs=(
- "-DSTATIC_LINKING:BOOL=OFF"
- "-DBUILD_TESTING:BOOL=OFF"
- )
-
- cmake_src_configure
-}
diff --git a/dev-util/bpftrace/bpftrace-9999.ebuild b/dev-util/bpftrace/bpftrace-9999.ebuild
index 6eeeb6c28d6..2a14dc58476 100644
--- a/dev-util/bpftrace/bpftrace-9999.ebuild
+++ b/dev-util/bpftrace/bpftrace-9999.ebuild
@@ -25,10 +25,10 @@ IUSE="test"
COMMON_DEPEND="
dev-util/systemtap
- sys-devel/clang:=
- dev-libs/libbpf:=
+ <dev-libs/libbpf-0.2:=
>=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)]
- sys-devel/clang:=
+ <=sys-devel/llvm-12:=[llvm_targets_BPF(+)]
+ <=sys-devel/clang-12:=
>=dev-util/bcc-0.13.0:=
virtual/libelf
"
diff --git a/dev-util/bpftrace/files/bpftrace-0.10.0-llvm-multi.patch b/dev-util/bpftrace/files/bpftrace-0.10.0-llvm-multi.patch
deleted file mode 100644
index 48eeeb8e200..00000000000
--- a/dev-util/bpftrace/files/bpftrace-0.10.0-llvm-multi.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff -ru a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt 2020-05-20 21:00:22.789744736 -0500
-+++ b/CMakeLists.txt 2020-05-20 18:52:38.241091110 -0500
-@@ -30,6 +30,11 @@
- elseif(STATIC_LIBC)
- message(WARNING "static libc is known to cause problems, consider STATIC_LIBC=OFF. Proceed at your own risk") #iovisor/bpftrace/issues/266
- endif()
-+else()
-+ find_package(LLVM 9 REQUIRED CONFIG)
-+
-+ message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
-+ message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
- endif()
-
- if(EMBED_LIBCLANG_ONLY AND NOT EMBED_CLANG)
-diff -ru a/src/ast/CMakeLists.txt b/src/ast/CMakeLists.txt
---- a/src/ast/CMakeLists.txt 2020-05-20 21:00:22.777744534 -0500
-+++ b/src/ast/CMakeLists.txt 2020-05-20 20:52:39.657888690 -0500
-@@ -42,26 +41,29 @@
- if(EMBED_LIBCLANG_ONLY)
- unlink_transitive_dependency("${CLANG_EXPORTED_TARGETS}" "LLVM")
- endif()
-- target_link_libraries(bpftraceast ${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(bpftraceast ${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(bpftraceast ${clang_libs})
-- target_link_libraries(bpftraceast ${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(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(bpftraceast ${llvm_libs})
-+ find_package(LLVM 9 REQUIRED CONFIG)
-+
-+ include_directories(${LLVM_INCLUDE_DIRS})
-+ add_definitions(${LLVM_DEFINITIONS})
-+
-+ find_library(found_clang clang HINTS ${LLVM_LIBRARY_DIRS})
-+ if(found_clang)
-+ target_link_libraries(bpftraceast ${found_clang})
- endif()
-- target_link_libraries(bpftraceast libclang)
-+ 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(bpftraceast ${llvm_libs})
- endif()
diff --git a/dev-util/bpftrace/files/bpftrace-0.10.0-no-bpf_detach_kfunc.patch b/dev-util/bpftrace/files/bpftrace-0.10.0-no-bpf_detach_kfunc.patch
deleted file mode 100644
index 145fb1c0ca9..00000000000
--- a/dev-util/bpftrace/files/bpftrace-0.10.0-no-bpf_detach_kfunc.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/attached_probe.cpp b/src/attached_probe.cpp
-index c7e789e..08f657e 100644
---- a/src/attached_probe.cpp
-+++ b/src/attached_probe.cpp
-@@ -116,7 +116,7 @@ void AttachedProbe::attach_kfunc(void)
- int AttachedProbe::detach_kfunc(void)
- {
- close(tracing_fd_);
-- return bpf_detach_kfunc(progfd_, NULL);
-+ return 0;
- }
- #else
- void AttachedProbe::attach_kfunc(void)
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2021-04-20 18:04 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2021-04-20 18:04 UTC (permalink / raw
To: gentoo-commits
commit: c1d1ece10f2f6dd3f34d59b0b4066f8f0d73eaa0
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 20 18:04:10 2021 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Apr 20 18:04:26 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1d1ece1
dev-util/bpftrace-0.12.1-r1: revbump, fix up library installation
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
.../bpftrace/{bpftrace-0.12.1.ebuild => bpftrace-0.12.1-r1.ebuild} | 0
dev-util/bpftrace/files/bpftrace-0.12.0-install-libs.patch | 7 ++++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dev-util/bpftrace/bpftrace-0.12.1.ebuild b/dev-util/bpftrace/bpftrace-0.12.1-r1.ebuild
similarity index 100%
rename from dev-util/bpftrace/bpftrace-0.12.1.ebuild
rename to dev-util/bpftrace/bpftrace-0.12.1-r1.ebuild
diff --git a/dev-util/bpftrace/files/bpftrace-0.12.0-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.12.0-install-libs.patch
index ef715ea5da8..04c08b3efa8 100644
--- a/dev-util/bpftrace/files/bpftrace-0.12.0-install-libs.patch
+++ b/dev-util/bpftrace/files/bpftrace-0.12.0-install-libs.patch
@@ -31,19 +31,20 @@ index a95c60a1..f5c4d676 100644
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 37ee2204..d35574f5 100644
+index 37ee2204..8b2e1909 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
-@@ -145,7 +145,7 @@ if (ALLOW_UNSAFE_PROBE)
+@@ -145,7 +145,8 @@ if (ALLOW_UNSAFE_PROBE)
target_compile_definitions(libbpftrace PRIVATE HAVE_UNSAFE_PROBE)
endif(ALLOW_UNSAFE_PROBE)
-target_link_libraries(libbpftrace arch ast parser resources)
+target_link_libraries(libbpftrace bpftracearch bpftraceast bpftraceparser bpftraceresources)
++install(TARGETS bpftracearch bpftraceast bpftraceparser LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
target_link_libraries(libbpftrace ${LIBBCC_LIBRARIES})
if(STATIC_LINKING)
-@@ -194,6 +194,7 @@ if (USE_LIBFUZZER)
+@@ -194,6 +195,7 @@ if (USE_LIBFUZZER)
endif()
install(TARGETS ${BPFTRACE} DESTINATION ${CMAKE_INSTALL_BINDIR})
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2021-07-09 17:11 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2021-07-09 17:11 UTC (permalink / raw
To: gentoo-commits
commit: 235bbf5acbfecc780e991834acd4d0fee49ff7a1
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 9 17:11:23 2021 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Fri Jul 9 17:11:31 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=235bbf5a
dev-util/bpftrace: Remove old
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/Manifest | 1 -
dev-util/bpftrace/bpftrace-0.11.4-r1.ebuild | 89 ------------
dev-util/bpftrace/bpftrace-0.11.4.ebuild | 86 ------------
dev-util/bpftrace/bpftrace-9999.ebuild | 85 -----------
.../files/bpftrace-0.11.0-install-libs.patch | 156 ---------------------
5 files changed, 417 deletions(-)
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest
index 482103e5556..6f80ffa13ad 100644
--- a/dev-util/bpftrace/Manifest
+++ b/dev-util/bpftrace/Manifest
@@ -1,3 +1,2 @@
-DIST bpftrace-0.11.4.tar.gz 868016 BLAKE2B 50af7b4094e2875905d1ca36c003cde84e51adb11360f7933b82cd004dd7b9a8c2146d11c1422411ec0bb1935a693b17ab6d405aa5569ecabccfc21cdd1ca548 SHA512 611a7e61dbd1f4cc52b7e51a1a143296ff7b2df115b3a28034c674d8eefb5d482cac551ab82d6b7cc2f6fc0668b07d2d9e283dff371fd9a3f649c80113fdca82
DIST bpftrace-0.12.1.tar.gz 938043 BLAKE2B 3599c21d2381265ab5a7a3c0bf142dc7f79acb66fbb4f54b4100d042c21fc3c9e86297522bfe46f82ad5edbc2203314a6b02ff7cc07552c778b0726e681cb993 SHA512 a578499668bd2eb7342689b6c0ef3db6ca263a971d8e6f1b9a68c502c27170d24ede212a0fc2a72263e72aff58924f488a5c80d447397503a08512dc47b63345
DIST bpftrace-0.13.0.tar.gz 952412 BLAKE2B 8e3f6f28b0c652e2257e1a970b80b87ba5ac5e94dc26719bffe16a0bbff48efc2b9ab5bc03e5fe4b764f5c9c3df16039d931f1f13c1f14327880838a373edacc SHA512 16b3f11c365cc7e306045a5cb6bcf6c66b92d746884f6587ce7cc4c76841b284757bff7b38b9838eb3db129e996e4f1b13afec34da57981362dadef8460816d0
diff --git a/dev-util/bpftrace/bpftrace-0.11.4-r1.ebuild b/dev-util/bpftrace/bpftrace-0.11.4-r1.ebuild
deleted file mode 100644
index 76302016ee2..00000000000
--- a/dev-util/bpftrace/bpftrace-0.11.4-r1.ebuild
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright 2019-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit toolchain-funcs llvm linux-info cmake
-
-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
- dev-libs/libbpf:=
- >=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)]
- <=sys-devel/llvm-12:=[llvm_targets_BPF(+)]
- <=sys-devel/clang-12:=
- >=dev-util/bcc-0.13.0:=
- virtual/libelf
-"
-DEPEND="${COMMON_DEPEND}
- test? ( dev-cpp/gtest )
-"
-RDEPEND="${COMMON_DEPEND}"
-BDEPEND+="
- >=dev-util/cmake-3.8
- sys-devel/flex
- sys-devel/bison
-"
-
-S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
-QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so"
-
-PATCHES=(
- "${FILESDIR}/bpftrace-0.11.0-install-libs.patch"
- "${FILESDIR}/bpftrace-0.10.0-dont-compress-man.patch"
- "${FILESDIR}/bpftrace-0.11.4-old-kernels.patch"
-)
-
-# lots of fixing needed
-RESTRICT="test"
-
-# https://bugs.gentoo.org/754648
-RESTRICT+=" strip"
-
-pkg_pretend() {
- local CONFIG_CHECK="
- ~BPF
- ~BPF_EVENTS
- ~BPF_JIT
- ~BPF_SYSCALL
- ~FTRACE_SYSCALLS
- ~HAVE_EBPF_JIT
- "
-
- check_extra_config
-}
-
-pkg_setup() {
- LLVM_MAX_SLOT=11 llvm_pkg_setup
-}
-
-src_prepare() {
- cmake_src_prepare
-}
-
-src_configure() {
- local -a mycmakeargs
- mycmakeargs=(
- "-DSTATIC_LINKING:BOOL=OFF"
- "-DBUILD_TESTING:BOOL=OFF"
- )
-
- cmake_src_configure
-}
diff --git a/dev-util/bpftrace/bpftrace-0.11.4.ebuild b/dev-util/bpftrace/bpftrace-0.11.4.ebuild
deleted file mode 100644
index a3a1fb79701..00000000000
--- a/dev-util/bpftrace/bpftrace-0.11.4.ebuild
+++ /dev/null
@@ -1,86 +0,0 @@
-# Copyright 2019-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit toolchain-funcs llvm linux-info cmake
-
-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
- dev-libs/libbpf:=
- >=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)]
- <=sys-devel/llvm-12:=[llvm_targets_BPF(+)]
- <=sys-devel/clang-12:=
- >=dev-util/bcc-0.13.0:=
- virtual/libelf
-"
-DEPEND="${COMMON_DEPEND}
- test? ( dev-cpp/gtest )
-"
-RDEPEND="${COMMON_DEPEND}"
-BDEPEND+="
- >=dev-util/cmake-3.8
- sys-devel/flex
- sys-devel/bison
-"
-
-S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
-QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so"
-
-PATCHES=(
- "${FILESDIR}/bpftrace-0.11.0-install-libs.patch"
- "${FILESDIR}/bpftrace-0.10.0-dont-compress-man.patch"
- "${FILESDIR}/bpftrace-0.11.4-old-kernels.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
-}
-
-pkg_setup() {
- LLVM_MAX_SLOT=11 llvm_pkg_setup
-}
-
-src_prepare() {
- cmake_src_prepare
-}
-
-src_configure() {
- local -a mycmakeargs
- mycmakeargs=(
- "-DSTATIC_LINKING:BOOL=OFF"
- "-DBUILD_TESTING:BOOL=OFF"
- )
-
- cmake_src_configure
-}
diff --git a/dev-util/bpftrace/bpftrace-9999.ebuild b/dev-util/bpftrace/bpftrace-9999.ebuild
deleted file mode 100644
index 2a14dc58476..00000000000
--- a/dev-util/bpftrace/bpftrace-9999.ebuild
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright 2019-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit toolchain-funcs llvm linux-info cmake
-
-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
- <dev-libs/libbpf-0.2:=
- >=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)]
- <=sys-devel/llvm-12:=[llvm_targets_BPF(+)]
- <=sys-devel/clang-12:=
- >=dev-util/bcc-0.13.0:=
- virtual/libelf
-"
-DEPEND="${COMMON_DEPEND}
- test? ( dev-cpp/gtest )
-"
-RDEPEND="${COMMON_DEPEND}"
-BDEPEND+="
- >=dev-util/cmake-3.8
- sys-devel/flex
- sys-devel/bison
-"
-
-S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
-QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so"
-
-PATCHES=(
- "${FILESDIR}/bpftrace-0.11.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
-}
-
-pkg_setup() {
- LLVM_MAX_SLOT=11 llvm_pkg_setup
-}
-
-src_prepare() {
- cmake_src_prepare
-}
-
-src_configure() {
- local -a mycmakeargs
- mycmakeargs=(
- "-DSTATIC_LINKING:BOOL=OFF"
- "-DBUILD_TESTING:BOOL=OFF"
- )
-
- cmake_src_configure
-}
diff --git a/dev-util/bpftrace/files/bpftrace-0.11.0-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.11.0-install-libs.patch
deleted file mode 100644
index a28e37564ea..00000000000
--- a/dev-util/bpftrace/files/bpftrace-0.11.0-install-libs.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 1bca8d6..1482b29 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -91,9 +91,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 487fa9b..61b7b38 100644
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -84,7 +84,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 a26c1c8..ffb5900 100644
---- a/src/arch/CMakeLists.txt
-+++ b/src/arch/CMakeLists.txt
-@@ -1,13 +1,15 @@
- 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 "s390" OR
- CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x")
-- add_library(arch s390.cpp)
-+ add_library(bpftracearch s390.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 649bf0a..b969b9c 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
-@@ -7,17 +7,18 @@ add_library(ast
- printer.cpp
- semantic_analyser.cpp
- )
-+install(TARGETS bpftraceast LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-
--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)
-
- if (HAVE_BCC_KFUNC)
-- target_compile_definitions(ast PRIVATE HAVE_BCC_KFUNC)
-+ target_compile_definitions(bpftraceast PRIVATE HAVE_BCC_KFUNC)
- endif(HAVE_BCC_KFUNC)
-
--add_dependencies(ast parser)
-+add_dependencies(bpftraceast bpftraceparser)
-
- if (STATIC_LINKING)
- set(clang_libs
-@@ -41,17 +42,17 @@ 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 option 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()
-
- if(STATIC_LIBC)
-@@ -60,11 +61,11 @@ if (STATIC_LINKING)
- 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 4104a57..59486de 100644
---- a/tests/CMakeLists.txt
-+++ b/tests/CMakeLists.txt
-@@ -101,7 +101,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)
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2021-07-13 21:07 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2021-07-13 21:07 UTC (permalink / raw
To: gentoo-commits
commit: cf1ef9d692a509052c5ef64a6c34bec7000c4bf5
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 13 21:07:27 2021 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Jul 13 21:07:38 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf1ef9d6
dev-util/bpftrace-0.13.0-r1: revbump, install lib (bug #801472)
Closes: https://bugs.gentoo.org/801472
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
.../bpftrace/{bpftrace-0.13.0.ebuild => bpftrace-0.13.0-r1.ebuild} | 0
dev-util/bpftrace/files/bpftrace-0.13.0-install-libs.patch | 6 ++++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dev-util/bpftrace/bpftrace-0.13.0.ebuild b/dev-util/bpftrace/bpftrace-0.13.0-r1.ebuild
similarity index 100%
rename from dev-util/bpftrace/bpftrace-0.13.0.ebuild
rename to dev-util/bpftrace/bpftrace-0.13.0-r1.ebuild
diff --git a/dev-util/bpftrace/files/bpftrace-0.13.0-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.13.0-install-libs.patch
index 03fd2d13e60..fb75f9db1ba 100644
--- a/dev-util/bpftrace/files/bpftrace-0.13.0-install-libs.patch
+++ b/dev-util/bpftrace/files/bpftrace-0.13.0-install-libs.patch
@@ -52,10 +52,10 @@ index 0361cdaa..f9c536a3 100644
if (LIBBPF_BTF_DUMP_FOUND)
target_include_directories(libbpftrace PUBLIC ${LIBBPF_INCLUDE_DIRS})
diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt
-index 76bb217e..6d243a7e 100644
+index 76bb217e..4ad0f626 100644
--- a/src/arch/CMakeLists.txt
+++ b/src/arch/CMakeLists.txt
-@@ -1,15 +1,15 @@
+@@ -1,15 +1,17 @@
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
- add_library(arch aarch64.cpp)
+ add_library(bpftracearch aarch64.cpp)
@@ -76,6 +76,8 @@ index 76bb217e..6d243a7e 100644
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 5234388c..8b40faaa 100644
--- a/src/ast/CMakeLists.txt
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2021-10-26 17:53 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2021-10-26 17:53 UTC (permalink / raw
To: gentoo-commits
commit: 3a6dd727b27797569f9e9a9156691fe9487f3dcc
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Tue Oct 26 17:52:59 2021 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Oct 26 17:52:59 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a6dd727
dev-util/bpftrace-0.14.0: Version bump
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/Manifest | 1 +
dev-util/bpftrace/bpftrace-0.14.0.ebuild | 98 +++++++++++
.../files/bpftrace-0.14.0-dont-compress-man.patch | 45 +++++
.../files/bpftrace-0.14.0-install-libs.patch | 192 +++++++++++++++++++++
4 files changed, 336 insertions(+)
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest
index 6f80ffa13ad..62e26ac7c80 100644
--- a/dev-util/bpftrace/Manifest
+++ b/dev-util/bpftrace/Manifest
@@ -1,2 +1,3 @@
DIST bpftrace-0.12.1.tar.gz 938043 BLAKE2B 3599c21d2381265ab5a7a3c0bf142dc7f79acb66fbb4f54b4100d042c21fc3c9e86297522bfe46f82ad5edbc2203314a6b02ff7cc07552c778b0726e681cb993 SHA512 a578499668bd2eb7342689b6c0ef3db6ca263a971d8e6f1b9a68c502c27170d24ede212a0fc2a72263e72aff58924f488a5c80d447397503a08512dc47b63345
DIST bpftrace-0.13.0.tar.gz 952412 BLAKE2B 8e3f6f28b0c652e2257e1a970b80b87ba5ac5e94dc26719bffe16a0bbff48efc2b9ab5bc03e5fe4b764f5c9c3df16039d931f1f13c1f14327880838a373edacc SHA512 16b3f11c365cc7e306045a5cb6bcf6c66b92d746884f6587ce7cc4c76841b284757bff7b38b9838eb3db129e996e4f1b13afec34da57981362dadef8460816d0
+DIST bpftrace-0.14.0.tar.gz 991314 BLAKE2B 3222068d7f84c13f736197cef2d188fa31a25db6bd266afe5cbacb1c062155b5ebd5d0310fbad56c15574a795766a33b12624f0252b0bc0677bf05324f414df5 SHA512 78f2d9a4d54c0dda1947b924a828777b402befc3a05031b609da4d256907df1e64f946454a9be7317449f49706f02a881febc4e63d2ef2f4e76924ea19e36ddb
diff --git a/dev-util/bpftrace/bpftrace-0.14.0.ebuild b/dev-util/bpftrace/bpftrace-0.14.0.ebuild
new file mode 100644
index 00000000000..483f341c490
--- /dev/null
+++ b/dev-util/bpftrace/bpftrace-0.14.0.ebuild
@@ -0,0 +1,98 @@
+# Copyright 2019-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs llvm linux-info cmake
+
+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 ~x86"
+ BDEPEND="app-arch/xz-utils "
+fi
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="fuzzing test"
+
+COMMON_DEPEND="
+ dev-libs/libbpf:=
+ >=dev-util/bcc-0.13.0:=
+ dev-util/systemtap
+ >=sys-devel/llvm-6:=[llvm_targets_BPF(+)]
+ <=sys-devel/llvm-13:=[llvm_targets_BPF(+)]
+ <=sys-devel/clang-13:=
+ sys-libs/binutils-libs:=
+ virtual/libelf
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ dev-libs/cereal:=
+ test? ( dev-cpp/gtest )
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+"
+BDEPEND+="
+ >=dev-util/cmake-3.8
+ sys-devel/flex
+ sys-devel/bison
+"
+
+S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
+QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so"
+
+PATCHES=(
+ "${FILESDIR}/bpftrace-0.14.0-install-libs.patch"
+ "${FILESDIR}/bpftrace-0.14.0-dont-compress-man.patch"
+ "${FILESDIR}/bpftrace-0.11.4-old-kernels.patch"
+ "${FILESDIR}/bpftrace-0.12.0-fuzzing-build.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
+}
+
+pkg_setup() {
+ LLVM_MAX_SLOT=12 llvm_pkg_setup
+}
+
+src_prepare() {
+ cmake_src_prepare
+}
+
+src_configure() {
+ local -a mycmakeargs=(
+ -DSTATIC_LINKING:BOOL=OFF
+ -DBUILD_TESTING:BOOL=OFF
+ -DBUILD_FUZZ:BOOL=$(usex fuzzing)
+ -DENABLE_MAN:BOOL=OFF
+ )
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ doman man/man8/*.?
+}
diff --git a/dev-util/bpftrace/files/bpftrace-0.14.0-dont-compress-man.patch b/dev-util/bpftrace/files/bpftrace-0.14.0-dont-compress-man.patch
new file mode 100644
index 00000000000..30f3b4a7c46
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.14.0-dont-compress-man.patch
@@ -0,0 +1,45 @@
+diff --git a/man/adoc/CMakeLists.txt b/man/adoc/CMakeLists.txt
+index 6f785d9d..c046b79f 100644
+--- a/man/adoc/CMakeLists.txt
++++ b/man/adoc/CMakeLists.txt
+@@ -1,7 +1,5 @@
+-find_program(GZIP gzip REQUIRED)
+ find_program(ASCIIDOCTOR asciidoctor REQUIRED)
+ file(GLOB FILES *.adoc)
+-set(GZFILES "")
+ foreach(FIL ${FILES})
+ get_filename_component(NAME ${FIL} NAME_WE)
+ set(MANPAGE_FILE ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.8)
+@@ -10,12 +8,6 @@ foreach(FIL ${FILES})
+ add_custom_command(OUTPUT ${MANPAGE_FILE}
+ COMMAND ${ASCIIDOCTOR} ${FIL} -b manpage -o - > ${MANPAGE_FILE}
+ DEPENDS ${FIL})
+-
+- add_custom_command(OUTPUT ${GZ_MANPAGE_FILE}
+- COMMAND ${GZIP} -c ${MANPAGE_FILE} > ${GZ_MANPAGE_FILE}
+- DEPENDS ${MANPAGE_FILE})
+-
+- list(APPEND GZFILES ${GZ_MANPAGE_FILE})
+ endforeach()
+-add_custom_target(adoc_man DEPENDS ${GZFILES})
+-install(FILES ${GZFILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
++add_custom_target(adoc_man DEPENDS ${FILES})
++install(FILES ${FILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
+diff --git a/man/man8/CMakeLists.txt b/man/man8/CMakeLists.txt
+index 2a316cd9..2207cf80 100644
+--- a/man/man8/CMakeLists.txt
++++ b/man/man8/CMakeLists.txt
+@@ -1,12 +1,3 @@
+-find_program(GZIP gzip REQUIRED)
+ 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_man 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.14.0-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.14.0-install-libs.patch
new file mode 100644
index 00000000000..00d35c6f49e
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.14.0-install-libs.patch
@@ -0,0 +1,192 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ea334df0..53e4dc8e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -103,9 +103,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 a95c60a1..f5c4d676 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 47a050e2..1bbcf882 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -40,7 +40,7 @@ add_library(runtime
+ ${BFD_DISASM_SRC}
+ )
+ # Ensure flex+bison outputs are built first
+-add_dependencies(runtime parser)
++add_dependencies(runtime bpftraceparser)
+
+ add_library(libbpftrace
+ build_info.cpp
+@@ -57,6 +57,7 @@ add_executable(${BPFTRACE}
+ )
+
+ install(TARGETS ${BPFTRACE} DESTINATION ${CMAKE_INSTALL_BINDIR})
++install(TARGETS libbpftrace LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ target_link_libraries(${BPFTRACE} libbpftrace)
+
+ if (BUILD_FUZZ)
+@@ -109,6 +110,7 @@ target_include_directories(runtime PRIVATE ${CMAKE_BINARY_DIR})
+ target_include_directories(runtime PRIVATE ${CMAKE_SOURCE_DIR}/src)
+ target_include_directories(runtime PRIVATE ${CMAKE_SOURCE_DIR}/src/ast)
+ target_compile_definitions(runtime PRIVATE ${BPFTRACE_FLAGS})
++install(TARGETS runtime LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ target_compile_definitions(libbpftrace PRIVATE ${BPFTRACE_FLAGS})
+
+ # Linking
+@@ -121,7 +123,8 @@ if(STATIC_LINKING)
+ endif(STATIC_LINKING)
+
+
+-target_link_libraries(libbpftrace parser resources runtime aot ast arch cxxdemangler_llvm)
++target_link_libraries(libbpftrace bpftraceparser bpftraceresources
++ runtime aot bpftraceast bpftracearch cxxdemangler_llvm)
+
+ if (LIBBPF_BTF_DUMP_FOUND)
+ target_include_directories(runtime PUBLIC ${LIBBPF_INCLUDE_DIRS})
+diff --git a/src/aot/CMakeLists.txt b/src/aot/CMakeLists.txt
+index 291d53f2..308691ee 100644
+--- a/src/aot/CMakeLists.txt
++++ b/src/aot/CMakeLists.txt
+@@ -10,7 +10,7 @@ if(NOT LIBBCC_BPF_CONTAINS_RUNTIME)
+ endif()
+
+ add_executable(bpftrace-aotrt aot_main.cpp)
+-target_link_libraries(bpftrace-aotrt aot runtime arch ast_defs cxxdemangler_stdlib)
++target_link_libraries(bpftrace-aotrt aot runtime bpftracearch ast_defs cxxdemangler_stdlib)
+ install(TARGETS bpftrace-aotrt DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+ # Linking
+@@ -27,3 +27,4 @@ if(BUILD_ASAN)
+ target_compile_options(bpftrace-aotrt PUBLIC "-fsanitize=address")
+ target_link_options(bpftrace-aotrt PUBLIC "-fsanitize=address")
+ endif()
++install(TARGETS aot LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt
+index 76bb217e..4ad0f626 100644
+--- a/src/arch/CMakeLists.txt
++++ b/src/arch/CMakeLists.txt
+@@ -1,15 +1,17 @@
+ 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 "s390" OR
+ CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x")
+- add_library(arch s390.cpp)
++ add_library(bpftracearch s390.cpp)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+- add_library(arch x86_64.cpp)
++ add_library(bpftracearch x86_64.cpp)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "mips64")
+- add_library(arch mips64.cpp)
++ add_library(bpftracearch mips64.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 014295cd..b038aa18 100644
+--- a/src/ast/CMakeLists.txt
++++ b/src/ast/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ add_library(ast_defs ast.cpp)
+
+-add_library(ast
++add_library(bpftraceast
+ async_event_types.cpp
+ attachpoint_parser.cpp
+ int_parser.cpp
+@@ -20,11 +20,12 @@ add_library(ast
+ target_include_directories(ast_defs PUBLIC ${CMAKE_SOURCE_DIR}/src)
+ target_include_directories(ast_defs PUBLIC ${CMAKE_SOURCE_DIR}/src/ast)
+ target_include_directories(ast_defs PUBLIC ${CMAKE_BINARY_DIR})
+-target_link_libraries(ast ast_defs arch bpforc parser)
++target_link_libraries(bpftraceast ast_defs bpftracearch bpforc bpftraceparser)
++install(TARGETS ast_defs LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+-add_dependencies(ast_defs parser)
++add_dependencies(ast_defs bpftraceparser)
+
+-target_compile_definitions(ast PRIVATE ${BPFTRACE_FLAGS})
++target_compile_definitions(bpftraceast PRIVATE ${BPFTRACE_FLAGS})
+
+ if (STATIC_LINKING)
+ set(clang_libs
+@@ -55,11 +56,11 @@ if (STATIC_LINKING)
+
+
+ if(EMBED_USE_LLVM)
+- target_link_libraries(ast "-Wl,--start-group" ${CLANG_EMBEDDED_CMAKE_TARGETS} ${LLVM_EMBEDDED_CMAKE_TARGETS} "-Wl,--end-group")
++ target_link_libraries(bpftraceast "-Wl,--start-group" ${CLANG_EMBEDDED_CMAKE_TARGETS} ${LLVM_EMBEDDED_CMAKE_TARGETS} "-Wl,--end-group")
+ else()
+ llvm_map_components_to_libnames(llvm_libs ${llvm_lib_names})
+- 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()
+
+ if(STATIC_LIBC)
+@@ -69,13 +70,13 @@ if (STATIC_LINKING)
+ 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()
+
+ add_subdirectory(bpforc)
+diff --git a/src/ast/bpforc/CMakeLists.txt b/src/ast/bpforc/CMakeLists.txt
+index 3f6dbefa..8ccfbb2b 100644
+--- a/src/ast/bpforc/CMakeLists.txt
++++ b/src/ast/bpforc/CMakeLists.txt
+@@ -1 +1,2 @@
+ add_library(bpforc bpforc.cpp)
++install(TARGETS bpforc LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff --git a/src/cxxdemangler/CMakeLists.txt b/src/cxxdemangler/CMakeLists.txt
+index 04cfcdd9..5677aa4b 100644
+--- a/src/cxxdemangler/CMakeLists.txt
++++ b/src/cxxdemangler/CMakeLists.txt
+@@ -1,2 +1,4 @@
+ add_library(cxxdemangler_stdlib cxxdemangler_stdlib.cpp)
+ add_library(cxxdemangler_llvm cxxdemangler_llvm.cpp)
++install(TARGETS cxxdemangler_stdlib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
++install(TARGETS cxxdemangler_llvm LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2021-10-27 16:55 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2021-10-27 16:55 UTC (permalink / raw
To: gentoo-commits
commit: b09a22354f2e86e5e2605292b9b6d555699f33f7
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Wed Oct 27 01:18:33 2021 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Wed Oct 27 16:54:53 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b09a2235
dev-util/bpftrace: Fix patch to make sure libaot is installed
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
...trace-0.14.0-r1.ebuild => bpftrace-0.14.0-r2.ebuild} | 0
.../bpftrace/files/bpftrace-0.14.0-install-libs.patch | 17 ++++++++++-------
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/dev-util/bpftrace/bpftrace-0.14.0-r1.ebuild b/dev-util/bpftrace/bpftrace-0.14.0-r2.ebuild
similarity index 100%
rename from dev-util/bpftrace/bpftrace-0.14.0-r1.ebuild
rename to dev-util/bpftrace/bpftrace-0.14.0-r2.ebuild
diff --git a/dev-util/bpftrace/files/bpftrace-0.14.0-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.14.0-install-libs.patch
index dc8e8905260..2e2484a2efe 100644
--- a/dev-util/bpftrace/files/bpftrace-0.14.0-install-libs.patch
+++ b/dev-util/bpftrace/files/bpftrace-0.14.0-install-libs.patch
@@ -70,10 +70,18 @@ index 47a050e2..1bbcf882 100644
if (LIBBPF_BTF_DUMP_FOUND)
target_include_directories(runtime PUBLIC ${LIBBPF_INCLUDE_DIRS})
diff --git a/src/aot/CMakeLists.txt b/src/aot/CMakeLists.txt
-index 291d53f2..308691ee 100644
+index 291d53f2..22944ddc 100644
--- a/src/aot/CMakeLists.txt
+++ b/src/aot/CMakeLists.txt
-@@ -10,7 +10,7 @@ if(NOT LIBBCC_BPF_CONTAINS_RUNTIME)
+@@ -2,6 +2,7 @@ add_library(aot aot.cpp)
+ target_include_directories(aot PUBLIC ${CMAKE_SOURCE_DIR}/src)
+ target_include_directories(aot PUBLIC ${CMAKE_BINARY_DIR})
+ target_compile_definitions(aot PRIVATE ${BPFTRACE_FLAGS})
++install(TARGETS aot LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+ # Only build aotrt if supported bcc is used
+ # (https://github.com/iovisor/bcc/commit/719191867a25ce07dc96f7faf9b8ccedadc7ec44)
+@@ -10,7 +11,7 @@ if(NOT LIBBCC_BPF_CONTAINS_RUNTIME)
endif()
add_executable(bpftrace-aotrt aot_main.cpp)
@@ -82,11 +90,6 @@ index 291d53f2..308691ee 100644
install(TARGETS bpftrace-aotrt DESTINATION ${CMAKE_INSTALL_BINDIR})
# Linking
-@@ -27,3 +27,4 @@ if(BUILD_ASAN)
- target_compile_options(bpftrace-aotrt PUBLIC "-fsanitize=address")
- target_link_options(bpftrace-aotrt PUBLIC "-fsanitize=address")
- endif()
-+install(TARGETS aot LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt
index 76bb217e..4ad0f626 100644
--- a/src/arch/CMakeLists.txt
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2022-05-04 22:25 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2022-05-04 22:25 UTC (permalink / raw
To: gentoo-commits
commit: 5dc4f047ea705f0d1e30572184cc999ce3e45e9a
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Wed May 4 22:25:18 2022 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Wed May 4 22:25:36 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5dc4f047
dev-util/bpftrace: Revbump, add support for llvm-14
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/bpftrace-0.14.1-r1.ebuild | 93 +++
.../bpftrace/files/bpftrace-0.14.1-llvm14.patch | 813 +++++++++++++++++++++
2 files changed, 906 insertions(+)
diff --git a/dev-util/bpftrace/bpftrace-0.14.1-r1.ebuild b/dev-util/bpftrace/bpftrace-0.14.1-r1.ebuild
new file mode 100644
index 000000000000..9917c9712eb7
--- /dev/null
+++ b/dev-util/bpftrace/bpftrace-0.14.1-r1.ebuild
@@ -0,0 +1,93 @@
+# Copyright 2019-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+LLVM_MAX_SLOT=14
+
+inherit llvm linux-info cmake toolchain-funcs
+
+DESCRIPTION="High-level tracing language for eBPF"
+HOMEPAGE="https://github.com/iovisor/bpftrace"
+MY_PV="${PV//_/}"
+SRC_URI="https://github.com/iovisor/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="fuzzing test"
+# lots of fixing needed
+RESTRICT="test"
+
+RDEPEND="
+ dev-libs/libbpf:=
+ >=dev-util/bcc-0.13.0:=
+ dev-util/systemtap
+ <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):=
+ <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):=[llvm_targets_BPF(+)]
+ sys-libs/binutils-libs:=
+ virtual/libelf:=
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ dev-libs/cereal:=
+ test? ( dev-cpp/gtest )
+"
+BDEPEND="
+ sys-apps/sed
+ app-arch/xz-utils
+ sys-devel/flex
+ sys-devel/bison
+ virtual/pkgconfig
+"
+
+QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so"
+
+PATCHES=(
+ "${FILESDIR}/bpftrace-0.14.0-install-libs.patch"
+ "${FILESDIR}/bpftrace-0.14.0-dont-compress-man.patch"
+ "${FILESDIR}/bpftrace-0.14.0-fuzzing.patch"
+ "${FILESDIR}/bpftrace-0.11.4-old-kernels.patch"
+ "${FILESDIR}/bpftrace-0.12.0-fuzzing-build.patch"
+ "${FILESDIR}/bpftrace-0.14-libbpf-0.6.patch"
+ "${FILESDIR}/bpftrace-0.14.1-llvm14.patch"
+)
+
+pkg_pretend() {
+ local CONFIG_CHECK="
+ ~BPF
+ ~BPF_EVENTS
+ ~BPF_JIT
+ ~BPF_SYSCALL
+ ~FTRACE_SYSCALLS
+ ~HAVE_EBPF_JIT
+ "
+
+ check_extra_config
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+}
+
+src_configure() {
+ local -a mycmakeargs=(
+ -DSTATIC_LINKING:BOOL=OFF
+ # bug 809362, 754648
+ -DBUILD_SHARED_LIBS:=OFF
+ -DBUILD_TESTING:BOOL=OFF
+ -DBUILD_FUZZ:BOOL=$(usex fuzzing)
+ -DENABLE_MAN:BOOL=OFF
+ -DLIBBPF_INCLUDE_DIRS="$($(tc-getPKG_CONFIG) --cflags-only-I libbpf | sed 's:-I::g')"
+ )
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ # bug 809362
+ dostrip -x /usr/bin/bpftrace
+ doman man/man8/*.?
+}
diff --git a/dev-util/bpftrace/files/bpftrace-0.14.1-llvm14.patch b/dev-util/bpftrace/files/bpftrace-0.14.1-llvm14.patch
new file mode 100644
index 000000000000..d2f34ab62bfa
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.14.1-llvm14.patch
@@ -0,0 +1,813 @@
+commit 422847b71dc38d31d9b352b0058196bbe5a9e278
+Author: Viktor Malik <viktor.malik@gmail.com>
+Date: Mon Jan 10 16:41:05 2022 +0100
+
+ Fix LLVM 13 warnings
+
+ Since LLVM 13, CreateGEP and CreateLoad require explicit types.
+
+diff --git a/src/ast/irbuilderbpf.cpp b/src/ast/irbuilderbpf.cpp
+index f6d2d2c1..890e75f4 100644
+--- a/src/ast/irbuilderbpf.cpp
++++ b/src/ast/irbuilderbpf.cpp
+@@ -95,8 +95,8 @@ AllocaInst *IRBuilderBPF::CreateUSym(llvm::Value *val)
+ Value *pid = CreateLShr(CreateGetPidTgid(), 32);
+
+ // The extra 0 here ensures the type of addr_offset will be int64
+- Value *addr_offset = CreateGEP(buf, { getInt64(0), getInt32(0) });
+- Value *pid_offset = CreateGEP(buf, { getInt64(0), getInt32(1) });
++ Value *addr_offset = CreateGEP(usym_t, buf, { getInt64(0), getInt32(0) });
++ Value *pid_offset = CreateGEP(usym_t, buf, { getInt64(0), getInt32(1) });
+
+ CreateStore(val, addr_offset);
+ CreateStore(pid, pid_offset);
+@@ -402,7 +402,8 @@ Value *IRBuilderBPF::CreateMapLookupElem(Value *ctx,
+ if (needMemcpy(type))
+ return value;
+
+- Value *ret = CreateLoad(value);
++ // value is a pointer to i64
++ Value *ret = CreateLoad(getInt64Ty(), value);
+ CreateLifetimeEnd(value);
+ return ret;
+ }
+@@ -622,7 +623,10 @@ Value *IRBuilderBPF::CreateUSDTReadArgument(Value *ctx,
+ // bpftrace's args are internally represented as 64 bit integers. However,
+ // the underlying argument (of the target program) may be less than 64
+ // bits. So we must be careful to zero out unused bits.
+- Value* reg = CreateGEP(ctx, getInt64(offset * sizeof(uintptr_t)), "load_register");
++ Value *reg = CreateGEP(getInt8Ty(),
++ ctx,
++ getInt64(offset * sizeof(uintptr_t)),
++ "load_register");
+ AllocaInst *dst = CreateAllocaBPF(builtin.type, builtin.ident);
+ Value *index_offset = nullptr;
+ if (argument->valid & BCC_USDT_ARGUMENT_INDEX_REGISTER_NAME)
+@@ -633,7 +637,8 @@ Value *IRBuilderBPF::CreateUSDTReadArgument(Value *ctx,
+ LOG(FATAL) << "offset for register " << argument->index_register_name
+ << " not known";
+ }
+- index_offset = CreateGEP(ctx,
++ index_offset = CreateGEP(getInt8Ty(),
++ ctx,
+ getInt64(ioffset * sizeof(uintptr_t)),
+ "load_register");
+ index_offset = CreateLoad(getInt64Ty(), index_offset);
+@@ -757,17 +762,18 @@ Value *IRBuilderBPF::CreateStrncmp(Value *val1,
+ else
+ literal2 = std::nullopt;
+
++ auto *val1p = dyn_cast<PointerType>(val1->getType());
++ auto *val2p = dyn_cast<PointerType>(val2->getType());
+ #ifndef NDEBUG
+ if (!literal1)
+ {
+- PointerType *val1p = cast<PointerType>(val1->getType());
++ assert(val1p);
+ assert(val1p->getElementType()->isArrayTy() &&
+ val1p->getElementType()->getArrayElementType() == getInt8Ty());
+ }
+ if (!literal2)
+ {
+- PointerType *val2p = cast<PointerType>(val2->getType());
+-
++ assert(val2p);
+ assert(val2p->getElementType()->isArrayTy() &&
+ val2p->getElementType()->getArrayElementType() == getInt8Ty());
+ }
+@@ -799,7 +805,9 @@ Value *IRBuilderBPF::CreateStrncmp(Value *val1,
+ l = getInt8(literal1->c_str()[i]);
+ else
+ {
+- auto *ptr_l = CreateGEP(val1, { getInt32(0), getInt32(i) });
++ auto *ptr_l = CreateGEP(val1p->getElementType(),
++ val1,
++ { getInt32(0), getInt32(i) });
+ l = CreateLoad(getInt8Ty(), ptr_l);
+ }
+
+@@ -808,7 +816,9 @@ Value *IRBuilderBPF::CreateStrncmp(Value *val1,
+ r = getInt8(literal2->c_str()[i]);
+ else
+ {
+- auto *ptr_r = CreateGEP(val2, { getInt32(0), getInt32(i) });
++ auto *ptr_r = CreateGEP(val2p->getElementType(),
++ val2,
++ { getInt32(0), getInt32(i) });
+ r = CreateLoad(getInt8Ty(), ptr_r);
+ }
+
+@@ -830,7 +840,8 @@ Value *IRBuilderBPF::CreateStrncmp(Value *val1,
+ CreateBr(str_ne);
+ SetInsertPoint(str_ne);
+
+- Value *result = CreateLoad(store);
++ // store is a pointer to bool (i1 *)
++ Value *result = CreateLoad(getInt1Ty(), store);
+ CreateLifetimeEnd(store);
+ result = CreateIntCast(result, getInt64Ty(), false);
+
+@@ -1057,9 +1068,10 @@ Value *IRBuilderBPF::CreatKFuncArg(Value *ctx,
+ {
+ assert(type.IsIntTy() || type.IsPtrTy());
+ ctx = CreatePointerCast(ctx, getInt64Ty()->getPointerTo());
+- Value *expr = CreateLoad(GetType(type),
+- CreateGEP(ctx, getInt64(type.funcarg_idx)),
+- name);
++ Value *expr = CreateLoad(
++ GetType(type),
++ CreateGEP(getInt64Ty(), ctx, getInt64(type.funcarg_idx)),
++ name);
+
+ // LLVM 7.0 <= does not have CreateLoad(*Ty, *Ptr, isVolatile, Name),
+ // so call setVolatile() manually
+@@ -1082,7 +1094,7 @@ Value *IRBuilderBPF::CreateRegisterRead(Value *ctx, const std::string &builtin)
+ // `(uint8*)ctx`, but sometimes this causes invalid context access.
+ // Mark every context access to suppress any LLVM optimization.
+ Value *result = CreateLoad(getInt64Ty(),
+- CreateGEP(ctx_ptr, getInt64(offset)),
++ CreateGEP(getInt64Ty(), ctx_ptr, getInt64(offset)),
+ builtin);
+ // LLVM 7.0 <= does not have CreateLoad(*Ty, *Ptr, isVolatile, Name),
+ // so call setVolatile() manually
+@@ -1135,12 +1147,15 @@ void IRBuilderBPF::CreateHelperError(Value *ctx,
+ elements,
+ true);
+ AllocaInst *buf = CreateAllocaBPF(helper_error_struct, "helper_error_t");
+- CreateStore(GetIntSameSize(asyncactionint(AsyncAction::helper_error),
+- elements.at(0)),
+- CreateGEP(buf, { getInt64(0), getInt32(0) }));
+- CreateStore(GetIntSameSize(error_id, elements.at(1)),
+- CreateGEP(buf, { getInt64(0), getInt32(1) }));
+- CreateStore(return_value, CreateGEP(buf, { getInt64(0), getInt32(2) }));
++ CreateStore(
++ GetIntSameSize(asyncactionint(AsyncAction::helper_error), elements.at(0)),
++ CreateGEP(helper_error_struct, buf, { getInt64(0), getInt32(0) }));
++ CreateStore(
++ GetIntSameSize(error_id, elements.at(1)),
++ CreateGEP(helper_error_struct, buf, { getInt64(0), getInt32(1) }));
++ CreateStore(
++ return_value,
++ CreateGEP(helper_error_struct, buf, { getInt64(0), getInt32(2) }));
+
+ auto &layout = module_.getDataLayout();
+ auto struct_size = layout.getTypeAllocSize(helper_error_struct);
+@@ -1230,11 +1245,13 @@ void IRBuilderBPF::CreateSeqPrintf(Value *ctx,
+
+ ctx = CreatePointerCast(ctx, getInt8Ty()->getPointerTo());
+ Value *meta = CreateLoad(getInt64Ty()->getPointerTo(),
+- CreateGEP(ctx, getInt64(0)),
++ CreateGEP(getInt8Ty(), ctx, getInt64(0)),
+ "meta");
+ dyn_cast<LoadInst>(meta)->setVolatile(true);
+
+- Value *seq = CreateLoad(getInt64Ty(), CreateGEP(meta, getInt64(0)), "seq");
++ Value *seq = CreateLoad(getInt64Ty(),
++ CreateGEP(getInt64Ty(), meta, getInt64(0)),
++ "seq");
+
+ CallInst *call = createCall(seq_printf_func,
+ { seq, fmt, fmt_size, data, data_len },
+diff --git a/src/ast/passes/codegen_llvm.cpp b/src/ast/passes/codegen_llvm.cpp
+index 5495f64c..28c65c4c 100644
+--- a/src/ast/passes/codegen_llvm.cpp
++++ b/src/ast/passes/codegen_llvm.cpp
+@@ -235,16 +235,17 @@ void CodegenLLVM::visit(Builtin &builtin)
+
+ int arg_num = atoi(builtin.ident.substr(4).c_str());
+ Value *ctx = b_.CreatePointerCast(ctx_, b_.getInt64Ty()->getPointerTo());
+- Value *sp = b_.CreateLoad(b_.getInt64Ty(),
+- b_.CreateGEP(ctx, b_.getInt64(sp_offset)),
+- "reg_sp");
++ Value *sp = b_.CreateLoad(
++ b_.getInt64Ty(),
++ b_.CreateGEP(b_.getInt64Ty(), ctx, b_.getInt64(sp_offset)),
++ "reg_sp");
+ dyn_cast<LoadInst>(sp)->setVolatile(true);
+ AllocaInst *dst = b_.CreateAllocaBPF(builtin.type, builtin.ident);
+ Value *src = b_.CreateAdd(sp,
+ b_.getInt64((arg_num + arch::arg_stack_offset()) *
+ sizeof(uintptr_t)));
+ b_.CreateProbeRead(ctx_, dst, 8, src, builtin.type.GetAS(), builtin.loc);
+- expr_ = b_.CreateLoad(dst);
++ expr_ = b_.CreateLoad(b_.GetType(builtin.type), dst);
+ b_.CreateLifetimeEnd(dst);
+ }
+ else if (builtin.ident == "probe")
+@@ -512,8 +513,12 @@ void CodegenLLVM::visit(Call &call)
+ b_.CREATE_MEMSET(buf, b_.getInt8(0), bpftrace_.strlen_, 1);
+ auto arg0 = call.vargs->front();
+ auto scoped_del = accept(call.vargs->front());
+- b_.CreateProbeReadStr(
+- ctx_, buf, b_.CreateLoad(strlen), expr_, arg0->type.GetAS(), call.loc);
++ b_.CreateProbeReadStr(ctx_,
++ buf,
++ b_.CreateLoad(b_.getInt64Ty(), strlen),
++ expr_,
++ arg0->type.GetAS(),
++ call.loc);
+ b_.CreateLifetimeEnd(strlen);
+
+ expr_ = buf;
+@@ -555,12 +560,14 @@ void CodegenLLVM::visit(Call &call)
+ false);
+ AllocaInst *buf = b_.CreateAllocaBPF(buf_struct, "buffer");
+
+- Value *buf_len_offset = b_.CreateGEP(buf,
++ Value *buf_len_offset = b_.CreateGEP(buf_struct,
++ buf,
+ { b_.getInt32(0), b_.getInt32(0) });
+ length = b_.CreateIntCast(length, buf_struct->getElementType(0), false);
+ b_.CreateStore(length, buf_len_offset);
+
+- Value *buf_data_offset = b_.CreateGEP(buf,
++ Value *buf_data_offset = b_.CreateGEP(buf_struct,
++ buf,
+ { b_.getInt32(0), b_.getInt32(1) });
+ b_.CREATE_MEMSET(buf_data_offset,
+ b_.GetIntSameSize(0, elements.at(0)),
+@@ -653,14 +660,14 @@ void CodegenLLVM::visit(Call &call)
+ b_.SetInsertPoint(notzero);
+ b_.CreateStore(b_.getInt64(asyncactionint(AsyncAction::join)), perfdata);
+ b_.CreateStore(b_.getInt64(join_id_),
+- b_.CreateGEP(perfdata, b_.getInt64(8)));
++ b_.CreateGEP(b_.getInt8Ty(), perfdata, b_.getInt64(8)));
+ join_id_++;
+ AllocaInst *arr = b_.CreateAllocaBPF(b_.getInt64Ty(), call.func + "_r0");
+ b_.CreateProbeRead(ctx_, arr, 8, expr_, addrspace, call.loc);
+ b_.CreateProbeReadStr(ctx_,
+ b_.CreateAdd(perfdata, b_.getInt64(8 + 8)),
+ bpftrace_.join_argsize_,
+- b_.CreateLoad(arr),
++ b_.CreateLoad(b_.getInt64Ty(), arr),
+ addrspace,
+ call.loc);
+
+@@ -668,14 +675,18 @@ void CodegenLLVM::visit(Call &call)
+ {
+ // argi
+ b_.CreateStore(b_.CreateAdd(expr_, b_.getInt64(8 * i)), first);
+- b_.CreateProbeRead(
+- ctx_, second, 8, b_.CreateLoad(first), addrspace, call.loc);
++ b_.CreateProbeRead(ctx_,
++ second,
++ 8,
++ b_.CreateLoad(b_.getInt64Ty(), first),
++ addrspace,
++ call.loc);
+ b_.CreateProbeReadStr(
+ ctx_,
+ b_.CreateAdd(perfdata,
+ b_.getInt64(8 + 8 + i * bpftrace_.join_argsize_)),
+ bpftrace_.join_argsize_,
+- b_.CreateLoad(second),
++ b_.CreateLoad(b_.getInt64Ty(), second),
+ addrspace,
+ call.loc);
+ }
+@@ -718,7 +729,9 @@ void CodegenLLVM::visit(Call &call)
+
+ AllocaInst *buf = b_.CreateAllocaBPF(inet_struct, "inet");
+
+- Value *af_offset = b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) });
++ Value *af_offset = b_.CreateGEP(inet_struct,
++ buf,
++ { b_.getInt64(0), b_.getInt32(0) });
+ Value *af_type;
+
+ auto inet = call.vargs->at(0);
+@@ -741,7 +754,9 @@ void CodegenLLVM::visit(Call &call)
+ }
+ b_.CreateStore(af_type, af_offset);
+
+- Value *inet_offset = b_.CreateGEP(buf, {b_.getInt32(0), b_.getInt32(1)});
++ Value *inet_offset = b_.CreateGEP(inet_struct,
++ buf,
++ { b_.getInt32(0), b_.getInt32(1) });
+ b_.CREATE_MEMSET(inet_offset, b_.getInt8(0), 16, 1);
+
+ auto scoped_del = accept(inet);
+@@ -774,9 +789,10 @@ void CodegenLLVM::visit(Call &call)
+ }
+
+ Value *ctx = b_.CreatePointerCast(ctx_, b_.getInt64Ty()->getPointerTo());
+- expr_ = b_.CreateLoad(b_.getInt64Ty(),
+- b_.CreateGEP(ctx, b_.getInt64(offset)),
+- call.func + "_" + reg_name);
++ expr_ = b_.CreateLoad(
++ b_.getInt64Ty(),
++ b_.CreateGEP(b_.getInt64Ty(), ctx, b_.getInt64(offset)),
++ call.func + "_" + reg_name);
+ dyn_cast<LoadInst>(expr_)->setVolatile(true);
+ }
+ else if (call.func == "printf")
+@@ -801,8 +817,10 @@ void CodegenLLVM::visit(Call &call)
+ auto scoped_del = accept(&arg);
+
+ // and store it to data area
+- Value *offset = b_.CreateGEP(
+- data, { b_.getInt64(0), b_.getInt64((i - 1) * ptr_size) });
++ Value *offset = b_.CreateGEP(b_.GetType(data_type),
++ data,
++ { b_.getInt64(0),
++ b_.getInt64((i - 1) * ptr_size) });
+ b_.CreateStore(expr_, offset);
+
+ // keep the expression alive, so it's still there
+@@ -890,7 +908,9 @@ void CodegenLLVM::visit(Call &call)
+ AllocaInst *buf = b_.CreateAllocaBPF(event_struct,
+ call.func + "_" + map.ident);
+
+- auto aa_ptr = b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) });
++ auto aa_ptr = b_.CreateGEP(event_struct,
++ buf,
++ { b_.getInt64(0), b_.getInt32(0) });
+ if (call.func == "clear")
+ b_.CreateStore(b_.GetIntSameSize(asyncactionint(AsyncAction::clear),
+ elements.at(0)),
+@@ -901,7 +921,9 @@ void CodegenLLVM::visit(Call &call)
+ aa_ptr);
+
+ auto id = bpftrace_.maps[map.ident].value()->id;
+- auto *ident_ptr = b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(1) });
++ auto *ident_ptr = b_.CreateGEP(event_struct,
++ buf,
++ { b_.getInt64(0), b_.getInt32(1) });
+ b_.CreateStore(b_.GetIntSameSize(id, elements.at(1)), ident_ptr);
+
+ b_.CreatePerfEventOutput(ctx_, buf, getStructSize(event_struct));
+@@ -917,12 +939,13 @@ void CodegenLLVM::visit(Call &call)
+
+ AllocaInst *buf = b_.CreateAllocaBPF(time_struct, call.func + "_t");
+
+- b_.CreateStore(b_.GetIntSameSize(asyncactionint(AsyncAction::time),
+- elements.at(0)),
+- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) }));
++ b_.CreateStore(
++ b_.GetIntSameSize(asyncactionint(AsyncAction::time), elements.at(0)),
++ b_.CreateGEP(time_struct, buf, { b_.getInt64(0), b_.getInt32(0) }));
+
+- b_.CreateStore(b_.GetIntSameSize(time_id_, elements.at(1)),
+- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(1) }));
++ b_.CreateStore(
++ b_.GetIntSameSize(time_id_, elements.at(1)),
++ b_.CreateGEP(time_struct, buf, { b_.getInt64(0), b_.getInt32(1) }));
+
+ time_id_++;
+ b_.CreatePerfEventOutput(ctx_, buf, getStructSize(time_struct));
+@@ -937,13 +960,15 @@ void CodegenLLVM::visit(Call &call)
+ true);
+
+ AllocaInst *buf = b_.CreateAllocaBPF(strftime_struct, call.func + "_args");
+- b_.CreateStore(b_.GetIntSameSize(strftime_id_, elements.at(0)),
+- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) }));
++ b_.CreateStore(
++ b_.GetIntSameSize(strftime_id_, elements.at(0)),
++ b_.CreateGEP(strftime_struct, buf, { b_.getInt64(0), b_.getInt32(0) }));
+ strftime_id_++;
+ Expression *arg = call.vargs->at(1);
+ auto scoped_del = accept(arg);
+- b_.CreateStore(expr_,
+- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(1) }));
++ b_.CreateStore(
++ expr_,
++ b_.CreateGEP(strftime_struct, buf, { b_.getInt64(0), b_.getInt32(1) }));
+ expr_ = buf;
+ }
+ else if (call.func == "kstack" || call.func == "ustack")
+@@ -1027,11 +1052,12 @@ void CodegenLLVM::visit(Call &call)
+ AllocaInst *buf = b_.CreateAllocaBPF(unwatch_struct, "unwatch");
+ size_t struct_size = datalayout().getTypeAllocSize(unwatch_struct);
+
+- b_.CreateStore(b_.getInt64(asyncactionint(AsyncAction::watchpoint_detach)),
+- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) }));
++ b_.CreateStore(
++ b_.getInt64(asyncactionint(AsyncAction::watchpoint_detach)),
++ b_.CreateGEP(unwatch_struct, buf, { b_.getInt64(0), b_.getInt32(0) }));
+ b_.CreateStore(
+ b_.CreateIntCast(expr_, b_.getInt64Ty(), false /* unsigned */),
+- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(1) }));
++ b_.CreateGEP(unwatch_struct, buf, { b_.getInt64(0), b_.getInt32(1) }));
+ b_.CreatePerfEventOutput(ctx_, buf, struct_size);
+ b_.CreateLifetimeEnd(buf);
+ expr_ = nullptr;
+@@ -1061,7 +1087,8 @@ void CodegenLLVM::visit(Variable &var)
+ }
+ else
+ {
+- expr_ = b_.CreateLoad(variables_[var.ident]);
++ auto *var_alloca = variables_[var.ident];
++ expr_ = b_.CreateLoad(var_alloca->getType()->getElementType(), var_alloca);
+ }
+ }
+
+@@ -1384,9 +1411,10 @@ void CodegenLLVM::unop_int(Unop &unop)
+ int size = type.GetSize();
+ auto as = type.GetAS();
+
+- AllocaInst *dst = b_.CreateAllocaBPF(SizedType(type.type, size), "deref");
++ auto dst_type = SizedType(type.type, size);
++ AllocaInst *dst = b_.CreateAllocaBPF(dst_type, "deref");
+ b_.CreateProbeRead(ctx_, dst, size, expr_, as, unop.loc);
+- expr_ = b_.CreateIntCast(b_.CreateLoad(dst),
++ expr_ = b_.CreateIntCast(b_.CreateLoad(b_.GetType(dst_type), dst),
+ b_.getInt64Ty(),
+ type.IsSigned());
+ b_.CreateLifetimeEnd(dst);
+@@ -1410,7 +1438,7 @@ void CodegenLLVM::unop_ptr(Unop &unop)
+ int size = unop.type.IsIntegerTy() ? et->GetIntBitWidth() / 8 : 8;
+ AllocaInst *dst = b_.CreateAllocaBPF(*et, "deref");
+ b_.CreateProbeRead(ctx_, dst, size, expr_, type.GetAS(), unop.loc);
+- expr_ = b_.CreateIntCast(b_.CreateLoad(dst),
++ expr_ = b_.CreateIntCast(b_.CreateLoad(b_.GetType(*et), dst),
+ b_.getInt64Ty(),
+ unop.type.IsSigned());
+ b_.CreateLifetimeEnd(dst);
+@@ -1489,7 +1517,7 @@ void CodegenLLVM::visit(Ternary &ternary)
+ b_.CreateBr(done);
+
+ b_.SetInsertPoint(done);
+- expr_ = b_.CreateLoad(result);
++ expr_ = b_.CreateLoad(b_.GetType(ternary.type), result);
+ }
+ else if (ternary.type.IsStringTy())
+ {
+@@ -1552,7 +1580,8 @@ void CodegenLLVM::visit(FieldAccess &acc)
+ }
+ else if (type.IsTupleTy())
+ {
+- Value *src = b_.CreateGEP(expr_,
++ Value *src = b_.CreateGEP(b_.GetType(type),
++ expr_,
+ { b_.getInt32(0), b_.getInt32(acc.index) });
+ SizedType &elem_type = type.GetFields()[acc.index].type;
+
+@@ -1599,10 +1628,12 @@ void CodegenLLVM::visit(FieldAccess &acc)
+ if (field.is_bitfield)
+ {
+ Value *raw;
++ auto field_type = b_.GetType(field.type);
+ if (type.IsCtxAccess())
+- raw = b_.CreateLoad(
+- b_.CreateIntToPtr(src, b_.GetType(field.type)->getPointerTo()),
+- true);
++ raw = b_.CreateLoad(field_type,
++ b_.CreateIntToPtr(src,
++ field_type->getPointerTo()),
++ true);
+ else
+ {
+ AllocaInst *dst = b_.CreateAllocaBPF(field.type,
+@@ -1613,7 +1644,7 @@ void CodegenLLVM::visit(FieldAccess &acc)
+ b_.CREATE_MEMSET(dst, b_.getInt8(0), field.type.GetSize(), 1);
+ b_.CreateProbeRead(
+ ctx_, dst, field.bitfield.read_bytes, src, type.GetAS(), acc.loc);
+- raw = b_.CreateLoad(dst);
++ raw = b_.CreateLoad(field_type, dst);
+ b_.CreateLifetimeEnd(dst);
+ }
+ size_t rshiftbits;
+@@ -1641,7 +1672,8 @@ void CodegenLLVM::visit(FieldAccess &acc)
+ // offset which we add to the start of the tracepoint struct.
+ expr_ = b_.CreateLoad(
+ b_.getInt32Ty(),
+- b_.CreateGEP(b_.CreatePointerCast(ctx_,
++ b_.CreateGEP(b_.getInt32Ty(),
++ b_.CreatePointerCast(ctx_,
+ b_.getInt32Ty()->getPointerTo()),
+ b_.getInt64(field.offset / 4)));
+ expr_ = b_.CreateIntCast(expr_, b_.getInt64Ty(), false);
+@@ -1760,7 +1792,9 @@ void CodegenLLVM::visit(Tuple &tuple)
+ Expression *elem = tuple.elems->at(i);
+ auto scoped_del = accept(elem);
+
+- Value *dst = b_.CreateGEP(buf, { b_.getInt32(0), b_.getInt32(i) });
++ Value *dst = b_.CreateGEP(tuple_ty,
++ buf,
++ { b_.getInt32(0), b_.getInt32(i) });
+
+ if (onStack(elem->type))
+ b_.CREATE_MEMCPY(dst, expr_, elem->type.GetSize(), 1);
+@@ -2411,6 +2445,7 @@ AllocaInst *CodegenLLVM::getMultiMapKey(Map &map,
+ size += key_type.GetSize();
+ }
+ AllocaInst *key = b_.CreateAllocaBPF(size, map.ident + "_key");
++ auto *key_type = ArrayType::get(b_.getInt8Ty(), size);
+
+ int offset = 0;
+ bool aligned = true;
+@@ -2419,7 +2454,8 @@ AllocaInst *CodegenLLVM::getMultiMapKey(Map &map,
+ for (Expression *expr : *map.vargs)
+ {
+ auto scoped_del = accept(expr);
+- Value *offset_val = b_.CreateGEP(key,
++ Value *offset_val = b_.CreateGEP(key_type,
++ key,
+ { b_.getInt64(0), b_.getInt64(offset) });
+ size_t map_key_size = map.key_type.args_[i++].GetSize();
+
+@@ -2464,7 +2500,8 @@ AllocaInst *CodegenLLVM::getMultiMapKey(Map &map,
+
+ for (auto *extra_key : extra_keys)
+ {
+- Value *offset_val = b_.CreateGEP(key,
++ Value *offset_val = b_.CreateGEP(key_type,
++ key,
+ { b_.getInt64(0), b_.getInt64(offset) });
+ if (aligned)
+ b_.CreateStore(extra_key, offset_val);
+@@ -2521,7 +2558,7 @@ Value *CodegenLLVM::createLogicalAnd(Binop &binop)
+ b_.CreateBr(merge_block);
+
+ b_.SetInsertPoint(merge_block);
+- return b_.CreateLoad(result);
++ return b_.CreateLoad(b_.getInt64Ty(), result);
+ }
+
+ Value *CodegenLLVM::createLogicalOr(Binop &binop)
+@@ -2560,7 +2597,7 @@ Value *CodegenLLVM::createLogicalOr(Binop &binop)
+ b_.CreateBr(merge_block);
+
+ b_.SetInsertPoint(merge_block);
+- return b_.CreateLoad(result);
++ return b_.CreateLoad(b_.getInt64Ty(), result);
+ }
+
+ Function *CodegenLLVM::createLog2Function()
+@@ -2604,34 +2641,37 @@ Function *CodegenLLVM::createLog2Function()
+ // test for less than zero
+ BasicBlock *is_less_than_zero = BasicBlock::Create(module_->getContext(), "hist.is_less_than_zero", log2_func);
+ BasicBlock *is_not_less_than_zero = BasicBlock::Create(module_->getContext(), "hist.is_not_less_than_zero", log2_func);
+- b_.CreateCondBr(b_.CreateICmpSLT(b_.CreateLoad(n_alloc), b_.getInt64(0)),
++ b_.CreateCondBr(b_.CreateICmpSLT(b_.CreateLoad(b_.getInt64Ty(), n_alloc),
++ b_.getInt64(0)),
+ is_less_than_zero,
+ is_not_less_than_zero);
+ b_.SetInsertPoint(is_less_than_zero);
+- createRet(b_.CreateLoad(result));
++ createRet(b_.CreateLoad(b_.getInt64Ty(), result));
+ b_.SetInsertPoint(is_not_less_than_zero);
+
+ // test for equal to zero
+ BasicBlock *is_zero = BasicBlock::Create(module_->getContext(), "hist.is_zero", log2_func);
+ BasicBlock *is_not_zero = BasicBlock::Create(module_->getContext(), "hist.is_not_zero", log2_func);
+- b_.CreateCondBr(b_.CreateICmpEQ(b_.CreateLoad(n_alloc), b_.getInt64(0)),
++ b_.CreateCondBr(b_.CreateICmpEQ(b_.CreateLoad(b_.getInt64Ty(), n_alloc),
++ b_.getInt64(0)),
+ is_zero,
+ is_not_zero);
+ b_.SetInsertPoint(is_zero);
+ b_.CreateStore(b_.getInt64(1), result);
+- createRet(b_.CreateLoad(result));
++ createRet(b_.CreateLoad(b_.getInt64Ty(), result));
+ b_.SetInsertPoint(is_not_zero);
+
+ // power-of-2 index, offset by +2
+ b_.CreateStore(b_.getInt64(2), result);
+ for (int i = 4; i >= 0; i--)
+ {
+- Value *n = b_.CreateLoad(n_alloc);
++ Value *n = b_.CreateLoad(b_.getInt64Ty(), n_alloc);
+ Value *shift = b_.CreateShl(b_.CreateIntCast(b_.CreateICmpSGE(b_.CreateIntCast(n, b_.getInt64Ty(), false), b_.getInt64(1 << (1<<i))), b_.getInt64Ty(), false), i);
+ b_.CreateStore(b_.CreateLShr(n, shift), n_alloc);
+- b_.CreateStore(b_.CreateAdd(b_.CreateLoad(result), shift), result);
++ b_.CreateStore(b_.CreateAdd(b_.CreateLoad(b_.getInt64Ty(), result), shift),
++ result);
+ }
+- createRet(b_.CreateLoad(result));
++ createRet(b_.CreateLoad(b_.getInt64Ty(), result));
+ b_.restoreIP(ip);
+ return module_->getFunction("log2");
+ }
+@@ -2681,8 +2721,8 @@ Function *CodegenLLVM::createLinearFunction()
+
+ // algorithm
+ {
+- Value *min = b_.CreateLoad(min_alloc);
+- Value *val = b_.CreateLoad(value_alloc);
++ Value *min = b_.CreateLoad(b_.getInt64Ty(), min_alloc);
++ Value *val = b_.CreateLoad(b_.getInt64Ty(), value_alloc);
+ cmp = b_.CreateICmpSLT(val, min);
+ }
+ BasicBlock *lt_min = BasicBlock::Create(module_->getContext(), "lhist.lt_min", linear_func);
+@@ -2694,8 +2734,8 @@ Function *CodegenLLVM::createLinearFunction()
+
+ b_.SetInsertPoint(ge_min);
+ {
+- Value *max = b_.CreateLoad(max_alloc);
+- Value *val = b_.CreateLoad(value_alloc);
++ Value *max = b_.CreateLoad(b_.getInt64Ty(), max_alloc);
++ Value *val = b_.CreateLoad(b_.getInt64Ty(), value_alloc);
+ cmp = b_.CreateICmpSGT(val, max);
+ }
+ BasicBlock *le_max = BasicBlock::Create(module_->getContext(), "lhist.le_max", linear_func);
+@@ -2704,22 +2744,22 @@ Function *CodegenLLVM::createLinearFunction()
+
+ b_.SetInsertPoint(gt_max);
+ {
+- Value *step = b_.CreateLoad(step_alloc);
+- Value *min = b_.CreateLoad(min_alloc);
+- Value *max = b_.CreateLoad(max_alloc);
++ Value *step = b_.CreateLoad(b_.getInt64Ty(), step_alloc);
++ Value *min = b_.CreateLoad(b_.getInt64Ty(), min_alloc);
++ Value *max = b_.CreateLoad(b_.getInt64Ty(), max_alloc);
+ Value *div = b_.CreateUDiv(b_.CreateSub(max, min), step);
+ b_.CreateStore(b_.CreateAdd(div, b_.getInt64(1)), result_alloc);
+- createRet(b_.CreateLoad(result_alloc));
++ createRet(b_.CreateLoad(b_.getInt64Ty(), result_alloc));
+ }
+
+ b_.SetInsertPoint(le_max);
+ {
+- Value *step = b_.CreateLoad(step_alloc);
+- Value *min = b_.CreateLoad(min_alloc);
+- Value *val = b_.CreateLoad(value_alloc);
++ Value *step = b_.CreateLoad(b_.getInt64Ty(), step_alloc);
++ Value *min = b_.CreateLoad(b_.getInt64Ty(), min_alloc);
++ Value *val = b_.CreateLoad(b_.getInt64Ty(), value_alloc);
+ Value *div3 = b_.CreateUDiv(b_.CreateSub(val, min), step);
+ b_.CreateStore(b_.CreateAdd(div3, b_.getInt64(1)), result_alloc);
+- createRet(b_.CreateLoad(result_alloc));
++ createRet(b_.CreateLoad(b_.getInt64Ty(), result_alloc));
+ }
+
+ b_.restoreIP(ip);
+@@ -2773,14 +2813,18 @@ void CodegenLLVM::createFormatStringCall(Call &call, int &id, CallArgs &call_arg
+ // as the struct is not packed we need to memset it.
+ b_.CREATE_MEMSET(fmt_args, b_.getInt8(0), struct_size, 1);
+
+- Value *id_offset = b_.CreateGEP(fmt_args, {b_.getInt32(0), b_.getInt32(0)});
++ Value *id_offset = b_.CreateGEP(fmt_struct,
++ fmt_args,
++ { b_.getInt32(0), b_.getInt32(0) });
+ b_.CreateStore(b_.getInt64(id + asyncactionint(async_action)), id_offset);
+
+ for (size_t i=1; i<call.vargs->size(); i++)
+ {
+ Expression &arg = *call.vargs->at(i);
+ auto scoped_del = accept(&arg);
+- Value *offset = b_.CreateGEP(fmt_args, {b_.getInt32(0), b_.getInt32(i)});
++ Value *offset = b_.CreateGEP(fmt_struct,
++ fmt_args,
++ { b_.getInt32(0), b_.getInt32(i) });
+ if (needMemcpy(arg.type))
+ b_.CREATE_MEMCPY(offset, expr_, arg.type.GetSize(), 1);
+ else if (arg.type.IsIntegerTy() && arg.type.GetSize() < 8)
+@@ -2820,10 +2864,12 @@ void CodegenLLVM::generateWatchpointSetupProbe(
+ // Pull out function argument
+ Value *ctx = func->arg_begin();
+ int offset = arch::arg_offset(arg_num);
+- Value *addr = b_.CreateLoad(
+- b_.getInt64Ty(),
+- b_.CreateGEP(ctx, b_.getInt64(offset * sizeof(uintptr_t))),
+- "arg" + std::to_string(arg_num));
++ Value *arg = b_.CreateGEP(b_.getInt8Ty(),
++ ctx,
++ b_.getInt64(offset * sizeof(uintptr_t)));
++ Value *addr = b_.CreateLoad(b_.getInt64Ty(),
++ arg,
++ "arg" + std::to_string(arg_num));
+
+ // Tell userspace to setup the real watchpoint
+ auto elements = AsyncEvent::Watchpoint().asLLVMType(b_);
+@@ -2834,12 +2880,16 @@ void CodegenLLVM::generateWatchpointSetupProbe(
+ size_t struct_size = datalayout().getTypeAllocSize(watchpoint_struct);
+
+ // Fill in perf event struct
+- b_.CreateStore(b_.getInt64(asyncactionint(AsyncAction::watchpoint_attach)),
+- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) }));
+- b_.CreateStore(b_.getInt64(watchpoint_id_),
+- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(1) }));
++ b_.CreateStore(
++ b_.getInt64(asyncactionint(AsyncAction::watchpoint_attach)),
++ b_.CreateGEP(watchpoint_struct, buf, { b_.getInt64(0), b_.getInt32(0) }));
++ b_.CreateStore(
++ b_.getInt64(watchpoint_id_),
++ b_.CreateGEP(watchpoint_struct, buf, { b_.getInt64(0), b_.getInt32(1) }));
+ watchpoint_id_++;
+- b_.CreateStore(addr, b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(2) }));
++ b_.CreateStore(
++ addr,
++ b_.CreateGEP(watchpoint_struct, buf, { b_.getInt64(0), b_.getInt32(2) }));
+ b_.CreatePerfEventOutput(ctx, buf, struct_size);
+ b_.CreateLifetimeEnd(buf);
+
+@@ -2858,11 +2908,14 @@ void CodegenLLVM::createPrintMapCall(Call &call)
+ call.func + "_" + map.ident);
+
+ // store asyncactionid:
+- b_.CreateStore(b_.getInt64(asyncactionint(AsyncAction::print)),
+- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) }));
++ b_.CreateStore(
++ b_.getInt64(asyncactionint(AsyncAction::print)),
++ b_.CreateGEP(print_struct, buf, { b_.getInt64(0), b_.getInt32(0) }));
+
+ auto id = bpftrace_.maps[map.ident].value()->id;
+- auto *ident_ptr = b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(1) });
++ auto *ident_ptr = b_.CreateGEP(print_struct,
++ buf,
++ { b_.getInt64(0), b_.getInt32(1) });
+ b_.CreateStore(b_.GetIntSameSize(id, elements.at(1)), ident_ptr);
+
+ // top, div
+@@ -2874,14 +2927,16 @@ void CodegenLLVM::createPrintMapCall(Call &call)
+ auto scoped_del = accept(call.vargs->at(arg_idx));
+
+ b_.CreateStore(b_.CreateIntCast(expr_, elements.at(arg_idx), false),
+- b_.CreateGEP(buf,
++ b_.CreateGEP(print_struct,
++ buf,
+ { b_.getInt64(0), b_.getInt32(arg_idx + 1) }));
+ }
+
+ for (; arg_idx < 3; arg_idx++)
+ {
+ b_.CreateStore(b_.GetIntSameSize(0, elements.at(arg_idx)),
+- b_.CreateGEP(buf,
++ b_.CreateGEP(print_struct,
++ buf,
+ { b_.getInt64(0), b_.getInt32(arg_idx + 1) }));
+ }
+
+@@ -2906,15 +2961,19 @@ void CodegenLLVM::createPrintNonMapCall(Call &call, int &id)
+ size_t struct_size = datalayout().getTypeAllocSize(print_struct);
+
+ // Store asyncactionid:
+- b_.CreateStore(b_.getInt64(asyncactionint(AsyncAction::print_non_map)),
+- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) }));
++ b_.CreateStore(
++ b_.getInt64(asyncactionint(AsyncAction::print_non_map)),
++ b_.CreateGEP(print_struct, buf, { b_.getInt64(0), b_.getInt32(0) }));
+
+ // Store print id
+- b_.CreateStore(b_.getInt64(id),
+- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(1) }));
++ b_.CreateStore(
++ b_.getInt64(id),
++ b_.CreateGEP(print_struct, buf, { b_.getInt64(0), b_.getInt32(1) }));
+
+ // Store content
+- Value *content_offset = b_.CreateGEP(buf, { b_.getInt32(0), b_.getInt32(2) });
++ Value *content_offset = b_.CreateGEP(print_struct,
++ buf,
++ { b_.getInt32(0), b_.getInt32(2) });
+ b_.CREATE_MEMSET(content_offset, b_.getInt8(0), arg.type.GetSize(), 1);
+ if (needMemcpy(arg.type))
+ {
+@@ -3085,7 +3144,9 @@ void CodegenLLVM::readDatastructElemFromStack(Value *src_data,
+ src_data = b_.CreateIntToPtr(src_data,
+ b_.GetType(data_type)->getPointerTo());
+
+- Value *src = b_.CreateGEP(src_data, { b_.getInt32(0), index });
++ Value *src = b_.CreateGEP(b_.GetType(data_type),
++ src_data,
++ { b_.getInt32(0), index });
+
+ // It may happen that the result pointer type is not correct, in such case
+ // do a typecast
+@@ -3096,7 +3157,7 @@ void CodegenLLVM::readDatastructElemFromStack(Value *src_data,
+ if (elem_type.IsIntegerTy() || elem_type.IsPtrTy())
+ {
+ // Load the correct type from src
+- expr_ = b_.CreateLoad(src, true);
++ expr_ = b_.CreateLoad(b_.GetType(elem_type), src, true);
+ }
+ else
+ {
+@@ -3150,7 +3211,8 @@ void CodegenLLVM::probereadDatastructElem(Value *src_data,
+ // Read data onto stack
+ if (data_type.IsCtxAccess())
+ {
+- expr_ = b_.CreateLoad(b_.CreateIntToPtr(src, dst_type->getPointerTo()),
++ expr_ = b_.CreateLoad(dst_type,
++ b_.CreateIntToPtr(src, dst_type->getPointerTo()),
+ true);
+ expr_ = b_.CreateIntCast(expr_, b_.getInt64Ty(), elem_type.IsSigned());
+
+@@ -3181,7 +3243,7 @@ void CodegenLLVM::probereadDatastructElem(Value *src_data,
+ AllocaInst *dst = b_.CreateAllocaBPF(elem_type, temp_name);
+ b_.CreateProbeRead(
+ ctx_, dst, elem_type.GetSize(), src, data_type.GetAS(), loc);
+- expr_ = b_.CreateIntCast(b_.CreateLoad(dst),
++ expr_ = b_.CreateIntCast(b_.CreateLoad(b_.GetType(elem_type), dst),
+ b_.getInt64Ty(),
+ elem_type.IsSigned());
+ b_.CreateLifetimeEnd(dst);
+@@ -3212,13 +3274,15 @@ void CodegenLLVM::createIncDec(Unop &unop)
+ if (unop.is_post_op)
+ expr_ = oldval;
+ else
+- expr_ = b_.CreateLoad(newval);
++ expr_ = b_.CreateLoad(b_.GetType(map.type), newval);
+ b_.CreateLifetimeEnd(newval);
+ }
+ else if (unop.expr->is_variable)
+ {
+ Variable &var = static_cast<Variable &>(*unop.expr);
+- Value *oldval = b_.CreateLoad(variables_[var.ident]);
++ Value *oldval = b_.CreateLoad(
++ variables_[var.ident]->getType()->getElementType(),
++ variables_[var.ident]);
+ Value *newval;
+ if (is_increment)
+ newval = b_.CreateAdd(oldval, b_.GetIntSameSize(step, oldval));
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2022-05-04 22:43 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2022-05-04 22:43 UTC (permalink / raw
To: gentoo-commits
commit: a601b8787b0ad44663bf96ee465dcf5d0ae3a918
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Wed May 4 22:43:18 2022 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Wed May 4 22:43:24 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a601b878
dev-util/bpftrace: update SRC_URI
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/Manifest | 1 +
dev-util/bpftrace/bpftrace-0.14.1-r1.ebuild | 7 +-
.../bpftrace/files/bpftrace-0.14.1-llvm14.patch | 813 ---------------------
3 files changed, 6 insertions(+), 815 deletions(-)
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest
index 649995620651..1c4b3ff288a4 100644
--- a/dev-util/bpftrace/Manifest
+++ b/dev-util/bpftrace/Manifest
@@ -1 +1,2 @@
+DIST bpftrace-0.14.1-llvm14.patch.gz 7377 BLAKE2B 69b3b74bce74a8d4d8d9cc74de352dc33875ae905d8a88c776bbe80862a4f4ac2d450bcb6190da8be880bcc8fb751e3b8172df5454f31dc4bcd3e41edb02e396 SHA512 3269132981a7d2c0263fe9003bbcd2348e186ca0cdc95ada368331fc6e2495ae126c7bd68676438ccb575aafdafa3d17604a28fdc11d8b629eeaee130c1fd614
DIST bpftrace-0.14.1.tar.gz 991481 BLAKE2B 832f213760eb86804d63df782ff1923f6355b63770b8c4d486dd2547ae3dc474f9e4923f3107bbefbf2066dc013c930d4765ef86ef4d10bda6757513e30c2de1 SHA512 0be06c209ba12f70a0d1140b168dac94945c1b034dbd0c7dae5460fca43eec10bb436e28c122ec37b259256bf6b9bb23a3c5e7f8435feb67eae1b9277debaf73
diff --git a/dev-util/bpftrace/bpftrace-0.14.1-r1.ebuild b/dev-util/bpftrace/bpftrace-0.14.1-r1.ebuild
index 9917c9712eb7..f8e1dddbd01e 100644
--- a/dev-util/bpftrace/bpftrace-0.14.1-r1.ebuild
+++ b/dev-util/bpftrace/bpftrace-0.14.1-r1.ebuild
@@ -10,7 +10,10 @@ inherit llvm linux-info cmake toolchain-funcs
DESCRIPTION="High-level tracing language for eBPF"
HOMEPAGE="https://github.com/iovisor/bpftrace"
MY_PV="${PV//_/}"
-SRC_URI="https://github.com/iovisor/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+SRC_URI="
+ https://github.com/iovisor/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz
+ https://dev.gentoo.org/~chutzpah/dist/bpftrace/bpftrace-0.14.1-llvm14.patch.gz
+"
S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
LICENSE="Apache-2.0"
@@ -51,7 +54,7 @@ PATCHES=(
"${FILESDIR}/bpftrace-0.11.4-old-kernels.patch"
"${FILESDIR}/bpftrace-0.12.0-fuzzing-build.patch"
"${FILESDIR}/bpftrace-0.14-libbpf-0.6.patch"
- "${FILESDIR}/bpftrace-0.14.1-llvm14.patch"
+ "${WORKDIR}/bpftrace-0.14.1-llvm14.patch"
)
pkg_pretend() {
diff --git a/dev-util/bpftrace/files/bpftrace-0.14.1-llvm14.patch b/dev-util/bpftrace/files/bpftrace-0.14.1-llvm14.patch
deleted file mode 100644
index d2f34ab62bfa..000000000000
--- a/dev-util/bpftrace/files/bpftrace-0.14.1-llvm14.patch
+++ /dev/null
@@ -1,813 +0,0 @@
-commit 422847b71dc38d31d9b352b0058196bbe5a9e278
-Author: Viktor Malik <viktor.malik@gmail.com>
-Date: Mon Jan 10 16:41:05 2022 +0100
-
- Fix LLVM 13 warnings
-
- Since LLVM 13, CreateGEP and CreateLoad require explicit types.
-
-diff --git a/src/ast/irbuilderbpf.cpp b/src/ast/irbuilderbpf.cpp
-index f6d2d2c1..890e75f4 100644
---- a/src/ast/irbuilderbpf.cpp
-+++ b/src/ast/irbuilderbpf.cpp
-@@ -95,8 +95,8 @@ AllocaInst *IRBuilderBPF::CreateUSym(llvm::Value *val)
- Value *pid = CreateLShr(CreateGetPidTgid(), 32);
-
- // The extra 0 here ensures the type of addr_offset will be int64
-- Value *addr_offset = CreateGEP(buf, { getInt64(0), getInt32(0) });
-- Value *pid_offset = CreateGEP(buf, { getInt64(0), getInt32(1) });
-+ Value *addr_offset = CreateGEP(usym_t, buf, { getInt64(0), getInt32(0) });
-+ Value *pid_offset = CreateGEP(usym_t, buf, { getInt64(0), getInt32(1) });
-
- CreateStore(val, addr_offset);
- CreateStore(pid, pid_offset);
-@@ -402,7 +402,8 @@ Value *IRBuilderBPF::CreateMapLookupElem(Value *ctx,
- if (needMemcpy(type))
- return value;
-
-- Value *ret = CreateLoad(value);
-+ // value is a pointer to i64
-+ Value *ret = CreateLoad(getInt64Ty(), value);
- CreateLifetimeEnd(value);
- return ret;
- }
-@@ -622,7 +623,10 @@ Value *IRBuilderBPF::CreateUSDTReadArgument(Value *ctx,
- // bpftrace's args are internally represented as 64 bit integers. However,
- // the underlying argument (of the target program) may be less than 64
- // bits. So we must be careful to zero out unused bits.
-- Value* reg = CreateGEP(ctx, getInt64(offset * sizeof(uintptr_t)), "load_register");
-+ Value *reg = CreateGEP(getInt8Ty(),
-+ ctx,
-+ getInt64(offset * sizeof(uintptr_t)),
-+ "load_register");
- AllocaInst *dst = CreateAllocaBPF(builtin.type, builtin.ident);
- Value *index_offset = nullptr;
- if (argument->valid & BCC_USDT_ARGUMENT_INDEX_REGISTER_NAME)
-@@ -633,7 +637,8 @@ Value *IRBuilderBPF::CreateUSDTReadArgument(Value *ctx,
- LOG(FATAL) << "offset for register " << argument->index_register_name
- << " not known";
- }
-- index_offset = CreateGEP(ctx,
-+ index_offset = CreateGEP(getInt8Ty(),
-+ ctx,
- getInt64(ioffset * sizeof(uintptr_t)),
- "load_register");
- index_offset = CreateLoad(getInt64Ty(), index_offset);
-@@ -757,17 +762,18 @@ Value *IRBuilderBPF::CreateStrncmp(Value *val1,
- else
- literal2 = std::nullopt;
-
-+ auto *val1p = dyn_cast<PointerType>(val1->getType());
-+ auto *val2p = dyn_cast<PointerType>(val2->getType());
- #ifndef NDEBUG
- if (!literal1)
- {
-- PointerType *val1p = cast<PointerType>(val1->getType());
-+ assert(val1p);
- assert(val1p->getElementType()->isArrayTy() &&
- val1p->getElementType()->getArrayElementType() == getInt8Ty());
- }
- if (!literal2)
- {
-- PointerType *val2p = cast<PointerType>(val2->getType());
--
-+ assert(val2p);
- assert(val2p->getElementType()->isArrayTy() &&
- val2p->getElementType()->getArrayElementType() == getInt8Ty());
- }
-@@ -799,7 +805,9 @@ Value *IRBuilderBPF::CreateStrncmp(Value *val1,
- l = getInt8(literal1->c_str()[i]);
- else
- {
-- auto *ptr_l = CreateGEP(val1, { getInt32(0), getInt32(i) });
-+ auto *ptr_l = CreateGEP(val1p->getElementType(),
-+ val1,
-+ { getInt32(0), getInt32(i) });
- l = CreateLoad(getInt8Ty(), ptr_l);
- }
-
-@@ -808,7 +816,9 @@ Value *IRBuilderBPF::CreateStrncmp(Value *val1,
- r = getInt8(literal2->c_str()[i]);
- else
- {
-- auto *ptr_r = CreateGEP(val2, { getInt32(0), getInt32(i) });
-+ auto *ptr_r = CreateGEP(val2p->getElementType(),
-+ val2,
-+ { getInt32(0), getInt32(i) });
- r = CreateLoad(getInt8Ty(), ptr_r);
- }
-
-@@ -830,7 +840,8 @@ Value *IRBuilderBPF::CreateStrncmp(Value *val1,
- CreateBr(str_ne);
- SetInsertPoint(str_ne);
-
-- Value *result = CreateLoad(store);
-+ // store is a pointer to bool (i1 *)
-+ Value *result = CreateLoad(getInt1Ty(), store);
- CreateLifetimeEnd(store);
- result = CreateIntCast(result, getInt64Ty(), false);
-
-@@ -1057,9 +1068,10 @@ Value *IRBuilderBPF::CreatKFuncArg(Value *ctx,
- {
- assert(type.IsIntTy() || type.IsPtrTy());
- ctx = CreatePointerCast(ctx, getInt64Ty()->getPointerTo());
-- Value *expr = CreateLoad(GetType(type),
-- CreateGEP(ctx, getInt64(type.funcarg_idx)),
-- name);
-+ Value *expr = CreateLoad(
-+ GetType(type),
-+ CreateGEP(getInt64Ty(), ctx, getInt64(type.funcarg_idx)),
-+ name);
-
- // LLVM 7.0 <= does not have CreateLoad(*Ty, *Ptr, isVolatile, Name),
- // so call setVolatile() manually
-@@ -1082,7 +1094,7 @@ Value *IRBuilderBPF::CreateRegisterRead(Value *ctx, const std::string &builtin)
- // `(uint8*)ctx`, but sometimes this causes invalid context access.
- // Mark every context access to suppress any LLVM optimization.
- Value *result = CreateLoad(getInt64Ty(),
-- CreateGEP(ctx_ptr, getInt64(offset)),
-+ CreateGEP(getInt64Ty(), ctx_ptr, getInt64(offset)),
- builtin);
- // LLVM 7.0 <= does not have CreateLoad(*Ty, *Ptr, isVolatile, Name),
- // so call setVolatile() manually
-@@ -1135,12 +1147,15 @@ void IRBuilderBPF::CreateHelperError(Value *ctx,
- elements,
- true);
- AllocaInst *buf = CreateAllocaBPF(helper_error_struct, "helper_error_t");
-- CreateStore(GetIntSameSize(asyncactionint(AsyncAction::helper_error),
-- elements.at(0)),
-- CreateGEP(buf, { getInt64(0), getInt32(0) }));
-- CreateStore(GetIntSameSize(error_id, elements.at(1)),
-- CreateGEP(buf, { getInt64(0), getInt32(1) }));
-- CreateStore(return_value, CreateGEP(buf, { getInt64(0), getInt32(2) }));
-+ CreateStore(
-+ GetIntSameSize(asyncactionint(AsyncAction::helper_error), elements.at(0)),
-+ CreateGEP(helper_error_struct, buf, { getInt64(0), getInt32(0) }));
-+ CreateStore(
-+ GetIntSameSize(error_id, elements.at(1)),
-+ CreateGEP(helper_error_struct, buf, { getInt64(0), getInt32(1) }));
-+ CreateStore(
-+ return_value,
-+ CreateGEP(helper_error_struct, buf, { getInt64(0), getInt32(2) }));
-
- auto &layout = module_.getDataLayout();
- auto struct_size = layout.getTypeAllocSize(helper_error_struct);
-@@ -1230,11 +1245,13 @@ void IRBuilderBPF::CreateSeqPrintf(Value *ctx,
-
- ctx = CreatePointerCast(ctx, getInt8Ty()->getPointerTo());
- Value *meta = CreateLoad(getInt64Ty()->getPointerTo(),
-- CreateGEP(ctx, getInt64(0)),
-+ CreateGEP(getInt8Ty(), ctx, getInt64(0)),
- "meta");
- dyn_cast<LoadInst>(meta)->setVolatile(true);
-
-- Value *seq = CreateLoad(getInt64Ty(), CreateGEP(meta, getInt64(0)), "seq");
-+ Value *seq = CreateLoad(getInt64Ty(),
-+ CreateGEP(getInt64Ty(), meta, getInt64(0)),
-+ "seq");
-
- CallInst *call = createCall(seq_printf_func,
- { seq, fmt, fmt_size, data, data_len },
-diff --git a/src/ast/passes/codegen_llvm.cpp b/src/ast/passes/codegen_llvm.cpp
-index 5495f64c..28c65c4c 100644
---- a/src/ast/passes/codegen_llvm.cpp
-+++ b/src/ast/passes/codegen_llvm.cpp
-@@ -235,16 +235,17 @@ void CodegenLLVM::visit(Builtin &builtin)
-
- int arg_num = atoi(builtin.ident.substr(4).c_str());
- Value *ctx = b_.CreatePointerCast(ctx_, b_.getInt64Ty()->getPointerTo());
-- Value *sp = b_.CreateLoad(b_.getInt64Ty(),
-- b_.CreateGEP(ctx, b_.getInt64(sp_offset)),
-- "reg_sp");
-+ Value *sp = b_.CreateLoad(
-+ b_.getInt64Ty(),
-+ b_.CreateGEP(b_.getInt64Ty(), ctx, b_.getInt64(sp_offset)),
-+ "reg_sp");
- dyn_cast<LoadInst>(sp)->setVolatile(true);
- AllocaInst *dst = b_.CreateAllocaBPF(builtin.type, builtin.ident);
- Value *src = b_.CreateAdd(sp,
- b_.getInt64((arg_num + arch::arg_stack_offset()) *
- sizeof(uintptr_t)));
- b_.CreateProbeRead(ctx_, dst, 8, src, builtin.type.GetAS(), builtin.loc);
-- expr_ = b_.CreateLoad(dst);
-+ expr_ = b_.CreateLoad(b_.GetType(builtin.type), dst);
- b_.CreateLifetimeEnd(dst);
- }
- else if (builtin.ident == "probe")
-@@ -512,8 +513,12 @@ void CodegenLLVM::visit(Call &call)
- b_.CREATE_MEMSET(buf, b_.getInt8(0), bpftrace_.strlen_, 1);
- auto arg0 = call.vargs->front();
- auto scoped_del = accept(call.vargs->front());
-- b_.CreateProbeReadStr(
-- ctx_, buf, b_.CreateLoad(strlen), expr_, arg0->type.GetAS(), call.loc);
-+ b_.CreateProbeReadStr(ctx_,
-+ buf,
-+ b_.CreateLoad(b_.getInt64Ty(), strlen),
-+ expr_,
-+ arg0->type.GetAS(),
-+ call.loc);
- b_.CreateLifetimeEnd(strlen);
-
- expr_ = buf;
-@@ -555,12 +560,14 @@ void CodegenLLVM::visit(Call &call)
- false);
- AllocaInst *buf = b_.CreateAllocaBPF(buf_struct, "buffer");
-
-- Value *buf_len_offset = b_.CreateGEP(buf,
-+ Value *buf_len_offset = b_.CreateGEP(buf_struct,
-+ buf,
- { b_.getInt32(0), b_.getInt32(0) });
- length = b_.CreateIntCast(length, buf_struct->getElementType(0), false);
- b_.CreateStore(length, buf_len_offset);
-
-- Value *buf_data_offset = b_.CreateGEP(buf,
-+ Value *buf_data_offset = b_.CreateGEP(buf_struct,
-+ buf,
- { b_.getInt32(0), b_.getInt32(1) });
- b_.CREATE_MEMSET(buf_data_offset,
- b_.GetIntSameSize(0, elements.at(0)),
-@@ -653,14 +660,14 @@ void CodegenLLVM::visit(Call &call)
- b_.SetInsertPoint(notzero);
- b_.CreateStore(b_.getInt64(asyncactionint(AsyncAction::join)), perfdata);
- b_.CreateStore(b_.getInt64(join_id_),
-- b_.CreateGEP(perfdata, b_.getInt64(8)));
-+ b_.CreateGEP(b_.getInt8Ty(), perfdata, b_.getInt64(8)));
- join_id_++;
- AllocaInst *arr = b_.CreateAllocaBPF(b_.getInt64Ty(), call.func + "_r0");
- b_.CreateProbeRead(ctx_, arr, 8, expr_, addrspace, call.loc);
- b_.CreateProbeReadStr(ctx_,
- b_.CreateAdd(perfdata, b_.getInt64(8 + 8)),
- bpftrace_.join_argsize_,
-- b_.CreateLoad(arr),
-+ b_.CreateLoad(b_.getInt64Ty(), arr),
- addrspace,
- call.loc);
-
-@@ -668,14 +675,18 @@ void CodegenLLVM::visit(Call &call)
- {
- // argi
- b_.CreateStore(b_.CreateAdd(expr_, b_.getInt64(8 * i)), first);
-- b_.CreateProbeRead(
-- ctx_, second, 8, b_.CreateLoad(first), addrspace, call.loc);
-+ b_.CreateProbeRead(ctx_,
-+ second,
-+ 8,
-+ b_.CreateLoad(b_.getInt64Ty(), first),
-+ addrspace,
-+ call.loc);
- b_.CreateProbeReadStr(
- ctx_,
- b_.CreateAdd(perfdata,
- b_.getInt64(8 + 8 + i * bpftrace_.join_argsize_)),
- bpftrace_.join_argsize_,
-- b_.CreateLoad(second),
-+ b_.CreateLoad(b_.getInt64Ty(), second),
- addrspace,
- call.loc);
- }
-@@ -718,7 +729,9 @@ void CodegenLLVM::visit(Call &call)
-
- AllocaInst *buf = b_.CreateAllocaBPF(inet_struct, "inet");
-
-- Value *af_offset = b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) });
-+ Value *af_offset = b_.CreateGEP(inet_struct,
-+ buf,
-+ { b_.getInt64(0), b_.getInt32(0) });
- Value *af_type;
-
- auto inet = call.vargs->at(0);
-@@ -741,7 +754,9 @@ void CodegenLLVM::visit(Call &call)
- }
- b_.CreateStore(af_type, af_offset);
-
-- Value *inet_offset = b_.CreateGEP(buf, {b_.getInt32(0), b_.getInt32(1)});
-+ Value *inet_offset = b_.CreateGEP(inet_struct,
-+ buf,
-+ { b_.getInt32(0), b_.getInt32(1) });
- b_.CREATE_MEMSET(inet_offset, b_.getInt8(0), 16, 1);
-
- auto scoped_del = accept(inet);
-@@ -774,9 +789,10 @@ void CodegenLLVM::visit(Call &call)
- }
-
- Value *ctx = b_.CreatePointerCast(ctx_, b_.getInt64Ty()->getPointerTo());
-- expr_ = b_.CreateLoad(b_.getInt64Ty(),
-- b_.CreateGEP(ctx, b_.getInt64(offset)),
-- call.func + "_" + reg_name);
-+ expr_ = b_.CreateLoad(
-+ b_.getInt64Ty(),
-+ b_.CreateGEP(b_.getInt64Ty(), ctx, b_.getInt64(offset)),
-+ call.func + "_" + reg_name);
- dyn_cast<LoadInst>(expr_)->setVolatile(true);
- }
- else if (call.func == "printf")
-@@ -801,8 +817,10 @@ void CodegenLLVM::visit(Call &call)
- auto scoped_del = accept(&arg);
-
- // and store it to data area
-- Value *offset = b_.CreateGEP(
-- data, { b_.getInt64(0), b_.getInt64((i - 1) * ptr_size) });
-+ Value *offset = b_.CreateGEP(b_.GetType(data_type),
-+ data,
-+ { b_.getInt64(0),
-+ b_.getInt64((i - 1) * ptr_size) });
- b_.CreateStore(expr_, offset);
-
- // keep the expression alive, so it's still there
-@@ -890,7 +908,9 @@ void CodegenLLVM::visit(Call &call)
- AllocaInst *buf = b_.CreateAllocaBPF(event_struct,
- call.func + "_" + map.ident);
-
-- auto aa_ptr = b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) });
-+ auto aa_ptr = b_.CreateGEP(event_struct,
-+ buf,
-+ { b_.getInt64(0), b_.getInt32(0) });
- if (call.func == "clear")
- b_.CreateStore(b_.GetIntSameSize(asyncactionint(AsyncAction::clear),
- elements.at(0)),
-@@ -901,7 +921,9 @@ void CodegenLLVM::visit(Call &call)
- aa_ptr);
-
- auto id = bpftrace_.maps[map.ident].value()->id;
-- auto *ident_ptr = b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(1) });
-+ auto *ident_ptr = b_.CreateGEP(event_struct,
-+ buf,
-+ { b_.getInt64(0), b_.getInt32(1) });
- b_.CreateStore(b_.GetIntSameSize(id, elements.at(1)), ident_ptr);
-
- b_.CreatePerfEventOutput(ctx_, buf, getStructSize(event_struct));
-@@ -917,12 +939,13 @@ void CodegenLLVM::visit(Call &call)
-
- AllocaInst *buf = b_.CreateAllocaBPF(time_struct, call.func + "_t");
-
-- b_.CreateStore(b_.GetIntSameSize(asyncactionint(AsyncAction::time),
-- elements.at(0)),
-- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) }));
-+ b_.CreateStore(
-+ b_.GetIntSameSize(asyncactionint(AsyncAction::time), elements.at(0)),
-+ b_.CreateGEP(time_struct, buf, { b_.getInt64(0), b_.getInt32(0) }));
-
-- b_.CreateStore(b_.GetIntSameSize(time_id_, elements.at(1)),
-- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(1) }));
-+ b_.CreateStore(
-+ b_.GetIntSameSize(time_id_, elements.at(1)),
-+ b_.CreateGEP(time_struct, buf, { b_.getInt64(0), b_.getInt32(1) }));
-
- time_id_++;
- b_.CreatePerfEventOutput(ctx_, buf, getStructSize(time_struct));
-@@ -937,13 +960,15 @@ void CodegenLLVM::visit(Call &call)
- true);
-
- AllocaInst *buf = b_.CreateAllocaBPF(strftime_struct, call.func + "_args");
-- b_.CreateStore(b_.GetIntSameSize(strftime_id_, elements.at(0)),
-- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) }));
-+ b_.CreateStore(
-+ b_.GetIntSameSize(strftime_id_, elements.at(0)),
-+ b_.CreateGEP(strftime_struct, buf, { b_.getInt64(0), b_.getInt32(0) }));
- strftime_id_++;
- Expression *arg = call.vargs->at(1);
- auto scoped_del = accept(arg);
-- b_.CreateStore(expr_,
-- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(1) }));
-+ b_.CreateStore(
-+ expr_,
-+ b_.CreateGEP(strftime_struct, buf, { b_.getInt64(0), b_.getInt32(1) }));
- expr_ = buf;
- }
- else if (call.func == "kstack" || call.func == "ustack")
-@@ -1027,11 +1052,12 @@ void CodegenLLVM::visit(Call &call)
- AllocaInst *buf = b_.CreateAllocaBPF(unwatch_struct, "unwatch");
- size_t struct_size = datalayout().getTypeAllocSize(unwatch_struct);
-
-- b_.CreateStore(b_.getInt64(asyncactionint(AsyncAction::watchpoint_detach)),
-- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) }));
-+ b_.CreateStore(
-+ b_.getInt64(asyncactionint(AsyncAction::watchpoint_detach)),
-+ b_.CreateGEP(unwatch_struct, buf, { b_.getInt64(0), b_.getInt32(0) }));
- b_.CreateStore(
- b_.CreateIntCast(expr_, b_.getInt64Ty(), false /* unsigned */),
-- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(1) }));
-+ b_.CreateGEP(unwatch_struct, buf, { b_.getInt64(0), b_.getInt32(1) }));
- b_.CreatePerfEventOutput(ctx_, buf, struct_size);
- b_.CreateLifetimeEnd(buf);
- expr_ = nullptr;
-@@ -1061,7 +1087,8 @@ void CodegenLLVM::visit(Variable &var)
- }
- else
- {
-- expr_ = b_.CreateLoad(variables_[var.ident]);
-+ auto *var_alloca = variables_[var.ident];
-+ expr_ = b_.CreateLoad(var_alloca->getType()->getElementType(), var_alloca);
- }
- }
-
-@@ -1384,9 +1411,10 @@ void CodegenLLVM::unop_int(Unop &unop)
- int size = type.GetSize();
- auto as = type.GetAS();
-
-- AllocaInst *dst = b_.CreateAllocaBPF(SizedType(type.type, size), "deref");
-+ auto dst_type = SizedType(type.type, size);
-+ AllocaInst *dst = b_.CreateAllocaBPF(dst_type, "deref");
- b_.CreateProbeRead(ctx_, dst, size, expr_, as, unop.loc);
-- expr_ = b_.CreateIntCast(b_.CreateLoad(dst),
-+ expr_ = b_.CreateIntCast(b_.CreateLoad(b_.GetType(dst_type), dst),
- b_.getInt64Ty(),
- type.IsSigned());
- b_.CreateLifetimeEnd(dst);
-@@ -1410,7 +1438,7 @@ void CodegenLLVM::unop_ptr(Unop &unop)
- int size = unop.type.IsIntegerTy() ? et->GetIntBitWidth() / 8 : 8;
- AllocaInst *dst = b_.CreateAllocaBPF(*et, "deref");
- b_.CreateProbeRead(ctx_, dst, size, expr_, type.GetAS(), unop.loc);
-- expr_ = b_.CreateIntCast(b_.CreateLoad(dst),
-+ expr_ = b_.CreateIntCast(b_.CreateLoad(b_.GetType(*et), dst),
- b_.getInt64Ty(),
- unop.type.IsSigned());
- b_.CreateLifetimeEnd(dst);
-@@ -1489,7 +1517,7 @@ void CodegenLLVM::visit(Ternary &ternary)
- b_.CreateBr(done);
-
- b_.SetInsertPoint(done);
-- expr_ = b_.CreateLoad(result);
-+ expr_ = b_.CreateLoad(b_.GetType(ternary.type), result);
- }
- else if (ternary.type.IsStringTy())
- {
-@@ -1552,7 +1580,8 @@ void CodegenLLVM::visit(FieldAccess &acc)
- }
- else if (type.IsTupleTy())
- {
-- Value *src = b_.CreateGEP(expr_,
-+ Value *src = b_.CreateGEP(b_.GetType(type),
-+ expr_,
- { b_.getInt32(0), b_.getInt32(acc.index) });
- SizedType &elem_type = type.GetFields()[acc.index].type;
-
-@@ -1599,10 +1628,12 @@ void CodegenLLVM::visit(FieldAccess &acc)
- if (field.is_bitfield)
- {
- Value *raw;
-+ auto field_type = b_.GetType(field.type);
- if (type.IsCtxAccess())
-- raw = b_.CreateLoad(
-- b_.CreateIntToPtr(src, b_.GetType(field.type)->getPointerTo()),
-- true);
-+ raw = b_.CreateLoad(field_type,
-+ b_.CreateIntToPtr(src,
-+ field_type->getPointerTo()),
-+ true);
- else
- {
- AllocaInst *dst = b_.CreateAllocaBPF(field.type,
-@@ -1613,7 +1644,7 @@ void CodegenLLVM::visit(FieldAccess &acc)
- b_.CREATE_MEMSET(dst, b_.getInt8(0), field.type.GetSize(), 1);
- b_.CreateProbeRead(
- ctx_, dst, field.bitfield.read_bytes, src, type.GetAS(), acc.loc);
-- raw = b_.CreateLoad(dst);
-+ raw = b_.CreateLoad(field_type, dst);
- b_.CreateLifetimeEnd(dst);
- }
- size_t rshiftbits;
-@@ -1641,7 +1672,8 @@ void CodegenLLVM::visit(FieldAccess &acc)
- // offset which we add to the start of the tracepoint struct.
- expr_ = b_.CreateLoad(
- b_.getInt32Ty(),
-- b_.CreateGEP(b_.CreatePointerCast(ctx_,
-+ b_.CreateGEP(b_.getInt32Ty(),
-+ b_.CreatePointerCast(ctx_,
- b_.getInt32Ty()->getPointerTo()),
- b_.getInt64(field.offset / 4)));
- expr_ = b_.CreateIntCast(expr_, b_.getInt64Ty(), false);
-@@ -1760,7 +1792,9 @@ void CodegenLLVM::visit(Tuple &tuple)
- Expression *elem = tuple.elems->at(i);
- auto scoped_del = accept(elem);
-
-- Value *dst = b_.CreateGEP(buf, { b_.getInt32(0), b_.getInt32(i) });
-+ Value *dst = b_.CreateGEP(tuple_ty,
-+ buf,
-+ { b_.getInt32(0), b_.getInt32(i) });
-
- if (onStack(elem->type))
- b_.CREATE_MEMCPY(dst, expr_, elem->type.GetSize(), 1);
-@@ -2411,6 +2445,7 @@ AllocaInst *CodegenLLVM::getMultiMapKey(Map &map,
- size += key_type.GetSize();
- }
- AllocaInst *key = b_.CreateAllocaBPF(size, map.ident + "_key");
-+ auto *key_type = ArrayType::get(b_.getInt8Ty(), size);
-
- int offset = 0;
- bool aligned = true;
-@@ -2419,7 +2454,8 @@ AllocaInst *CodegenLLVM::getMultiMapKey(Map &map,
- for (Expression *expr : *map.vargs)
- {
- auto scoped_del = accept(expr);
-- Value *offset_val = b_.CreateGEP(key,
-+ Value *offset_val = b_.CreateGEP(key_type,
-+ key,
- { b_.getInt64(0), b_.getInt64(offset) });
- size_t map_key_size = map.key_type.args_[i++].GetSize();
-
-@@ -2464,7 +2500,8 @@ AllocaInst *CodegenLLVM::getMultiMapKey(Map &map,
-
- for (auto *extra_key : extra_keys)
- {
-- Value *offset_val = b_.CreateGEP(key,
-+ Value *offset_val = b_.CreateGEP(key_type,
-+ key,
- { b_.getInt64(0), b_.getInt64(offset) });
- if (aligned)
- b_.CreateStore(extra_key, offset_val);
-@@ -2521,7 +2558,7 @@ Value *CodegenLLVM::createLogicalAnd(Binop &binop)
- b_.CreateBr(merge_block);
-
- b_.SetInsertPoint(merge_block);
-- return b_.CreateLoad(result);
-+ return b_.CreateLoad(b_.getInt64Ty(), result);
- }
-
- Value *CodegenLLVM::createLogicalOr(Binop &binop)
-@@ -2560,7 +2597,7 @@ Value *CodegenLLVM::createLogicalOr(Binop &binop)
- b_.CreateBr(merge_block);
-
- b_.SetInsertPoint(merge_block);
-- return b_.CreateLoad(result);
-+ return b_.CreateLoad(b_.getInt64Ty(), result);
- }
-
- Function *CodegenLLVM::createLog2Function()
-@@ -2604,34 +2641,37 @@ Function *CodegenLLVM::createLog2Function()
- // test for less than zero
- BasicBlock *is_less_than_zero = BasicBlock::Create(module_->getContext(), "hist.is_less_than_zero", log2_func);
- BasicBlock *is_not_less_than_zero = BasicBlock::Create(module_->getContext(), "hist.is_not_less_than_zero", log2_func);
-- b_.CreateCondBr(b_.CreateICmpSLT(b_.CreateLoad(n_alloc), b_.getInt64(0)),
-+ b_.CreateCondBr(b_.CreateICmpSLT(b_.CreateLoad(b_.getInt64Ty(), n_alloc),
-+ b_.getInt64(0)),
- is_less_than_zero,
- is_not_less_than_zero);
- b_.SetInsertPoint(is_less_than_zero);
-- createRet(b_.CreateLoad(result));
-+ createRet(b_.CreateLoad(b_.getInt64Ty(), result));
- b_.SetInsertPoint(is_not_less_than_zero);
-
- // test for equal to zero
- BasicBlock *is_zero = BasicBlock::Create(module_->getContext(), "hist.is_zero", log2_func);
- BasicBlock *is_not_zero = BasicBlock::Create(module_->getContext(), "hist.is_not_zero", log2_func);
-- b_.CreateCondBr(b_.CreateICmpEQ(b_.CreateLoad(n_alloc), b_.getInt64(0)),
-+ b_.CreateCondBr(b_.CreateICmpEQ(b_.CreateLoad(b_.getInt64Ty(), n_alloc),
-+ b_.getInt64(0)),
- is_zero,
- is_not_zero);
- b_.SetInsertPoint(is_zero);
- b_.CreateStore(b_.getInt64(1), result);
-- createRet(b_.CreateLoad(result));
-+ createRet(b_.CreateLoad(b_.getInt64Ty(), result));
- b_.SetInsertPoint(is_not_zero);
-
- // power-of-2 index, offset by +2
- b_.CreateStore(b_.getInt64(2), result);
- for (int i = 4; i >= 0; i--)
- {
-- Value *n = b_.CreateLoad(n_alloc);
-+ Value *n = b_.CreateLoad(b_.getInt64Ty(), n_alloc);
- Value *shift = b_.CreateShl(b_.CreateIntCast(b_.CreateICmpSGE(b_.CreateIntCast(n, b_.getInt64Ty(), false), b_.getInt64(1 << (1<<i))), b_.getInt64Ty(), false), i);
- b_.CreateStore(b_.CreateLShr(n, shift), n_alloc);
-- b_.CreateStore(b_.CreateAdd(b_.CreateLoad(result), shift), result);
-+ b_.CreateStore(b_.CreateAdd(b_.CreateLoad(b_.getInt64Ty(), result), shift),
-+ result);
- }
-- createRet(b_.CreateLoad(result));
-+ createRet(b_.CreateLoad(b_.getInt64Ty(), result));
- b_.restoreIP(ip);
- return module_->getFunction("log2");
- }
-@@ -2681,8 +2721,8 @@ Function *CodegenLLVM::createLinearFunction()
-
- // algorithm
- {
-- Value *min = b_.CreateLoad(min_alloc);
-- Value *val = b_.CreateLoad(value_alloc);
-+ Value *min = b_.CreateLoad(b_.getInt64Ty(), min_alloc);
-+ Value *val = b_.CreateLoad(b_.getInt64Ty(), value_alloc);
- cmp = b_.CreateICmpSLT(val, min);
- }
- BasicBlock *lt_min = BasicBlock::Create(module_->getContext(), "lhist.lt_min", linear_func);
-@@ -2694,8 +2734,8 @@ Function *CodegenLLVM::createLinearFunction()
-
- b_.SetInsertPoint(ge_min);
- {
-- Value *max = b_.CreateLoad(max_alloc);
-- Value *val = b_.CreateLoad(value_alloc);
-+ Value *max = b_.CreateLoad(b_.getInt64Ty(), max_alloc);
-+ Value *val = b_.CreateLoad(b_.getInt64Ty(), value_alloc);
- cmp = b_.CreateICmpSGT(val, max);
- }
- BasicBlock *le_max = BasicBlock::Create(module_->getContext(), "lhist.le_max", linear_func);
-@@ -2704,22 +2744,22 @@ Function *CodegenLLVM::createLinearFunction()
-
- b_.SetInsertPoint(gt_max);
- {
-- Value *step = b_.CreateLoad(step_alloc);
-- Value *min = b_.CreateLoad(min_alloc);
-- Value *max = b_.CreateLoad(max_alloc);
-+ Value *step = b_.CreateLoad(b_.getInt64Ty(), step_alloc);
-+ Value *min = b_.CreateLoad(b_.getInt64Ty(), min_alloc);
-+ Value *max = b_.CreateLoad(b_.getInt64Ty(), max_alloc);
- Value *div = b_.CreateUDiv(b_.CreateSub(max, min), step);
- b_.CreateStore(b_.CreateAdd(div, b_.getInt64(1)), result_alloc);
-- createRet(b_.CreateLoad(result_alloc));
-+ createRet(b_.CreateLoad(b_.getInt64Ty(), result_alloc));
- }
-
- b_.SetInsertPoint(le_max);
- {
-- Value *step = b_.CreateLoad(step_alloc);
-- Value *min = b_.CreateLoad(min_alloc);
-- Value *val = b_.CreateLoad(value_alloc);
-+ Value *step = b_.CreateLoad(b_.getInt64Ty(), step_alloc);
-+ Value *min = b_.CreateLoad(b_.getInt64Ty(), min_alloc);
-+ Value *val = b_.CreateLoad(b_.getInt64Ty(), value_alloc);
- Value *div3 = b_.CreateUDiv(b_.CreateSub(val, min), step);
- b_.CreateStore(b_.CreateAdd(div3, b_.getInt64(1)), result_alloc);
-- createRet(b_.CreateLoad(result_alloc));
-+ createRet(b_.CreateLoad(b_.getInt64Ty(), result_alloc));
- }
-
- b_.restoreIP(ip);
-@@ -2773,14 +2813,18 @@ void CodegenLLVM::createFormatStringCall(Call &call, int &id, CallArgs &call_arg
- // as the struct is not packed we need to memset it.
- b_.CREATE_MEMSET(fmt_args, b_.getInt8(0), struct_size, 1);
-
-- Value *id_offset = b_.CreateGEP(fmt_args, {b_.getInt32(0), b_.getInt32(0)});
-+ Value *id_offset = b_.CreateGEP(fmt_struct,
-+ fmt_args,
-+ { b_.getInt32(0), b_.getInt32(0) });
- b_.CreateStore(b_.getInt64(id + asyncactionint(async_action)), id_offset);
-
- for (size_t i=1; i<call.vargs->size(); i++)
- {
- Expression &arg = *call.vargs->at(i);
- auto scoped_del = accept(&arg);
-- Value *offset = b_.CreateGEP(fmt_args, {b_.getInt32(0), b_.getInt32(i)});
-+ Value *offset = b_.CreateGEP(fmt_struct,
-+ fmt_args,
-+ { b_.getInt32(0), b_.getInt32(i) });
- if (needMemcpy(arg.type))
- b_.CREATE_MEMCPY(offset, expr_, arg.type.GetSize(), 1);
- else if (arg.type.IsIntegerTy() && arg.type.GetSize() < 8)
-@@ -2820,10 +2864,12 @@ void CodegenLLVM::generateWatchpointSetupProbe(
- // Pull out function argument
- Value *ctx = func->arg_begin();
- int offset = arch::arg_offset(arg_num);
-- Value *addr = b_.CreateLoad(
-- b_.getInt64Ty(),
-- b_.CreateGEP(ctx, b_.getInt64(offset * sizeof(uintptr_t))),
-- "arg" + std::to_string(arg_num));
-+ Value *arg = b_.CreateGEP(b_.getInt8Ty(),
-+ ctx,
-+ b_.getInt64(offset * sizeof(uintptr_t)));
-+ Value *addr = b_.CreateLoad(b_.getInt64Ty(),
-+ arg,
-+ "arg" + std::to_string(arg_num));
-
- // Tell userspace to setup the real watchpoint
- auto elements = AsyncEvent::Watchpoint().asLLVMType(b_);
-@@ -2834,12 +2880,16 @@ void CodegenLLVM::generateWatchpointSetupProbe(
- size_t struct_size = datalayout().getTypeAllocSize(watchpoint_struct);
-
- // Fill in perf event struct
-- b_.CreateStore(b_.getInt64(asyncactionint(AsyncAction::watchpoint_attach)),
-- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) }));
-- b_.CreateStore(b_.getInt64(watchpoint_id_),
-- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(1) }));
-+ b_.CreateStore(
-+ b_.getInt64(asyncactionint(AsyncAction::watchpoint_attach)),
-+ b_.CreateGEP(watchpoint_struct, buf, { b_.getInt64(0), b_.getInt32(0) }));
-+ b_.CreateStore(
-+ b_.getInt64(watchpoint_id_),
-+ b_.CreateGEP(watchpoint_struct, buf, { b_.getInt64(0), b_.getInt32(1) }));
- watchpoint_id_++;
-- b_.CreateStore(addr, b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(2) }));
-+ b_.CreateStore(
-+ addr,
-+ b_.CreateGEP(watchpoint_struct, buf, { b_.getInt64(0), b_.getInt32(2) }));
- b_.CreatePerfEventOutput(ctx, buf, struct_size);
- b_.CreateLifetimeEnd(buf);
-
-@@ -2858,11 +2908,14 @@ void CodegenLLVM::createPrintMapCall(Call &call)
- call.func + "_" + map.ident);
-
- // store asyncactionid:
-- b_.CreateStore(b_.getInt64(asyncactionint(AsyncAction::print)),
-- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) }));
-+ b_.CreateStore(
-+ b_.getInt64(asyncactionint(AsyncAction::print)),
-+ b_.CreateGEP(print_struct, buf, { b_.getInt64(0), b_.getInt32(0) }));
-
- auto id = bpftrace_.maps[map.ident].value()->id;
-- auto *ident_ptr = b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(1) });
-+ auto *ident_ptr = b_.CreateGEP(print_struct,
-+ buf,
-+ { b_.getInt64(0), b_.getInt32(1) });
- b_.CreateStore(b_.GetIntSameSize(id, elements.at(1)), ident_ptr);
-
- // top, div
-@@ -2874,14 +2927,16 @@ void CodegenLLVM::createPrintMapCall(Call &call)
- auto scoped_del = accept(call.vargs->at(arg_idx));
-
- b_.CreateStore(b_.CreateIntCast(expr_, elements.at(arg_idx), false),
-- b_.CreateGEP(buf,
-+ b_.CreateGEP(print_struct,
-+ buf,
- { b_.getInt64(0), b_.getInt32(arg_idx + 1) }));
- }
-
- for (; arg_idx < 3; arg_idx++)
- {
- b_.CreateStore(b_.GetIntSameSize(0, elements.at(arg_idx)),
-- b_.CreateGEP(buf,
-+ b_.CreateGEP(print_struct,
-+ buf,
- { b_.getInt64(0), b_.getInt32(arg_idx + 1) }));
- }
-
-@@ -2906,15 +2961,19 @@ void CodegenLLVM::createPrintNonMapCall(Call &call, int &id)
- size_t struct_size = datalayout().getTypeAllocSize(print_struct);
-
- // Store asyncactionid:
-- b_.CreateStore(b_.getInt64(asyncactionint(AsyncAction::print_non_map)),
-- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(0) }));
-+ b_.CreateStore(
-+ b_.getInt64(asyncactionint(AsyncAction::print_non_map)),
-+ b_.CreateGEP(print_struct, buf, { b_.getInt64(0), b_.getInt32(0) }));
-
- // Store print id
-- b_.CreateStore(b_.getInt64(id),
-- b_.CreateGEP(buf, { b_.getInt64(0), b_.getInt32(1) }));
-+ b_.CreateStore(
-+ b_.getInt64(id),
-+ b_.CreateGEP(print_struct, buf, { b_.getInt64(0), b_.getInt32(1) }));
-
- // Store content
-- Value *content_offset = b_.CreateGEP(buf, { b_.getInt32(0), b_.getInt32(2) });
-+ Value *content_offset = b_.CreateGEP(print_struct,
-+ buf,
-+ { b_.getInt32(0), b_.getInt32(2) });
- b_.CREATE_MEMSET(content_offset, b_.getInt8(0), arg.type.GetSize(), 1);
- if (needMemcpy(arg.type))
- {
-@@ -3085,7 +3144,9 @@ void CodegenLLVM::readDatastructElemFromStack(Value *src_data,
- src_data = b_.CreateIntToPtr(src_data,
- b_.GetType(data_type)->getPointerTo());
-
-- Value *src = b_.CreateGEP(src_data, { b_.getInt32(0), index });
-+ Value *src = b_.CreateGEP(b_.GetType(data_type),
-+ src_data,
-+ { b_.getInt32(0), index });
-
- // It may happen that the result pointer type is not correct, in such case
- // do a typecast
-@@ -3096,7 +3157,7 @@ void CodegenLLVM::readDatastructElemFromStack(Value *src_data,
- if (elem_type.IsIntegerTy() || elem_type.IsPtrTy())
- {
- // Load the correct type from src
-- expr_ = b_.CreateLoad(src, true);
-+ expr_ = b_.CreateLoad(b_.GetType(elem_type), src, true);
- }
- else
- {
-@@ -3150,7 +3211,8 @@ void CodegenLLVM::probereadDatastructElem(Value *src_data,
- // Read data onto stack
- if (data_type.IsCtxAccess())
- {
-- expr_ = b_.CreateLoad(b_.CreateIntToPtr(src, dst_type->getPointerTo()),
-+ expr_ = b_.CreateLoad(dst_type,
-+ b_.CreateIntToPtr(src, dst_type->getPointerTo()),
- true);
- expr_ = b_.CreateIntCast(expr_, b_.getInt64Ty(), elem_type.IsSigned());
-
-@@ -3181,7 +3243,7 @@ void CodegenLLVM::probereadDatastructElem(Value *src_data,
- AllocaInst *dst = b_.CreateAllocaBPF(elem_type, temp_name);
- b_.CreateProbeRead(
- ctx_, dst, elem_type.GetSize(), src, data_type.GetAS(), loc);
-- expr_ = b_.CreateIntCast(b_.CreateLoad(dst),
-+ expr_ = b_.CreateIntCast(b_.CreateLoad(b_.GetType(elem_type), dst),
- b_.getInt64Ty(),
- elem_type.IsSigned());
- b_.CreateLifetimeEnd(dst);
-@@ -3212,13 +3274,15 @@ void CodegenLLVM::createIncDec(Unop &unop)
- if (unop.is_post_op)
- expr_ = oldval;
- else
-- expr_ = b_.CreateLoad(newval);
-+ expr_ = b_.CreateLoad(b_.GetType(map.type), newval);
- b_.CreateLifetimeEnd(newval);
- }
- else if (unop.expr->is_variable)
- {
- Variable &var = static_cast<Variable &>(*unop.expr);
-- Value *oldval = b_.CreateLoad(variables_[var.ident]);
-+ Value *oldval = b_.CreateLoad(
-+ variables_[var.ident]->getType()->getElementType(),
-+ variables_[var.ident]);
- Value *newval;
- if (is_increment)
- newval = b_.CreateAdd(oldval, b_.GetIntSameSize(step, oldval));
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2022-09-22 19:04 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2022-09-22 19:04 UTC (permalink / raw
To: gentoo-commits
commit: 25d51527d29fc9d8d269f2a9d4c96b640b2cbf52
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 22 19:04:01 2022 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Thu Sep 22 19:04:05 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25d51527
dev-util/bpftrace: add 0.16.0 (bug #868519)
Closes: https://bugs.gentoo.org/868519
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/Manifest | 1 +
dev-util/bpftrace/bpftrace-0.16.0.ebuild | 92 +++++++++
.../files/bpftrace-0.16.0-install-libs.patch | 210 +++++++++++++++++++++
dev-util/bpftrace/files/bpftrace-0.16.0-link.patch | 0
4 files changed, 303 insertions(+)
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest
index f594b9b845c0..308364d6afc1 100644
--- a/dev-util/bpftrace/Manifest
+++ b/dev-util/bpftrace/Manifest
@@ -1,2 +1,3 @@
DIST bpftrace-0.14.1-llvm14.patch.gz 7377 BLAKE2B 69b3b74bce74a8d4d8d9cc74de352dc33875ae905d8a88c776bbe80862a4f4ac2d450bcb6190da8be880bcc8fb751e3b8172df5454f31dc4bcd3e41edb02e396 SHA512 3269132981a7d2c0263fe9003bbcd2348e186ca0cdc95ada368331fc6e2495ae126c7bd68676438ccb575aafdafa3d17604a28fdc11d8b629eeaee130c1fd614
DIST bpftrace-0.15.0.tar.gz 1006735 BLAKE2B 3ef4bb5f13aa6dea5140b5362e6fc3de21baa1192e2218307895bf29ddeba8d69543e32c2b769bf3456076095ba661b66e1625f2696631d22628311d7f6ec1a4 SHA512 916e9afeab301e62472e570ef77a3b9b27b43251880b64f1c5f151583c59a6c61e9ede50f3607044b27c5a6ce1a654f290153bf3f9237ebc0a823b5e6356187a
+DIST bpftrace-0.16.0.gh.tar.gz 1023480 BLAKE2B 20fa877adeaada655462004142a80f107f82a3fa73fd7a7675a477d45ecd3a28115af5d612da2b06e2d760cfa3e574583e4cc4d62f4175c49ecc9d9b3fcceb6e SHA512 52ca4fea4e2f8d2cbf0f9f1bc69af0ee3408201f019006dd2e838b9458cfc01761eba3df24c39e05cf93220d85d0cecc69bb44ec72f9f44cec0eb94479bff734
diff --git a/dev-util/bpftrace/bpftrace-0.16.0.ebuild b/dev-util/bpftrace/bpftrace-0.16.0.ebuild
new file mode 100644
index 000000000000..210d78fe7f33
--- /dev/null
+++ b/dev-util/bpftrace/bpftrace-0.16.0.ebuild
@@ -0,0 +1,92 @@
+# Copyright 2019-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_MAX_SLOT=16
+
+inherit llvm linux-info cmake toolchain-funcs
+
+DESCRIPTION="High-level tracing language for eBPF"
+HOMEPAGE="https://github.com/iovisor/bpftrace"
+MY_PV="${PV//_/}"
+SRC_URI="https://github.com/iovisor/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.gh.tar.gz"
+S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="fuzzing test"
+
+# lots of fixing needed
+RESTRICT="test"
+
+RDEPEND="
+ >=dev-libs/libbpf-1.0:=
+ >=dev-util/bcc-0.25.0:=
+ dev-util/systemtap
+ <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):=
+ <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):=[llvm_targets_BPF(+)]
+ sys-libs/binutils-libs:=
+ virtual/libelf:=
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ dev-libs/cereal:=
+ test? ( dev-cpp/gtest )
+"
+BDEPEND="
+ sys-apps/sed
+ app-arch/xz-utils
+ sys-devel/flex
+ sys-devel/bison
+ virtual/pkgconfig
+"
+
+QA_DT_NEEDED="
+ /usr/lib.*/libbpftraceresources.so
+ /usr/lib.*/libcxxdemangler_llvm.so
+"
+
+PATCHES=(
+ "${FILESDIR}/bpftrace-0.16.0-install-libs.patch"
+ "${FILESDIR}/bpftrace-0.15.0-dont-compress-man.patch"
+ "${FILESDIR}/bpftrace-0.11.4-old-kernels.patch"
+ "${FILESDIR}/bpftrace-0.16.0-link.patch"
+)
+
+pkg_pretend() {
+ local CONFIG_CHECK="
+ ~BPF
+ ~BPF_EVENTS
+ ~BPF_JIT
+ ~BPF_SYSCALL
+ ~FTRACE_SYSCALLS
+ ~HAVE_EBPF_JIT
+ "
+
+ check_extra_config
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+}
+
+src_configure() {
+ local -a mycmakeargs=(
+ -DSTATIC_LINKING:BOOL=OFF
+ # bug 809362, 754648
+ -DBUILD_TESTING:BOOL=$(usex test)
+ -DBUILD_FUZZ:BOOL=$(usex fuzzing)
+ -DENABLE_MAN:BOOL=OFF
+ )
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ # bug 809362
+ dostrip -x /usr/bin/bpftrace
+ doman man/man8/*.?
+}
diff --git a/dev-util/bpftrace/files/bpftrace-0.16.0-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.16.0-install-libs.patch
new file mode 100644
index 000000000000..290c1065b2ce
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.16.0-install-libs.patch
@@ -0,0 +1,210 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e63bc83c..ada1d370 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,9 +114,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 a95c60a1..f5c4d676 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 09b8c1e0..b9e9ac44 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -42,7 +42,7 @@ add_library(runtime
+ ${BFD_DISASM_SRC}
+ )
+ # Ensure flex+bison outputs are built first
+-add_dependencies(runtime parser)
++add_dependencies(runtime bpftraceparser)
+
+ add_library(libbpftrace
+ build_info.cpp
+@@ -59,6 +59,7 @@ add_executable(${BPFTRACE}
+ )
+
+ install(TARGETS ${BPFTRACE} DESTINATION ${CMAKE_INSTALL_BINDIR})
++install(TARGETS libbpftrace LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ target_link_libraries(${BPFTRACE} libbpftrace)
+
+ if (BUILD_FUZZ)
+@@ -111,6 +112,7 @@ target_include_directories(runtime PRIVATE ${CMAKE_BINARY_DIR})
+ target_include_directories(runtime PRIVATE ${CMAKE_SOURCE_DIR}/src)
+ target_include_directories(runtime PRIVATE ${CMAKE_SOURCE_DIR}/src/ast)
+ target_compile_definitions(runtime PRIVATE ${BPFTRACE_FLAGS})
++install(TARGETS runtime LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ target_compile_definitions(libbpftrace PRIVATE ${BPFTRACE_FLAGS})
+
+ # Linking
+@@ -123,7 +125,8 @@ if(STATIC_LINKING)
+ endif(STATIC_LINKING)
+
+
+-target_link_libraries(libbpftrace parser resources runtime aot ast arch cxxdemangler_llvm)
++target_link_libraries(libbpftrace bpftraceparser bpftraceresources
++ runtime aot bpftraceast bpftracearch cxxdemangler_llvm)
+
+ if (LIBBPF_BTF_DUMP_FOUND)
+ target_link_libraries(runtime ${LIBBPF_LIBRARIES})
+@@ -168,6 +171,7 @@ if(STATIC_LINKING)
+ target_link_libraries(runtime LIBELF)
+ else()
+ target_link_libraries(runtime ${LIBELF_LIBRARIES})
++ target_link_libraries(runtime ${LIBBPF_LIBRARIES})
+ endif(STATIC_LINKING)
+
+ if (LIBDW_FOUND)
+diff --git a/src/aot/CMakeLists.txt b/src/aot/CMakeLists.txt
+index c776d204..a1d0d75e 100644
+--- a/src/aot/CMakeLists.txt
++++ b/src/aot/CMakeLists.txt
+@@ -1,8 +1,9 @@
+ add_library(aot aot.cpp)
+-add_dependencies(aot parser)
++add_dependencies(aot bpftraceparser)
+ target_include_directories(aot PUBLIC ${CMAKE_SOURCE_DIR}/src)
+ target_include_directories(aot PUBLIC ${CMAKE_BINARY_DIR})
+ target_compile_definitions(aot PRIVATE ${BPFTRACE_FLAGS})
++install(TARGETS aot LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+ # Only build aotrt if supported bcc is used
+ # (https://github.com/iovisor/bcc/commit/719191867a25ce07dc96f7faf9b8ccedadc7ec44)
+@@ -11,7 +12,7 @@ if(NOT LIBBCC_BPF_CONTAINS_RUNTIME)
+ endif()
+
+ add_executable(bpftrace-aotrt aot_main.cpp)
+-target_link_libraries(bpftrace-aotrt aot runtime arch ast_defs cxxdemangler_stdlib)
++target_link_libraries(bpftrace-aotrt aot runtime bpftracearch ast_defs cxxdemangler_stdlib)
+ install(TARGETS bpftrace-aotrt DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+ if(LIBPCAP_FOUND)
+diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt
+index 127c3528..4e05d40a 100644
+--- a/src/arch/CMakeLists.txt
++++ b/src/arch/CMakeLists.txt
+@@ -1,17 +1,19 @@
+ 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 "s390" OR
+ CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x")
+- add_library(arch s390.cpp)
++ add_library(bpftracearch s390.cpp)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+- add_library(arch x86_64.cpp)
++ add_library(bpftracearch x86_64.cpp)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "mips64")
+- add_library(arch mips64.cpp)
++ add_library(bpftracearch mips64.cpp)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
+- add_library(arch riscv64.cpp)
++ add_library(bpftracearch riscv64.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 014295cd..c35f6ac6 100644
+--- a/src/ast/CMakeLists.txt
++++ b/src/ast/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ add_library(ast_defs ast.cpp)
+
+-add_library(ast
++add_library(bpftraceast
+ async_event_types.cpp
+ attachpoint_parser.cpp
+ int_parser.cpp
+@@ -20,11 +20,13 @@ add_library(ast
+ target_include_directories(ast_defs PUBLIC ${CMAKE_SOURCE_DIR}/src)
+ target_include_directories(ast_defs PUBLIC ${CMAKE_SOURCE_DIR}/src/ast)
+ target_include_directories(ast_defs PUBLIC ${CMAKE_BINARY_DIR})
+-target_link_libraries(ast ast_defs arch bpforc parser)
++target_link_libraries(bpftraceast ast_defs bpftracearch bpforc bpftraceparser)
++install(TARGETS ast_defs LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
++install(TARGETS bpftraceast LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+-add_dependencies(ast_defs parser)
++add_dependencies(ast_defs bpftraceparser)
+
+-target_compile_definitions(ast PRIVATE ${BPFTRACE_FLAGS})
++target_compile_definitions(bpftraceast PRIVATE ${BPFTRACE_FLAGS})
+
+ if (STATIC_LINKING)
+ set(clang_libs
+@@ -55,11 +57,11 @@ if (STATIC_LINKING)
+
+
+ if(EMBED_USE_LLVM)
+- target_link_libraries(ast "-Wl,--start-group" ${CLANG_EMBEDDED_CMAKE_TARGETS} ${LLVM_EMBEDDED_CMAKE_TARGETS} "-Wl,--end-group")
++ target_link_libraries(bpftraceast "-Wl,--start-group" ${CLANG_EMBEDDED_CMAKE_TARGETS} ${LLVM_EMBEDDED_CMAKE_TARGETS} "-Wl,--end-group")
+ else()
+ llvm_map_components_to_libnames(llvm_libs ${llvm_lib_names})
+- 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()
+
+ if(STATIC_LIBC)
+@@ -69,13 +71,13 @@ if (STATIC_LINKING)
+ 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()
+
+ add_subdirectory(bpforc)
+diff --git a/src/ast/bpforc/CMakeLists.txt b/src/ast/bpforc/CMakeLists.txt
+index 3f6dbefa..8ccfbb2b 100644
+--- a/src/ast/bpforc/CMakeLists.txt
++++ b/src/ast/bpforc/CMakeLists.txt
+@@ -1 +1,2 @@
+ add_library(bpforc bpforc.cpp)
++install(TARGETS bpforc LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff --git a/src/cxxdemangler/CMakeLists.txt b/src/cxxdemangler/CMakeLists.txt
+index 04cfcdd9..5677aa4b 100644
+--- a/src/cxxdemangler/CMakeLists.txt
++++ b/src/cxxdemangler/CMakeLists.txt
+@@ -1,2 +1,4 @@
+ add_library(cxxdemangler_stdlib cxxdemangler_stdlib.cpp)
+ add_library(cxxdemangler_llvm cxxdemangler_llvm.cpp)
++install(TARGETS cxxdemangler_stdlib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
++install(TARGETS cxxdemangler_llvm LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/dev-util/bpftrace/files/bpftrace-0.16.0-link.patch b/dev-util/bpftrace/files/bpftrace-0.16.0-link.patch
new file mode 100644
index 000000000000..e69de29bb2d1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2022-09-27 21:41 Sam James
0 siblings, 0 replies; 20+ messages in thread
From: Sam James @ 2022-09-27 21:41 UTC (permalink / raw
To: gentoo-commits
commit: 4d4bcc14d16dfcab91d9bdce6fb920ec95511da4
Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Mon Sep 26 08:51:49 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Sep 27 21:41:35 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d4bcc14
dev-util/bpftrace: add fix to work properly with LLVM-15
Closes: https://bugs.gentoo.org/872842
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
...-0.15.0-r1.ebuild => bpftrace-0.15.0-r2.ebuild} | 1 +
.../files/bpftrace-0.15.0-llvm-15-pointers.patch | 30 ++++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/dev-util/bpftrace/bpftrace-0.15.0-r1.ebuild b/dev-util/bpftrace/bpftrace-0.15.0-r2.ebuild
similarity index 97%
rename from dev-util/bpftrace/bpftrace-0.15.0-r1.ebuild
rename to dev-util/bpftrace/bpftrace-0.15.0-r2.ebuild
index 566a14a29b4a..1095ed8e6fd3 100644
--- a/dev-util/bpftrace/bpftrace-0.15.0-r1.ebuild
+++ b/dev-util/bpftrace/bpftrace-0.15.0-r2.ebuild
@@ -54,6 +54,7 @@ PATCHES=(
"${FILESDIR}/bpftrace-0.11.4-old-kernels.patch"
"${FILESDIR}/bpftrace-0.15.0-bcc-025.patch"
"${FILESDIR}/bpftrace-0.15.0-binutils-2.39.patch"
+ "${FILESDIR}/bpftrace-0.15.0-llvm-15-pointers.patch"
)
pkg_pretend() {
diff --git a/dev-util/bpftrace/files/bpftrace-0.15.0-llvm-15-pointers.patch b/dev-util/bpftrace/files/bpftrace-0.15.0-llvm-15-pointers.patch
new file mode 100644
index 000000000000..51ea034b9a88
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.15.0-llvm-15-pointers.patch
@@ -0,0 +1,30 @@
+
+From: https://github.com/iovisor/bpftrace/pull/2367
+Bug: https://bugs.gentoo.org/872842
+
+From 07fa48a94ef6d6bb1f335de345de18fe9776ca57 Mon Sep 17 00:00:00 2001
+From: kenneth topp <toppk@bllue.org>
+Date: Mon, 26 Sep 2022 00:33:29 -0400
+Subject: [PATCH] Workaround OpaquePointers for LLVM 15
+
+This workaround allows bpftrace to be compiled against
+LLVM-15. This will have to be address properly before LLVM-16
+More details from LLVM here: https://llvm.org/docs/OpaquePointers.html
+---
+ src/ast/irbuilderbpf.cpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/ast/irbuilderbpf.cpp b/src/ast/irbuilderbpf.cpp
+index d49883f786..00f0f172ff 100644
+--- a/src/ast/irbuilderbpf.cpp
++++ b/src/ast/irbuilderbpf.cpp
+@@ -123,6 +123,9 @@ IRBuilderBPF::IRBuilderBPF(LLVMContext &context,
+ module_(module),
+ bpftrace_(bpftrace)
+ {
++#if LLVM_VERSION_MAJOR == 15
++ context.setOpaquePointers(false);
++#endif
+ // Declare external LLVM function
+ FunctionType *pseudo_func_type = FunctionType::get(
+ getInt64Ty(),
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2023-01-30 19:10 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2023-01-30 19:10 UTC (permalink / raw
To: gentoo-commits
commit: 90756882da5d06a2e4b4e7d0f718d97dad65f136
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 30 19:08:08 2023 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Mon Jan 30 19:10:09 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90756882
dev-util/bpftrace: add 0.17.0
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/Manifest | 3 +-
dev-util/bpftrace/bpftrace-0.17.0.ebuild | 95 ++++++
.../files/bpftrace-0.17.0-install-libs.patch | 327 +++++++++++++++++++++
3 files changed, 423 insertions(+), 2 deletions(-)
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest
index 308364d6afc1..d51f5f17e321 100644
--- a/dev-util/bpftrace/Manifest
+++ b/dev-util/bpftrace/Manifest
@@ -1,3 +1,2 @@
-DIST bpftrace-0.14.1-llvm14.patch.gz 7377 BLAKE2B 69b3b74bce74a8d4d8d9cc74de352dc33875ae905d8a88c776bbe80862a4f4ac2d450bcb6190da8be880bcc8fb751e3b8172df5454f31dc4bcd3e41edb02e396 SHA512 3269132981a7d2c0263fe9003bbcd2348e186ca0cdc95ada368331fc6e2495ae126c7bd68676438ccb575aafdafa3d17604a28fdc11d8b629eeaee130c1fd614
-DIST bpftrace-0.15.0.tar.gz 1006735 BLAKE2B 3ef4bb5f13aa6dea5140b5362e6fc3de21baa1192e2218307895bf29ddeba8d69543e32c2b769bf3456076095ba661b66e1625f2696631d22628311d7f6ec1a4 SHA512 916e9afeab301e62472e570ef77a3b9b27b43251880b64f1c5f151583c59a6c61e9ede50f3607044b27c5a6ce1a654f290153bf3f9237ebc0a823b5e6356187a
DIST bpftrace-0.16.0.gh.tar.gz 1023480 BLAKE2B 20fa877adeaada655462004142a80f107f82a3fa73fd7a7675a477d45ecd3a28115af5d612da2b06e2d760cfa3e574583e4cc4d62f4175c49ecc9d9b3fcceb6e SHA512 52ca4fea4e2f8d2cbf0f9f1bc69af0ee3408201f019006dd2e838b9458cfc01761eba3df24c39e05cf93220d85d0cecc69bb44ec72f9f44cec0eb94479bff734
+DIST bpftrace-0.17.0.gh.tar.gz 1033934 BLAKE2B 960582096fcf1652a65c4f8e18dcc5e17792c3b5c048dff59465fc1fc43d39e033c06ebc5c9bc88310b429a81fac5a8cfcdc261e7f0dcdcba4823b518f74fa3e SHA512 b1c8fc81b23f38bc45b4e73edd29c4cd0775e703b368612f00902fbda39dc3758038cd7afa351c1711cec467efd2a199a6b8b933b03aebd591d230d533e190d3
diff --git a/dev-util/bpftrace/bpftrace-0.17.0.ebuild b/dev-util/bpftrace/bpftrace-0.17.0.ebuild
new file mode 100644
index 000000000000..e2084dacecf4
--- /dev/null
+++ b/dev-util/bpftrace/bpftrace-0.17.0.ebuild
@@ -0,0 +1,95 @@
+# Copyright 2019-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_MAX_SLOT=16
+
+inherit llvm linux-info cmake
+
+DESCRIPTION="High-level tracing language for eBPF"
+HOMEPAGE="https://github.com/iovisor/bpftrace"
+MY_PV="${PV//_/}"
+SRC_URI="https://github.com/iovisor/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.gh.tar.gz"
+S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+
+# remove keywords until build works:
+# https://github.com/iovisor/bpftrace/issues/2349
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="fuzzing test"
+
+# lots of fixing needed
+RESTRICT="test"
+
+RDEPEND="
+ >=dev-libs/libbpf-1.0:=
+ >=dev-util/bcc-0.25.0:=
+ >=sys-devel/llvm-10:=[llvm_targets_BPF(+)]
+ >=sys-devel/clang-10:=
+ <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):=
+ <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):=[llvm_targets_BPF(+)]
+ sys-libs/binutils-libs:=
+ virtual/libelf:=
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ dev-libs/cereal:=
+ test? ( dev-cpp/gtest )
+"
+BDEPEND="
+ app-arch/xz-utils
+ sys-devel/flex
+ sys-devel/bison
+ virtual/pkgconfig
+"
+
+QA_DT_NEEDED="
+ /usr/lib.*/libbpftraceresources.so
+ /usr/lib.*/libcxxdemangler_llvm.so
+"
+
+PATCHES=(
+ "${FILESDIR}/bpftrace-0.17.0-install-libs.patch"
+ "${FILESDIR}/bpftrace-0.15.0-dont-compress-man.patch"
+ "${FILESDIR}/bpftrace-0.11.4-old-kernels.patch"
+)
+
+pkg_pretend() {
+ local CONFIG_CHECK="
+ ~BPF
+ ~BPF_EVENTS
+ ~BPF_JIT
+ ~BPF_SYSCALL
+ ~FTRACE_SYSCALLS
+ ~HAVE_EBPF_JIT
+ "
+
+ check_extra_config
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DSTATIC_LINKING:BOOL=OFF
+ # bug 809362, 754648
+ -DBUILD_TESTING:BOOL=$(usex test)
+ -DBUILD_FUZZ:BOOL=$(usex fuzzing)
+ -DENABLE_MAN:BOOL=OFF
+ -DUSE_SYSTEM_BPF_BCC:BOOL=ON
+ )
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ # bug 809362
+ dostrip -x /usr/bin/bpftrace
+ doman man/man8/*.?
+}
diff --git a/dev-util/bpftrace/files/bpftrace-0.17.0-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.17.0-install-libs.patch
new file mode 100644
index 000000000000..a884acc7ef28
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.17.0-install-libs.patch
@@ -0,0 +1,327 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0a7914f5..b9d8f47f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -125,9 +125,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 a95c60a1..f5c4d676 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 ce16469a..98161980 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -13,7 +13,7 @@ else()
+ endif ()
+ endif()
+
+-add_library(runtime
++add_library(bpftraceruntime
+ attached_probe.cpp
+ bpffeature.cpp
+ bpftrace.cpp
+@@ -43,7 +43,7 @@ add_library(runtime
+ ${BFD_DISASM_SRC}
+ )
+ # Ensure flex+bison outputs are built first
+-add_dependencies(runtime parser)
++add_dependencies(bpftraceruntime bpftraceparser)
+
+ add_library(libbpftrace
+ build_info.cpp
+@@ -60,6 +60,7 @@ add_executable(${BPFTRACE}
+ )
+
+ install(TARGETS ${BPFTRACE} DESTINATION ${CMAKE_INSTALL_BINDIR})
++install(TARGETS libbpftrace LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ target_link_libraries(${BPFTRACE} libbpftrace)
+
+ if (BUILD_FUZZ)
+@@ -88,7 +89,7 @@ endif()
+ set(KERNEL_HEADERS_DIR "" CACHE PATH "Hard-code kernel headers directory")
+ if (KERNEL_HEADERS_DIR)
+ MESSAGE(STATUS "Using KERNEL_HEADERS_DIR=${KERNEL_HEADERS_DIR}")
+- target_compile_definitions(runtime PUBLIC KERNEL_HEADERS_DIR="${KERNEL_HEADERS_DIR}")
++ target_compile_definitions(bpftraceruntime PUBLIC KERNEL_HEADERS_DIR="${KERNEL_HEADERS_DIR}")
+ endif()
+
+ execute_process(
+@@ -108,10 +109,11 @@ endif()
+
+ add_definitions("-DBPFTRACE_VERSION=\"${BPFTRACE_VERSION}\"")
+
+-target_include_directories(runtime PRIVATE ${CMAKE_BINARY_DIR})
+-target_include_directories(runtime PRIVATE ${CMAKE_SOURCE_DIR}/src)
+-target_include_directories(runtime PRIVATE ${CMAKE_SOURCE_DIR}/src/ast)
+-target_compile_definitions(runtime PRIVATE ${BPFTRACE_FLAGS})
++target_include_directories(bpftraceruntime PRIVATE ${CMAKE_BINARY_DIR})
++target_include_directories(bpftraceruntime PRIVATE ${CMAKE_SOURCE_DIR}/src)
++target_include_directories(bpftraceruntime PRIVATE ${CMAKE_SOURCE_DIR}/src/ast)
++target_compile_definitions(bpftraceruntime PRIVATE ${BPFTRACE_FLAGS})
++install(TARGETS bpftraceruntime LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ target_compile_definitions(libbpftrace PRIVATE ${BPFTRACE_FLAGS})
+
+ # Linking
+@@ -124,8 +126,8 @@ if(STATIC_LINKING)
+ endif(STATIC_LINKING)
+
+
+-target_link_libraries(runtime ${LIBBPF_LIBRARIES})
+-target_link_libraries(libbpftrace parser resources runtime aot ast arch cxxdemangler_llvm)
++target_link_libraries(bpftraceruntime ${LIBBPF_LIBRARIES})
++target_link_libraries(libbpftrace bpftraceparser bpftraceresources bpftraceruntime aot bpftraceast bpftracearch cxxdemangler_llvm)
+
+ if(LIBPCAP_FOUND)
+ target_link_libraries(libbpftrace ${LIBPCAP_LIBRARIES})
+@@ -135,37 +137,38 @@ if(HAVE_BFD_DISASM)
+ if(STATIC_LINKING)
+ add_library(LIBBFD STATIC IMPORTED)
+ set_property(TARGET LIBBFD PROPERTY IMPORTED_LOCATION ${LIBBFD_LIBRARIES})
+- target_link_libraries(runtime LIBBFD)
++ target_link_libraries(bpftraceruntime LIBBFD)
+ add_library(LIBOPCODES STATIC IMPORTED)
+ set_property(TARGET LIBOPCODES PROPERTY IMPORTED_LOCATION ${LIBOPCODES_LIBRARIES})
+- target_link_libraries(runtime LIBOPCODES)
++ target_link_libraries(bpftraceruntime LIBOPCODES)
+ add_library(LIBIBERTY STATIC IMPORTED)
+ set_property(TARGET LIBIBERTY PROPERTY IMPORTED_LOCATION ${LIBIBERTY_LIBRARIES})
+- target_link_libraries(runtime LIBIBERTY)
++ target_link_libraries(bpftraceruntime LIBIBERTY)
+ else()
+- target_link_libraries(runtime ${LIBBFD_LIBRARIES})
+- target_link_libraries(runtime ${LIBOPCODES_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBBFD_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBOPCODES_LIBRARIES})
+ endif(STATIC_LINKING)
+ endif(HAVE_BFD_DISASM)
+
+ # Link to bcc libraries (without LLVM) if possible
+ if(LIBBCC_BPF_CONTAINS_RUNTIME)
+- target_link_libraries(runtime ${LIBBCC_BPF_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBBCC_BPF_LIBRARIES})
+ else()
+- target_link_libraries(runtime ${LIBBCC_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBBCC_LIBRARIES})
+ endif()
+
+ if(STATIC_BPF_BCC)
+ # These are not part of the static libbcc so have to be added separate
+- target_link_libraries(runtime ${LIBBCC_BPF_LIBRARIES})
+- target_link_libraries(runtime ${LIBBPF_LIBRARIES})
+- target_link_libraries(runtime ${LIBBCC_LOADER_LIBRARY_STATIC})
++ target_link_libraries(bpftraceruntime ${LIBBCC_BPF_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBBPF_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBBCC_LOADER_LIBRARY_STATIC})
+
+ add_library(LIBELF STATIC IMPORTED)
+ set_property(TARGET LIBELF PROPERTY IMPORTED_LOCATION ${LIBELF_LIBRARIES})
+- target_link_libraries(runtime LIBELF)
++ set_property(TARGET LIBELF PROPERTY IMPORTED_LOCATION ${LIBBPF_LIBRARIES})
++ target_link_libraries(bpftraceruntime LIBELF)
+ else()
+- target_link_libraries(runtime ${LIBELF_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBELF_LIBRARIES})
+ endif(STATIC_BPF_BCC)
+
+ if (LIBDW_FOUND)
+@@ -182,16 +185,16 @@ if (LIBDW_FOUND)
+ set_property(TARGET LIBDW PROPERTY IMPORTED_LOCATION ${LIBDW_LIBRARIES})
+ target_link_libraries(LIBDW INTERFACE LIBBZ2 LIBELF LIBLZMA)
+
+- target_link_libraries(runtime LIBDW)
++ target_link_libraries(bpftraceruntime LIBDW)
+ else()
+- target_link_libraries(runtime ${LIBDW_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBDW_LIBRARIES})
+ endif()
+ endif()
+
+ # Support for std::filesystem
+ # GCC version <9 and Clang (all versions) require -lstdc++fs
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "9")
+- target_link_libraries(runtime "stdc++fs")
++ target_link_libraries(bpftraceruntime "stdc++fs")
+ target_link_libraries(libbpftrace "stdc++fs")
+ endif()
+
+@@ -213,16 +216,16 @@ endif()
+ if (STATIC_LINKING)
+ if(ANDROID)
+ target_link_libraries(libbpftrace "-Wl,-Bdynamic" "-ldl" "-lm" "-lz")
+- target_link_libraries(runtime "-Wl,-Bdynamic" "-ldl" "-lm" "-lz")
++ target_link_libraries(bpftraceruntime "-Wl,-Bdynamic" "-ldl" "-lm" "-lz")
+ else()
+ target_link_libraries(libbpftrace "-Wl,-Bdynamic" "-lrt" "-lpthread" "-ldl" "-lm")
+ target_link_libraries(libbpftrace "-Wl,-Bstatic" "-lz")
+- target_link_libraries(runtime "-Wl,-Bdynamic" "-lrt" "-lpthread" "-ldl" "-lm")
+- target_link_libraries(runtime "-Wl,-Bstatic" "-lz")
++ target_link_libraries(bpftraceruntime "-Wl,-Bdynamic" "-lrt" "-lpthread" "-ldl" "-lm")
++ target_link_libraries(bpftraceruntime "-Wl,-Bstatic" "-lz")
+ endif()
+ elseif(STATIC_BPF_BCC)
+ # partial static build, libbpf needs zlib
+- target_link_libraries(runtime "-lz")
++ target_link_libraries(bpftraceruntime "-lz")
+ endif()
+
+ unset(MAIN_SRC)
+diff --git a/src/aot/CMakeLists.txt b/src/aot/CMakeLists.txt
+index c776d204..41e84317 100644
+--- a/src/aot/CMakeLists.txt
++++ b/src/aot/CMakeLists.txt
+@@ -1,8 +1,9 @@
+ add_library(aot aot.cpp)
+-add_dependencies(aot parser)
++add_dependencies(aot bpftraceparser)
+ target_include_directories(aot PUBLIC ${CMAKE_SOURCE_DIR}/src)
+ target_include_directories(aot PUBLIC ${CMAKE_BINARY_DIR})
+ target_compile_definitions(aot PRIVATE ${BPFTRACE_FLAGS})
++install(TARGETS aot LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+ # Only build aotrt if supported bcc is used
+ # (https://github.com/iovisor/bcc/commit/719191867a25ce07dc96f7faf9b8ccedadc7ec44)
+@@ -11,7 +12,7 @@ if(NOT LIBBCC_BPF_CONTAINS_RUNTIME)
+ endif()
+
+ add_executable(bpftrace-aotrt aot_main.cpp)
+-target_link_libraries(bpftrace-aotrt aot runtime arch ast_defs cxxdemangler_stdlib)
++target_link_libraries(bpftrace-aotrt aot bpftraceruntime bpftracearch ast_defs cxxdemangler_stdlib)
+ install(TARGETS bpftrace-aotrt DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+ if(LIBPCAP_FOUND)
+diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt
+index d01d1ea3..7d96587f 100644
+--- a/src/arch/CMakeLists.txt
++++ b/src/arch/CMakeLists.txt
+@@ -1,21 +1,21 @@
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
+- add_library(arch aarch64.cpp)
++ add_library(bpftracearch aarch64.cpp)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a")
+- add_library(arch arm.cpp)
++ add_library(bpftracearch arm.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 "s390" OR
+ CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x")
+- add_library(arch s390.cpp)
++ add_library(bpftracearch s390.cpp)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+- add_library(arch x86_64.cpp)
++ add_library(bpftracearch x86_64.cpp)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "mips64")
+- add_library(arch mips64.cpp)
++ add_library(bpftracearch mips64.cpp)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
+- add_library(arch riscv64.cpp)
++ add_library(bpftracearch riscv64.cpp)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "loongarch64")
+- add_library(arch loongarch64.cpp)
++ add_library(bpftracearch loongarch64.cpp)
+ else()
+ message(FATAL_ERROR "Unsupported architecture: ${CMAKE_SYSTEM_PROCESSOR}")
+ endif()
+diff --git a/src/ast/CMakeLists.txt b/src/ast/CMakeLists.txt
+index c390ea6a..37019bd9 100644
+--- a/src/ast/CMakeLists.txt
++++ b/src/ast/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ add_library(ast_defs ast.cpp)
+
+-add_library(ast
++add_library(bpftraceast
+ async_event_types.cpp
+ attachpoint_parser.cpp
+ elf_parser.cpp
+@@ -21,11 +21,13 @@ add_library(ast
+ target_include_directories(ast_defs PUBLIC ${CMAKE_SOURCE_DIR}/src)
+ target_include_directories(ast_defs PUBLIC ${CMAKE_SOURCE_DIR}/src/ast)
+ target_include_directories(ast_defs PUBLIC ${CMAKE_BINARY_DIR})
+-target_link_libraries(ast ast_defs arch parser)
++target_link_libraries(bpftraceast ast_defs bpftracearch bpftraceparser)
++install(TARGETS ast_defs LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
++install(TARGETS bpftraceast LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+-add_dependencies(ast_defs parser)
++add_dependencies(ast_defs bpftraceparser)
+
+-target_compile_definitions(ast PRIVATE ${BPFTRACE_FLAGS})
++target_compile_definitions(bpftraceast PRIVATE ${BPFTRACE_FLAGS})
+
+ if (STATIC_LINKING)
+ set(clang_libs
+@@ -58,20 +60,20 @@ if (STATIC_LINKING)
+
+
+ if(EMBED_USE_LLVM)
+- target_link_libraries(ast "-Wl,--start-group" ${CLANG_EMBEDDED_CMAKE_TARGETS} ${LLVM_EMBEDDED_CMAKE_TARGETS} "-Wl,--end-group")
++ target_link_libraries(bpftraceast "-Wl,--start-group" ${CLANG_EMBEDDED_CMAKE_TARGETS} ${LLVM_EMBEDDED_CMAKE_TARGETS} "-Wl,--end-group")
+ else()
+ llvm_map_components_to_libnames(llvm_libs ${llvm_lib_names})
+
+ if(TARGET libclang_static)
+- target_link_libraries(ast libclang_static)
++ target_link_libraries(bpftraceast libclang_static)
+ else()
+ # old LLVM versions don't export libclang_static in ClangTargets.cmake; fall back to
+ # libclang.a in that case
+- target_link_libraries(ast libclang.a)
++ target_link_libraries(abpftracest libclang.a)
+ endif()
+
+- target_link_libraries(ast ${clang_libs})
+- target_link_libraries(ast ${llvm_libs})
++ target_link_libraries(abpftracest ${clang_libs})
++ target_link_libraries(abpftracest ${llvm_libs})
+ endif()
+
+ if(STATIC_LIBC)
+@@ -81,11 +83,11 @@ if (STATIC_LINKING)
+ 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/src/cxxdemangler/CMakeLists.txt b/src/cxxdemangler/CMakeLists.txt
+index 04cfcdd9..5677aa4b 100644
+--- a/src/cxxdemangler/CMakeLists.txt
++++ b/src/cxxdemangler/CMakeLists.txt
+@@ -1,2 +1,4 @@
+ add_library(cxxdemangler_stdlib cxxdemangler_stdlib.cpp)
+ add_library(cxxdemangler_llvm cxxdemangler_llvm.cpp)
++install(TARGETS cxxdemangler_stdlib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
++install(TARGETS cxxdemangler_llvm LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2023-01-30 19:10 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2023-01-30 19:10 UTC (permalink / raw
To: gentoo-commits
commit: 8a1f60be59370d648a6216df8586c7f316f7f21d
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 30 19:08:30 2023 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Mon Jan 30 19:10:12 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a1f60be
dev-util/bpftrace: drop 0.15.0-r2
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/bpftrace-0.15.0-r2.ebuild | 95 ----------
.../bpftrace/files/bpftrace-0.15.0-bcc-025.patch | 88 ---------
.../files/bpftrace-0.15.0-binutils-2.39.patch | 87 ---------
.../files/bpftrace-0.15.0-dont-compress-man.patch | 47 -----
.../files/bpftrace-0.15.0-install-libs.patch | 199 ---------------------
5 files changed, 516 deletions(-)
diff --git a/dev-util/bpftrace/bpftrace-0.15.0-r2.ebuild b/dev-util/bpftrace/bpftrace-0.15.0-r2.ebuild
deleted file mode 100644
index f0998d9f30ca..000000000000
--- a/dev-util/bpftrace/bpftrace-0.15.0-r2.ebuild
+++ /dev/null
@@ -1,95 +0,0 @@
-# Copyright 2019-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-LLVM_MAX_SLOT=15
-
-inherit llvm linux-info cmake toolchain-funcs
-
-DESCRIPTION="High-level tracing language for eBPF"
-HOMEPAGE="https://github.com/iovisor/bpftrace"
-MY_PV="${PV//_/}"
-SRC_URI="
- https://github.com/iovisor/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz
- https://dev.gentoo.org/~chutzpah/dist/bpftrace/bpftrace-0.14.1-llvm14.patch.gz
-"
-S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-KEYWORDS="~amd64 ~arm64 ~x86"
-IUSE="fuzzing test"
-# lots of fixing needed
-RESTRICT="test"
-
-RDEPEND="
- >=dev-libs/libbpf-0.8:=
- <dev-libs/libbpf-1.0:=
- >=dev-util/bcc-0.13.0:=
- dev-util/systemtap
- <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):=
- <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):=[llvm_targets_BPF(+)]
- sys-libs/binutils-libs:=
- virtual/libelf:=
-"
-DEPEND="
- ${COMMON_DEPEND}
- dev-libs/cereal:=
- test? ( dev-cpp/gtest )
-"
-BDEPEND="
- app-arch/xz-utils
- sys-devel/flex
- sys-devel/bison
- virtual/pkgconfig
-"
-
-QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so"
-
-PATCHES=(
- "${FILESDIR}/bpftrace-0.15.0-install-libs.patch"
- "${FILESDIR}/bpftrace-0.15.0-dont-compress-man.patch"
- "${FILESDIR}/bpftrace-0.11.4-old-kernels.patch"
- "${FILESDIR}/bpftrace-0.15.0-bcc-025.patch"
- "${FILESDIR}/bpftrace-0.15.0-binutils-2.39.patch"
- "${FILESDIR}/bpftrace-0.15.0-llvm-15-pointers.patch"
-)
-
-pkg_pretend() {
- local CONFIG_CHECK="
- ~BPF
- ~BPF_EVENTS
- ~BPF_JIT
- ~BPF_SYSCALL
- ~FTRACE_SYSCALLS
- ~HAVE_EBPF_JIT
- "
-
- check_extra_config
-}
-
-pkg_setup() {
- llvm_pkg_setup
-}
-
-src_configure() {
- local mycmakeargs=(
- -DSTATIC_LINKING:BOOL=OFF
- # bug 809362, 754648
- -DBUILD_SHARED_LIBS:=OFF
- -DBUILD_TESTING:BOOL=OFF
- -DBUILD_FUZZ:BOOL=$(usex fuzzing)
- -DENABLE_MAN:BOOL=OFF
- -DLIBBPF_INCLUDE_DIRS="$($(tc-getPKG_CONFIG) --cflags-only-I libbpf | sed 's:-I::g')"
- )
-
- cmake_src_configure
-}
-
-src_install() {
- cmake_src_install
- # bug 809362
- dostrip -x /usr/bin/bpftrace
- doman man/man8/*.?
-}
diff --git a/dev-util/bpftrace/files/bpftrace-0.15.0-bcc-025.patch b/dev-util/bpftrace/files/bpftrace-0.15.0-bcc-025.patch
deleted file mode 100644
index ef2ca76e1c50..000000000000
--- a/dev-util/bpftrace/files/bpftrace-0.15.0-bcc-025.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From f86c3bde84d9e75ec2780a51a1ca7dc20a4740e6 Mon Sep 17 00:00:00 2001
-From: Dominique Martinet <asmadeus@codewreck.org>
-Date: Thu, 25 Aug 2022 21:47:30 +0900
-Subject: [PATCH] Fix builds against bcc >= 0.25.0
-
-libbpf 1.0.0 removed bpf_load_program_attr in
-https://github.com/libbpf/libbpf/commit/9476dce6fe905a6bf1d4c483f7b2b8575c4ffb2d
-and bcc 0.25.0 in turn changed bcc_prog_load_xattr to use
-bpf_prog_load_opts instead in
-https://github.com/iovisor/bcc/commit/185143bdec6134255363446f644acd766ffb3825
-
-Add a compile check to use the appropriate version
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index c5c4c39630d2..f23b2ba52740 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -138,7 +138,7 @@ check_symbol_exists(bpf_attach_kfunc "${LIBBCC_INCLUDE_DIRS}/bcc/libbpf.h" HAVE_
- check_symbol_exists(bcc_usdt_addsem_probe "${LIBBCC_INCLUDE_DIRS}/bcc/bcc_usdt.h" HAVE_BCC_USDT_ADDSEM)
- check_symbol_exists(bcc_procutils_which_so "${LIBBCC_INCLUDE_DIRS}/bcc/bcc_proc.h" HAVE_BCC_WHICH_SO)
-
--# bcc_prog_load_xattr needs struct bpf_load_program_attr,
-+# bcc_prog_load_xattr needs struct bpf_prog_load_opts or bpf_load_program_attr,
- # which is defined in libbpf
- if (LIBBPF_FOUND)
- check_symbol_exists(bcc_prog_load_xattr "${LIBBCC_INCLUDE_DIRS}/bcc/libbpf.h" HAVE_BCC_PROG_LOAD_XATTR)
-@@ -236,6 +236,10 @@ if(LIBBCC_ATTACH_UPROBE_SEVEN_ARGS_SIGNATURE)
- set(BPFTRACE_FLAGS "${BPFTRACE_FLAGS}" LIBBCC_ATTACH_UPROBE_SEVEN_ARGS_SIGNATURE)
- endif(LIBBCC_ATTACH_UPROBE_SEVEN_ARGS_SIGNATURE)
-
-+if(LIBBCC_PROG_LOAD_XATTRS_WITH_OPTS)
-+ set(BPFTRACE_FLAGS "${BPFTRACE_FLAGS}" LIBBCC_PROG_LOAD_XATTRS_WITH_OPTS)
-+endif(LIBBCC_PROG_LOAD_XATTRS_WITH_OPTS)
-+
- if (HAVE_BCC_KFUNC)
- set(BPFTRACE_FLAGS "${BPFTRACE_FLAGS}" HAVE_BCC_KFUNC)
- endif(HAVE_BCC_KFUNC)
-diff --git a/cmake/FindLibBcc.cmake b/cmake/FindLibBcc.cmake
-index 7b4f12835786..20d2e68cd75f 100644
---- a/cmake/FindLibBcc.cmake
-+++ b/cmake/FindLibBcc.cmake
-@@ -85,6 +85,16 @@ int main(void) {
- return 0;
- }
- " LIBBCC_ATTACH_UPROBE_SEVEN_ARGS_SIGNATURE)
-+CHECK_CXX_SOURCE_COMPILES("
-+#include <bcc/libbpf.h>
-+
-+int main(void) {
-+ struct bpf_prog_load_opts *opts = (struct bpf_prog_load_opts*) 1;
-+
-+ bcc_prog_load_xattr(BPF_PROG_TYPE_UNSPEC, 0, 0, 0, opts, 0, 0, 0, true);
-+ return 0;
-+}
-+" LIBBCC_PROG_LOAD_XATTRS_WITH_OPTS)
- SET(CMAKE_REQUIRED_INCLUDES)
-
- SET(CMAKE_REQUIRED_LIBRARIES ${LIBBCC_BPF_LIBRARIES})
-diff --git a/src/attached_probe.cpp b/src/attached_probe.cpp
-index 60778e53ce44..dd46f15fd8d2 100644
---- a/src/attached_probe.cpp
-+++ b/src/attached_probe.cpp
-@@ -731,7 +731,24 @@ void AttachedProbe::load_prog()
- continue;
- }
-
--#ifdef HAVE_BCC_PROG_LOAD_XATTR
-+#ifdef LIBBCC_PROG_LOAD_XATTRS_WITH_OPTS
-+ struct bpf_prog_load_opts opts = { };
-+
-+ opts.sz = sizeof(opts);
-+ opts.log_level = log_level;
-+
-+ progfd_ = bcc_prog_load_xattr(
-+ progtype(probe_.type),
-+ name.c_str(),
-+ license,
-+ reinterpret_cast<struct bpf_insn *>(insns),
-+ &opts,
-+ prog_len,
-+ log_buf.get(),
-+ log_buf_size,
-+ true);
-+
-+#elif HAVE_BCC_PROG_LOAD_XATTR
- struct bpf_load_program_attr attr = {};
-
- attr.prog_type = progtype(probe_.type);
diff --git a/dev-util/bpftrace/files/bpftrace-0.15.0-binutils-2.39.patch b/dev-util/bpftrace/files/bpftrace-0.15.0-binutils-2.39.patch
deleted file mode 100644
index cb4b8a9bb2d2..000000000000
--- a/dev-util/bpftrace/files/bpftrace-0.15.0-binutils-2.39.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-
-Patch taken from: https://github.com/iovisor/bpftrace/pull/2328
-Removed hunk #1 (CHANGELOG.md) since it conflicts and is not required.
-Bug: https://bugs.gentoo.org/868120
-
-From 3be6e708d514d3378a4fe985ab907643ecbc77ee Mon Sep 17 00:00:00 2001
-From: Viktor Malik <viktor.malik@gmail.com>
-Date: Mon, 15 Aug 2022 15:13:14 +0200
-Subject: [PATCH] Fix builds against libbfd(binutils) >=2.39
-
-Binutils 2.39 changed signature of the init_disassemble_info function by
-adding an extra parameter for styled printf function. Let CMake detect
-which of the versions is present and call it appropriately.
----
- CHANGELOG.md | 2 ++
- CMakeLists.txt | 3 +++
- cmake/FindLibBfd.cmake | 10 ++++++++++
- src/bfd-disasm.cpp | 14 ++++++++++++++
- 4 files changed, 29 insertions(+)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 8f7995afd2..2e54eb84f8 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -249,6 +249,9 @@ if(HAVE_BFD_DISASM)
- if(LIBBFD_DISASM_FOUR_ARGS_SIGNATURE)
- set(BPFTRACE_FLAGS "${BPFTRACE_FLAGS}" LIBBFD_DISASM_FOUR_ARGS_SIGNATURE)
- endif(LIBBFD_DISASM_FOUR_ARGS_SIGNATURE)
-+ if(LIBBFD_INIT_DISASM_INFO_FOUR_ARGS_SIGNATURE)
-+ set(BPFTRACE_FLAGS "${BPFTRACE_FLAGS}" LIBBFD_INIT_DISASM_INFO_FOUR_ARGS_SIGNATURE)
-+ endif(LIBBFD_INIT_DISASM_INFO_FOUR_ARGS_SIGNATURE)
- endif(HAVE_BFD_DISASM)
-
- if (LIBBPF_BTF_DUMP_FOUND)
-diff --git a/cmake/FindLibBfd.cmake b/cmake/FindLibBfd.cmake
-index 4f4b8c4e20..5d917b188c 100644
---- a/cmake/FindLibBfd.cmake
-+++ b/cmake/FindLibBfd.cmake
-@@ -75,5 +75,15 @@ int main(void) {
- abfd);
- return 0;
- }" LIBBFD_DISASM_FOUR_ARGS_SIGNATURE)
-+CHECK_CXX_SOURCE_COMPILES("
-+// See comment in bfd-disasm.cpp for why this needs to exist
-+#define PACKAGE \"bpftrace-test\"
-+#include <dis-asm.h>
-+
-+int main(void) {
-+ init_disassemble_info(NULL, NULL, NULL, NULL);
-+ return 0;
-+}
-+" LIBBFD_INIT_DISASM_INFO_FOUR_ARGS_SIGNATURE)
- SET(CMAKE_REQUIRED_LIBRARIES)
- endif()
-diff --git a/src/bfd-disasm.cpp b/src/bfd-disasm.cpp
-index f846468cd8..d4165dfac5 100644
---- a/src/bfd-disasm.cpp
-+++ b/src/bfd-disasm.cpp
-@@ -38,6 +38,16 @@ static int fprintf_nop(void *out __attribute__((unused)), const char *fmt __attr
- return 0;
- }
-
-+#ifdef LIBBFD_INIT_DISASM_INFO_FOUR_ARGS_SIGNATURE
-+static int fprintf_styled_nop(void *out __attribute__((unused)),
-+ enum disassembler_style s __attribute__((unused)),
-+ const char *fmt __attribute__((unused)),
-+ ...)
-+{
-+ return 0;
-+}
-+#endif
-+
- static AlignState is_aligned_buf(void *buf, uint64_t size, uint64_t offset)
- {
- disassembler_ftype disassemble;
-@@ -55,7 +65,11 @@ static AlignState is_aligned_buf(void *buf, uint64_t size, uint64_t offset)
- return AlignState::Fail;
- }
-
-+#ifdef LIBBFD_INIT_DISASM_INFO_FOUR_ARGS_SIGNATURE
-+ init_disassemble_info(&info, stdout, fprintf_nop, fprintf_styled_nop);
-+#else
- init_disassemble_info(&info, stdout, fprintf_nop);
-+#endif
-
- info.arch = bfd_get_arch(bfdf);
- info.mach = bfd_get_mach(bfdf);
diff --git a/dev-util/bpftrace/files/bpftrace-0.15.0-dont-compress-man.patch b/dev-util/bpftrace/files/bpftrace-0.15.0-dont-compress-man.patch
deleted file mode 100644
index 84241e052462..000000000000
--- a/dev-util/bpftrace/files/bpftrace-0.15.0-dont-compress-man.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-diff --git a/man/adoc/CMakeLists.txt b/man/adoc/CMakeLists.txt
-index 1a81dee0..c93ccbd2 100644
---- a/man/adoc/CMakeLists.txt
-+++ b/man/adoc/CMakeLists.txt
-@@ -1,7 +1,5 @@
--find_program(GZIP gzip REQUIRED)
- find_program(ASCIIDOCTOR asciidoctor)
- file(GLOB FILES *.adoc)
--set(GZFILES "")
- if(NOT "${ASCIIDOCTOR}" STREQUAL "ASCIIDOCTOR-NOTFOUND")
- foreach(FIL ${FILES})
- get_filename_component(NAME ${FIL} NAME_WE)
-@@ -12,14 +10,9 @@ if(NOT "${ASCIIDOCTOR}" STREQUAL "ASCIIDOCTOR-NOTFOUND")
- COMMAND ${ASCIIDOCTOR} ${FIL} -b manpage -o - > ${MANPAGE_FILE}
- DEPENDS ${FIL})
-
-- add_custom_command(OUTPUT ${GZ_MANPAGE_FILE}
-- COMMAND ${GZIP} -c ${MANPAGE_FILE} > ${GZ_MANPAGE_FILE}
-- DEPENDS ${MANPAGE_FILE})
--
-- list(APPEND GZFILES ${GZ_MANPAGE_FILE})
- endforeach()
-- add_custom_target(adoc_man DEPENDS ${GZFILES})
-- install(FILES ${GZFILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
-+ add_custom_target(adoc_man DEPENDS ${FILES})
-+ install(FILES ${FILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
- else()
- message(WARNING "asciidoctor not found, building without bpftrace manpage")
- add_custom_target(adoc_man)
-diff --git a/man/man8/CMakeLists.txt b/man/man8/CMakeLists.txt
-index 2a316cd9..2207cf80 100644
---- a/man/man8/CMakeLists.txt
-+++ b/man/man8/CMakeLists.txt
-@@ -1,12 +1,3 @@
--find_program(GZIP gzip REQUIRED)
- 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_man 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.15.0-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.15.0-install-libs.patch
deleted file mode 100644
index b20e39e4d268..000000000000
--- a/dev-util/bpftrace/files/bpftrace-0.15.0-install-libs.patch
+++ /dev/null
@@ -1,199 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index c5c4c396..4bc3e499 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -103,9 +103,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 a95c60a1..f5c4d676 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 66a7fd66..738d9327 100644
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -41,7 +41,7 @@ add_library(runtime
- ${BFD_DISASM_SRC}
- )
- # Ensure flex+bison outputs are built first
--add_dependencies(runtime parser)
-+add_dependencies(runtime bpftraceparser)
-
- add_library(libbpftrace
- build_info.cpp
-@@ -58,6 +58,7 @@ add_executable(${BPFTRACE}
- )
-
- install(TARGETS ${BPFTRACE} DESTINATION ${CMAKE_INSTALL_BINDIR})
-+install(TARGETS libbpftrace LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
- target_link_libraries(${BPFTRACE} libbpftrace)
-
- if (BUILD_FUZZ)
-@@ -110,6 +111,7 @@ target_include_directories(runtime PRIVATE ${CMAKE_BINARY_DIR})
- target_include_directories(runtime PRIVATE ${CMAKE_SOURCE_DIR}/src)
- target_include_directories(runtime PRIVATE ${CMAKE_SOURCE_DIR}/src/ast)
- target_compile_definitions(runtime PRIVATE ${BPFTRACE_FLAGS})
-+install(TARGETS runtime LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
- target_compile_definitions(libbpftrace PRIVATE ${BPFTRACE_FLAGS})
-
- # Linking
-@@ -122,7 +124,8 @@ if(STATIC_LINKING)
- endif(STATIC_LINKING)
-
-
--target_link_libraries(libbpftrace parser resources runtime aot ast arch cxxdemangler_llvm)
-+target_link_libraries(libbpftrace bpftraceparser bpftraceresources
-+ runtime aot bpftraceast bpftracearch cxxdemangler_llvm)
-
- if (LIBBPF_BTF_DUMP_FOUND)
- target_include_directories(runtime PUBLIC ${LIBBPF_INCLUDE_DIRS})
-diff --git a/src/aot/CMakeLists.txt b/src/aot/CMakeLists.txt
-index 291d53f2..22944ddc 100644
---- a/src/aot/CMakeLists.txt
-+++ b/src/aot/CMakeLists.txt
-@@ -2,6 +2,7 @@ add_library(aot aot.cpp)
- target_include_directories(aot PUBLIC ${CMAKE_SOURCE_DIR}/src)
- target_include_directories(aot PUBLIC ${CMAKE_BINARY_DIR})
- target_compile_definitions(aot PRIVATE ${BPFTRACE_FLAGS})
-+install(TARGETS aot LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-
- # Only build aotrt if supported bcc is used
- # (https://github.com/iovisor/bcc/commit/719191867a25ce07dc96f7faf9b8ccedadc7ec44)
-@@ -10,7 +11,7 @@ if(NOT LIBBCC_BPF_CONTAINS_RUNTIME)
- endif()
-
- add_executable(bpftrace-aotrt aot_main.cpp)
--target_link_libraries(bpftrace-aotrt aot runtime arch ast_defs cxxdemangler_stdlib)
-+target_link_libraries(bpftrace-aotrt aot runtime bpftracearch ast_defs cxxdemangler_stdlib)
- install(TARGETS bpftrace-aotrt DESTINATION ${CMAKE_INSTALL_BINDIR})
-
- # Linking
-diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt
-index 127c3528..4e05d40a 100644
---- a/src/arch/CMakeLists.txt
-+++ b/src/arch/CMakeLists.txt
-@@ -1,17 +1,19 @@
- 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 "s390" OR
- CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x")
-- add_library(arch s390.cpp)
-+ add_library(bpftracearch s390.cpp)
- elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
-- add_library(arch x86_64.cpp)
-+ add_library(bpftracearch x86_64.cpp)
- elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "mips64")
-- add_library(arch mips64.cpp)
-+ add_library(bpftracearch mips64.cpp)
- elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
-- add_library(arch riscv64.cpp)
-+ add_library(bpftracearch riscv64.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 014295cd..c35f6ac6 100644
---- a/src/ast/CMakeLists.txt
-+++ b/src/ast/CMakeLists.txt
-@@ -1,6 +1,6 @@
- add_library(ast_defs ast.cpp)
-
--add_library(ast
-+add_library(bpftraceast
- async_event_types.cpp
- attachpoint_parser.cpp
- int_parser.cpp
-@@ -20,11 +20,13 @@ add_library(ast
- target_include_directories(ast_defs PUBLIC ${CMAKE_SOURCE_DIR}/src)
- target_include_directories(ast_defs PUBLIC ${CMAKE_SOURCE_DIR}/src/ast)
- target_include_directories(ast_defs PUBLIC ${CMAKE_BINARY_DIR})
--target_link_libraries(ast ast_defs arch bpforc parser)
-+target_link_libraries(bpftraceast ast_defs bpftracearch bpforc bpftraceparser)
-+install(TARGETS ast_defs LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-+install(TARGETS bpftraceast LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-
--add_dependencies(ast_defs parser)
-+add_dependencies(ast_defs bpftraceparser)
-
--target_compile_definitions(ast PRIVATE ${BPFTRACE_FLAGS})
-+target_compile_definitions(bpftraceast PRIVATE ${BPFTRACE_FLAGS})
-
- if (STATIC_LINKING)
- set(clang_libs
-@@ -55,11 +57,11 @@ if (STATIC_LINKING)
-
-
- if(EMBED_USE_LLVM)
-- target_link_libraries(ast "-Wl,--start-group" ${CLANG_EMBEDDED_CMAKE_TARGETS} ${LLVM_EMBEDDED_CMAKE_TARGETS} "-Wl,--end-group")
-+ target_link_libraries(bpftraceast "-Wl,--start-group" ${CLANG_EMBEDDED_CMAKE_TARGETS} ${LLVM_EMBEDDED_CMAKE_TARGETS} "-Wl,--end-group")
- else()
- llvm_map_components_to_libnames(llvm_libs ${llvm_lib_names})
-- 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()
-
- if(STATIC_LIBC)
-@@ -69,13 +71,13 @@ if (STATIC_LINKING)
- 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()
-
- add_subdirectory(bpforc)
-diff --git a/src/ast/bpforc/CMakeLists.txt b/src/ast/bpforc/CMakeLists.txt
-index 3f6dbefa..8ccfbb2b 100644
---- a/src/ast/bpforc/CMakeLists.txt
-+++ b/src/ast/bpforc/CMakeLists.txt
-@@ -1 +1,2 @@
- add_library(bpforc bpforc.cpp)
-+install(TARGETS bpforc LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-diff --git a/src/cxxdemangler/CMakeLists.txt b/src/cxxdemangler/CMakeLists.txt
-index 04cfcdd9..5677aa4b 100644
---- a/src/cxxdemangler/CMakeLists.txt
-+++ b/src/cxxdemangler/CMakeLists.txt
-@@ -1,2 +1,4 @@
- add_library(cxxdemangler_stdlib cxxdemangler_stdlib.cpp)
- add_library(cxxdemangler_llvm cxxdemangler_llvm.cpp)
-+install(TARGETS cxxdemangler_stdlib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-+install(TARGETS cxxdemangler_llvm LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2023-09-19 18:32 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2023-09-19 18:32 UTC (permalink / raw
To: gentoo-commits
commit: c3a27f1d619823900583b34c9e5fe304a0efb2e4
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 19 18:31:41 2023 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Sep 19 18:32:05 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3a27f1d
dev-util/bpftrace: drop 0.17.1
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/Manifest | 1 -
dev-util/bpftrace/bpftrace-0.17.1.ebuild | 97 ------
.../files/bpftrace-0.17.0-install-libs.patch | 329 ---------------------
.../bpftrace/files/bpftrace-0.17.0-llvm-16.patch | 26 --
.../files/bpftrace-0.17.0-use-std-optional.patch | 44 ---
5 files changed, 497 deletions(-)
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest
index 198bdcf06805..52e5415f547e 100644
--- a/dev-util/bpftrace/Manifest
+++ b/dev-util/bpftrace/Manifest
@@ -1,4 +1,3 @@
-DIST bpftrace-0.17.1.gh.tar.gz 1035345 BLAKE2B 5dca6f3fc49458b4b2ed3068e3f99f1156067c430af36b53949e469a870101d2da6aba6c4d18bfaf173cc45eab18e3c316966a5e222a4b4cea98363a9afd90ce SHA512 57f00a0b209d745efe5ce39d0e8efb90a21b5c499b41385814378d828ef507dc2c6d9497f9d23dbb610fcff21f077cba9f7481e7a6a6465825065743289ef4ad
DIST bpftrace-0.18.0.gh.tar.gz 1046210 BLAKE2B 921fdd56cff48e7b8fc2b8164839393f2759218accaa58412fdf80b2df4474067c3c660da09e3ee808d258c1f19b0534fa81462cbea5ce3e814bdbeaa7dce5aa SHA512 b7da273d251f03a81b3a7097407352e7ad1d023972852bdb883176e97bab7046f9f327bd03bca51fe853ecaab5f60adc6994e75cb450a033a5b91118f719c36d
DIST bpftrace-0.18.1.gh.tar.gz 1046307 BLAKE2B 67c5d586e803c16ae0338563953e86cb3fbf318410f5757824a56fdf049b4b4fe5cc2d2b7e0435c625728b0b25123bcc8d64eaa923c14334d9ec23075c8deeec SHA512 eb81554f4707f8c919930932ff6ec7602578c317c058238a16fe38d6db055da0d7b355733821203281767419aa8e1b2256bb7a921f50c987c85395ecfbda966a
DIST bpftrace-0.19.0.gh.tar.gz 1157739 BLAKE2B ebedebe365621436da7735e373dcb142ddad9c8869b8d1c20b227b8cf772b1005d79cec7eef16f7ef7b9f92b9061751986efe43bd102c7592051a549377161bf SHA512 727e1319e8bcb9b197636c2bd3145c1805e0772e268187a1c71979966f28c81e92347606be383f71f922f56df62afea8ac672d5d40fd0338b3687e0520fa3786
diff --git a/dev-util/bpftrace/bpftrace-0.17.1.ebuild b/dev-util/bpftrace/bpftrace-0.17.1.ebuild
deleted file mode 100644
index 21b7e21bf0fd..000000000000
--- a/dev-util/bpftrace/bpftrace-0.17.1.ebuild
+++ /dev/null
@@ -1,97 +0,0 @@
-# Copyright 2019-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-LLVM_MAX_SLOT=16
-
-inherit llvm linux-info cmake
-
-DESCRIPTION="High-level tracing language for eBPF"
-HOMEPAGE="https://github.com/iovisor/bpftrace"
-MY_PV="${PV//_/}"
-SRC_URI="https://github.com/iovisor/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.gh.tar.gz"
-S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-
-# remove keywords until build works:
-# https://github.com/iovisor/bpftrace/issues/2349
-KEYWORDS="~amd64 ~arm64 ~x86"
-IUSE="fuzzing test"
-
-# lots of fixing needed
-RESTRICT="test"
-
-RDEPEND="
- >=dev-libs/libbpf-1.1:=
- >=dev-util/bcc-0.25.0:=
- >=sys-devel/llvm-10[llvm_targets_BPF(+)]
- >=sys-devel/clang-10
- <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):=
- <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):=[llvm_targets_BPF(+)]
- sys-libs/binutils-libs:=
- virtual/libelf:=
-"
-DEPEND="
- ${COMMON_DEPEND}
- dev-libs/cereal:=
- test? ( dev-cpp/gtest )
-"
-BDEPEND="
- app-arch/xz-utils
- sys-devel/flex
- sys-devel/bison
- virtual/pkgconfig
-"
-
-QA_DT_NEEDED="
- /usr/lib.*/libbpftraceresources.so
- /usr/lib.*/libcxxdemangler_llvm.so
-"
-
-PATCHES=(
- "${FILESDIR}/bpftrace-0.17.0-install-libs.patch"
- "${FILESDIR}/bpftrace-0.15.0-dont-compress-man.patch"
- "${FILESDIR}/bpftrace-0.11.4-old-kernels.patch"
- "${FILESDIR}/bpftrace-0.17.0-llvm-16.patch"
- "${FILESDIR}/bpftrace-0.17.0-use-std-optional.patch"
-)
-
-pkg_pretend() {
- local CONFIG_CHECK="
- ~BPF
- ~BPF_EVENTS
- ~BPF_JIT
- ~BPF_SYSCALL
- ~FTRACE_SYSCALLS
- ~HAVE_EBPF_JIT
- "
-
- check_extra_config
-}
-
-pkg_setup() {
- llvm_pkg_setup
-}
-
-src_configure() {
- local mycmakeargs=(
- -DSTATIC_LINKING:BOOL=OFF
- # bug 809362, 754648
- -DBUILD_TESTING:BOOL=$(usex test)
- -DBUILD_FUZZ:BOOL=$(usex fuzzing)
- -DENABLE_MAN:BOOL=OFF
- -DUSE_SYSTEM_BPF_BCC:BOOL=ON
- )
-
- cmake_src_configure
-}
-
-src_install() {
- cmake_src_install
- # bug 809362
- dostrip -x /usr/bin/bpftrace
- doman man/man8/*.?
-}
diff --git a/dev-util/bpftrace/files/bpftrace-0.17.0-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.17.0-install-libs.patch
deleted file mode 100644
index 7c14f8f9416e..000000000000
--- a/dev-util/bpftrace/files/bpftrace-0.17.0-install-libs.patch
+++ /dev/null
@@ -1,329 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 0a7914f5..b9d8f47f 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -125,9 +125,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 a95c60a1..f5c4d676 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 ce16469a..98161980 100644
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -13,7 +13,7 @@ else()
- endif ()
- endif()
-
--add_library(runtime
-+add_library(bpftraceruntime
- attached_probe.cpp
- bpffeature.cpp
- bpftrace.cpp
-@@ -43,7 +43,7 @@ add_library(runtime
- ${BFD_DISASM_SRC}
- )
- # Ensure flex+bison outputs are built first
--add_dependencies(runtime parser)
-+add_dependencies(bpftraceruntime bpftraceparser)
-
- add_library(libbpftrace
- build_info.cpp
-@@ -60,6 +60,7 @@ add_executable(${BPFTRACE}
- )
-
- install(TARGETS ${BPFTRACE} DESTINATION ${CMAKE_INSTALL_BINDIR})
-+install(TARGETS libbpftrace LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
- target_link_libraries(${BPFTRACE} libbpftrace)
-
- if (BUILD_FUZZ)
-@@ -88,7 +89,7 @@ endif()
- set(KERNEL_HEADERS_DIR "" CACHE PATH "Hard-code kernel headers directory")
- if (KERNEL_HEADERS_DIR)
- MESSAGE(STATUS "Using KERNEL_HEADERS_DIR=${KERNEL_HEADERS_DIR}")
-- target_compile_definitions(runtime PUBLIC KERNEL_HEADERS_DIR="${KERNEL_HEADERS_DIR}")
-+ target_compile_definitions(bpftraceruntime PUBLIC KERNEL_HEADERS_DIR="${KERNEL_HEADERS_DIR}")
- endif()
-
- execute_process(
-@@ -108,10 +109,11 @@ endif()
-
- add_definitions("-DBPFTRACE_VERSION=\"${BPFTRACE_VERSION}\"")
-
--target_include_directories(runtime PRIVATE ${CMAKE_BINARY_DIR})
--target_include_directories(runtime PRIVATE ${CMAKE_SOURCE_DIR}/src)
--target_include_directories(runtime PRIVATE ${CMAKE_SOURCE_DIR}/src/ast)
--target_compile_definitions(runtime PRIVATE ${BPFTRACE_FLAGS})
-+target_include_directories(bpftraceruntime PRIVATE ${CMAKE_BINARY_DIR})
-+target_include_directories(bpftraceruntime PRIVATE ${CMAKE_SOURCE_DIR}/src)
-+target_include_directories(bpftraceruntime PRIVATE ${CMAKE_SOURCE_DIR}/src/ast)
-+target_compile_definitions(bpftraceruntime PRIVATE ${BPFTRACE_FLAGS})
-+install(TARGETS bpftraceruntime LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
- target_compile_definitions(libbpftrace PRIVATE ${BPFTRACE_FLAGS})
-
- # Linking
-@@ -124,8 +126,8 @@ if(STATIC_LINKING)
- endif(STATIC_LINKING)
-
-
--target_link_libraries(runtime ${LIBBPF_LIBRARIES})
--target_link_libraries(libbpftrace parser resources runtime aot ast arch cxxdemangler_llvm)
-+target_link_libraries(bpftraceruntime ${LIBBPF_LIBRARIES})
-+target_link_libraries(libbpftrace bpftraceparser bpftraceresources bpftraceruntime aot bpftraceast bpftracearch cxxdemangler_llvm)
-
- if(LIBPCAP_FOUND)
- target_link_libraries(libbpftrace ${LIBPCAP_LIBRARIES})
-@@ -135,37 +137,38 @@ if(HAVE_BFD_DISASM)
- if(STATIC_LINKING)
- add_library(LIBBFD STATIC IMPORTED)
- set_property(TARGET LIBBFD PROPERTY IMPORTED_LOCATION ${LIBBFD_LIBRARIES})
-- target_link_libraries(runtime LIBBFD)
-+ target_link_libraries(bpftraceruntime LIBBFD)
- add_library(LIBOPCODES STATIC IMPORTED)
- set_property(TARGET LIBOPCODES PROPERTY IMPORTED_LOCATION ${LIBOPCODES_LIBRARIES})
-- target_link_libraries(runtime LIBOPCODES)
-+ target_link_libraries(bpftraceruntime LIBOPCODES)
- add_library(LIBIBERTY STATIC IMPORTED)
- set_property(TARGET LIBIBERTY PROPERTY IMPORTED_LOCATION ${LIBIBERTY_LIBRARIES})
-- target_link_libraries(runtime LIBIBERTY)
-+ target_link_libraries(bpftraceruntime LIBIBERTY)
- else()
-- target_link_libraries(runtime ${LIBBFD_LIBRARIES})
-- target_link_libraries(runtime ${LIBOPCODES_LIBRARIES})
-+ target_link_libraries(bpftraceruntime ${LIBBFD_LIBRARIES})
-+ target_link_libraries(bpftraceruntime ${LIBOPCODES_LIBRARIES})
- endif(STATIC_LINKING)
- endif(HAVE_BFD_DISASM)
-
- # Link to bcc libraries (without LLVM) if possible
- if(LIBBCC_BPF_CONTAINS_RUNTIME)
-- target_link_libraries(runtime ${LIBBCC_BPF_LIBRARIES})
-+ target_link_libraries(bpftraceruntime ${LIBBCC_BPF_LIBRARIES})
- else()
-- target_link_libraries(runtime ${LIBBCC_LIBRARIES})
-+ target_link_libraries(bpftraceruntime ${LIBBCC_LIBRARIES})
- endif()
-
- if(STATIC_BPF_BCC)
- # These are not part of the static libbcc so have to be added separate
-- target_link_libraries(runtime ${LIBBCC_BPF_LIBRARIES})
-- target_link_libraries(runtime ${LIBBPF_LIBRARIES})
-- target_link_libraries(runtime ${LIBBCC_LOADER_LIBRARY_STATIC})
-+ target_link_libraries(bpftraceruntime ${LIBBCC_BPF_LIBRARIES})
-+ target_link_libraries(bpftraceruntime ${LIBBPF_LIBRARIES})
-+ target_link_libraries(bpftraceruntime ${LIBBCC_LOADER_LIBRARY_STATIC})
-
- add_library(LIBELF STATIC IMPORTED)
- set_property(TARGET LIBELF PROPERTY IMPORTED_LOCATION ${LIBELF_LIBRARIES})
-- target_link_libraries(runtime LIBELF)
-+ set_property(TARGET LIBELF PROPERTY IMPORTED_LOCATION ${LIBBPF_LIBRARIES})
-+ target_link_libraries(bpftraceruntime LIBELF)
- else()
-- target_link_libraries(runtime ${LIBELF_LIBRARIES})
-+ target_link_libraries(bpftraceruntime ${LIBELF_LIBRARIES})
- endif(STATIC_BPF_BCC)
-
- if (LIBDW_FOUND)
-@@ -182,16 +185,16 @@ if (LIBDW_FOUND)
- set_property(TARGET LIBDW PROPERTY IMPORTED_LOCATION ${LIBDW_LIBRARIES})
- target_link_libraries(LIBDW INTERFACE LIBBZ2 LIBELF LIBLZMA)
-
-- target_link_libraries(runtime LIBDW)
-+ target_link_libraries(bpftraceruntime LIBDW)
- else()
-- target_link_libraries(runtime ${LIBDW_LIBRARIES})
-+ target_link_libraries(bpftraceruntime ${LIBDW_LIBRARIES})
- endif()
- endif()
-
- # Support for std::filesystem
- # GCC version <9 and Clang (all versions) require -lstdc++fs
- if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "9")
-- target_link_libraries(runtime "stdc++fs")
-+ target_link_libraries(bpftraceruntime "stdc++fs")
- target_link_libraries(libbpftrace "stdc++fs")
- endif()
-
-@@ -213,16 +216,16 @@ endif()
- if (STATIC_LINKING)
- if(ANDROID)
- target_link_libraries(libbpftrace "-Wl,-Bdynamic" "-ldl" "-lm" "-lz")
-- target_link_libraries(runtime "-Wl,-Bdynamic" "-ldl" "-lm" "-lz")
-+ target_link_libraries(bpftraceruntime "-Wl,-Bdynamic" "-ldl" "-lm" "-lz")
- else()
- target_link_libraries(libbpftrace "-Wl,-Bdynamic" "-lrt" "-lpthread" "-ldl" "-lm")
- target_link_libraries(libbpftrace "-Wl,-Bstatic" "-lz")
-- target_link_libraries(runtime "-Wl,-Bdynamic" "-lrt" "-lpthread" "-ldl" "-lm")
-- target_link_libraries(runtime "-Wl,-Bstatic" "-lz")
-+ target_link_libraries(bpftraceruntime "-Wl,-Bdynamic" "-lrt" "-lpthread" "-ldl" "-lm")
-+ target_link_libraries(bpftraceruntime "-Wl,-Bstatic" "-lz")
- endif()
- elseif(STATIC_BPF_BCC)
- # partial static build, libbpf needs zlib
-- target_link_libraries(runtime "-lz")
-+ target_link_libraries(bpftraceruntime "-lz")
- endif()
-
- unset(MAIN_SRC)
-diff --git a/src/aot/CMakeLists.txt b/src/aot/CMakeLists.txt
-index c776d204..41e84317 100644
---- a/src/aot/CMakeLists.txt
-+++ b/src/aot/CMakeLists.txt
-@@ -1,8 +1,9 @@
- add_library(aot aot.cpp)
--add_dependencies(aot parser)
-+add_dependencies(aot bpftraceparser)
- target_include_directories(aot PUBLIC ${CMAKE_SOURCE_DIR}/src)
- target_include_directories(aot PUBLIC ${CMAKE_BINARY_DIR})
- target_compile_definitions(aot PRIVATE ${BPFTRACE_FLAGS})
-+install(TARGETS aot LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-
- # Only build aotrt if supported bcc is used
- # (https://github.com/iovisor/bcc/commit/719191867a25ce07dc96f7faf9b8ccedadc7ec44)
-@@ -11,7 +12,7 @@ if(NOT LIBBCC_BPF_CONTAINS_RUNTIME)
- endif()
-
- add_executable(bpftrace-aotrt aot_main.cpp)
--target_link_libraries(bpftrace-aotrt aot runtime arch ast_defs cxxdemangler_stdlib)
-+target_link_libraries(bpftrace-aotrt aot bpftraceruntime bpftracearch ast_defs cxxdemangler_stdlib)
- install(TARGETS bpftrace-aotrt DESTINATION ${CMAKE_INSTALL_BINDIR})
-
- if(LIBPCAP_FOUND)
-diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt
-index d01d1ea3..82bfeccc 100644
---- a/src/arch/CMakeLists.txt
-+++ b/src/arch/CMakeLists.txt
-@@ -1,21 +1,23 @@
- if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
-- add_library(arch aarch64.cpp)
-+ add_library(bpftracearch aarch64.cpp)
- elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a")
-- add_library(arch arm.cpp)
-+ add_library(bpftracearch arm.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 "s390" OR
- CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x")
-- add_library(arch s390.cpp)
-+ add_library(bpftracearch s390.cpp)
- elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
-- add_library(arch x86_64.cpp)
-+ add_library(bpftracearch x86_64.cpp)
- elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "mips64")
-- add_library(arch mips64.cpp)
-+ add_library(bpftracearch mips64.cpp)
- elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
-- add_library(arch riscv64.cpp)
-+ add_library(bpftracearch riscv64.cpp)
- elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "loongarch64")
-- add_library(arch loongarch64.cpp)
-+ add_library(bpftracearch loongarch64.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 c390ea6a..37019bd9 100644
---- a/src/ast/CMakeLists.txt
-+++ b/src/ast/CMakeLists.txt
-@@ -1,6 +1,6 @@
- add_library(ast_defs ast.cpp)
-
--add_library(ast
-+add_library(bpftraceast
- async_event_types.cpp
- attachpoint_parser.cpp
- elf_parser.cpp
-@@ -21,11 +21,13 @@ add_library(ast
- target_include_directories(ast_defs PUBLIC ${CMAKE_SOURCE_DIR}/src)
- target_include_directories(ast_defs PUBLIC ${CMAKE_SOURCE_DIR}/src/ast)
- target_include_directories(ast_defs PUBLIC ${CMAKE_BINARY_DIR})
--target_link_libraries(ast ast_defs arch parser)
-+target_link_libraries(bpftraceast ast_defs bpftracearch bpftraceparser)
-+install(TARGETS ast_defs LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-+install(TARGETS bpftraceast LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-
--add_dependencies(ast_defs parser)
-+add_dependencies(ast_defs bpftraceparser)
-
--target_compile_definitions(ast PRIVATE ${BPFTRACE_FLAGS})
-+target_compile_definitions(bpftraceast PRIVATE ${BPFTRACE_FLAGS})
-
- if (STATIC_LINKING)
- set(clang_libs
-@@ -58,20 +60,20 @@ if (STATIC_LINKING)
-
-
- if(EMBED_USE_LLVM)
-- target_link_libraries(ast "-Wl,--start-group" ${CLANG_EMBEDDED_CMAKE_TARGETS} ${LLVM_EMBEDDED_CMAKE_TARGETS} "-Wl,--end-group")
-+ target_link_libraries(bpftraceast "-Wl,--start-group" ${CLANG_EMBEDDED_CMAKE_TARGETS} ${LLVM_EMBEDDED_CMAKE_TARGETS} "-Wl,--end-group")
- else()
- llvm_map_components_to_libnames(llvm_libs ${llvm_lib_names})
-
- if(TARGET libclang_static)
-- target_link_libraries(ast libclang_static)
-+ target_link_libraries(bpftraceast libclang_static)
- else()
- # old LLVM versions don't export libclang_static in ClangTargets.cmake; fall back to
- # libclang.a in that case
-- target_link_libraries(ast libclang.a)
-+ target_link_libraries(abpftracest libclang.a)
- endif()
-
-- target_link_libraries(ast ${clang_libs})
-- target_link_libraries(ast ${llvm_libs})
-+ target_link_libraries(abpftracest ${clang_libs})
-+ target_link_libraries(abpftracest ${llvm_libs})
- endif()
-
- if(STATIC_LIBC)
-@@ -81,11 +83,11 @@ if (STATIC_LINKING)
- 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/src/cxxdemangler/CMakeLists.txt b/src/cxxdemangler/CMakeLists.txt
-index 04cfcdd9..5677aa4b 100644
---- a/src/cxxdemangler/CMakeLists.txt
-+++ b/src/cxxdemangler/CMakeLists.txt
-@@ -1,2 +1,4 @@
- add_library(cxxdemangler_stdlib cxxdemangler_stdlib.cpp)
- add_library(cxxdemangler_llvm cxxdemangler_llvm.cpp)
-+install(TARGETS cxxdemangler_stdlib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-+install(TARGETS cxxdemangler_llvm LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/dev-util/bpftrace/files/bpftrace-0.17.0-llvm-16.patch b/dev-util/bpftrace/files/bpftrace-0.17.0-llvm-16.patch
deleted file mode 100644
index 5d845c134bea..000000000000
--- a/dev-util/bpftrace/files/bpftrace-0.17.0-llvm-16.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-
-From: https://github.com/iovisor/bpftrace/pull/2528
-
-From a91064d7fb26626d79719c2e2a13cc2acab9549a Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 10 Mar 2023 00:08:27 -0800
-Subject: [PATCH] cmake: Raise max llvm major version to 16
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 0a7914f580d..341ac7e9c1f 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -165,7 +165,7 @@ else()
- endif()
-
- set(MIN_LLVM_MAJOR 6)
-- set(MAX_LLVM_MAJOR 15)
-+ set(MAX_LLVM_MAJOR 16)
-
- if((${LLVM_VERSION_MAJOR} VERSION_LESS ${MIN_LLVM_MAJOR}) OR (${LLVM_VERSION_MAJOR} VERSION_GREATER ${MAX_LLVM_MAJOR}))
- message(SEND_ERROR "Unsupported LLVM version found via ${LLVM_INCLUDE_DIRS}: ${LLVM_VERSION_MAJOR}")
diff --git a/dev-util/bpftrace/files/bpftrace-0.17.0-use-std-optional.patch b/dev-util/bpftrace/files/bpftrace-0.17.0-use-std-optional.patch
deleted file mode 100644
index 21b4b7e6c267..000000000000
--- a/dev-util/bpftrace/files/bpftrace-0.17.0-use-std-optional.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-
-From: https://github.com/iovisor/bpftrace/pull/2525
-
-From a794397394aa836f776da17c8e08876a2f64d477 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 13 Mar 2023 21:30:27 -0700
-Subject: [PATCH] ast: Use std::optional in CodegenLLVM::CodegenLLVM call
-
-Fixes build with clang-16
-
-src/ast/passes/codegen_llvm.cpp:63:53: error: use of undeclared identifier 'Optional'; did you mean 'std::optional'?
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- src/ast/passes/codegen_llvm.cpp | 16 +++++++++++-----
- 1 file changed, 11 insertions(+), 5 deletions(-)
-
-diff --git a/src/ast/passes/codegen_llvm.cpp b/src/ast/passes/codegen_llvm.cpp
-index 616ff89ddbc..fe440adf373 100644
---- a/src/ast/passes/codegen_llvm.cpp
-+++ b/src/ast/passes/codegen_llvm.cpp
-@@ -56,11 +56,17 @@ CodegenLLVM::CodegenLLVM(Node *root, BPFtrace &bpftrace)
- throw std::runtime_error(
- "Could not find bpf llvm target, does your llvm support it?");
-
-- target_machine_.reset(target->createTargetMachine(LLVMTargetTriple,
-- "generic",
-- "",
-- TargetOptions(),
-- Optional<Reloc::Model>()));
-+ target_machine_.reset(
-+ target->createTargetMachine(LLVMTargetTriple,
-+ "generic",
-+ "",
-+ TargetOptions(),
-+#if LLVM_VERSION_MAJOR >= 16
-+ std::optional<Reloc::Model>()
-+#else
-+ Optional<Reloc::Model>()
-+#endif
-+ ));
- target_machine_->setOptLevel(llvm::CodeGenOpt::Aggressive);
-
- module_->setTargetTriple(LLVMTargetTriple);
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/
@ 2023-09-19 18:32 Patrick McLean
0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2023-09-19 18:32 UTC (permalink / raw
To: gentoo-commits
commit: 0c899ec1569406739620796f881977b7b60d2b25
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 19 18:29:50 2023 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Sep 19 18:32:05 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c899ec1
dev-util/bpftrace: add 0.19.0
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bpftrace/Manifest | 1 +
dev-util/bpftrace/bpftrace-0.19.0.ebuild | 95 ++++++
.../files/bpftrace-0.19.0-install-libs.patch | 338 +++++++++++++++++++++
3 files changed, 434 insertions(+)
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest
index 6d71c4df156e..198bdcf06805 100644
--- a/dev-util/bpftrace/Manifest
+++ b/dev-util/bpftrace/Manifest
@@ -1,3 +1,4 @@
DIST bpftrace-0.17.1.gh.tar.gz 1035345 BLAKE2B 5dca6f3fc49458b4b2ed3068e3f99f1156067c430af36b53949e469a870101d2da6aba6c4d18bfaf173cc45eab18e3c316966a5e222a4b4cea98363a9afd90ce SHA512 57f00a0b209d745efe5ce39d0e8efb90a21b5c499b41385814378d828ef507dc2c6d9497f9d23dbb610fcff21f077cba9f7481e7a6a6465825065743289ef4ad
DIST bpftrace-0.18.0.gh.tar.gz 1046210 BLAKE2B 921fdd56cff48e7b8fc2b8164839393f2759218accaa58412fdf80b2df4474067c3c660da09e3ee808d258c1f19b0534fa81462cbea5ce3e814bdbeaa7dce5aa SHA512 b7da273d251f03a81b3a7097407352e7ad1d023972852bdb883176e97bab7046f9f327bd03bca51fe853ecaab5f60adc6994e75cb450a033a5b91118f719c36d
DIST bpftrace-0.18.1.gh.tar.gz 1046307 BLAKE2B 67c5d586e803c16ae0338563953e86cb3fbf318410f5757824a56fdf049b4b4fe5cc2d2b7e0435c625728b0b25123bcc8d64eaa923c14334d9ec23075c8deeec SHA512 eb81554f4707f8c919930932ff6ec7602578c317c058238a16fe38d6db055da0d7b355733821203281767419aa8e1b2256bb7a921f50c987c85395ecfbda966a
+DIST bpftrace-0.19.0.gh.tar.gz 1157739 BLAKE2B ebedebe365621436da7735e373dcb142ddad9c8869b8d1c20b227b8cf772b1005d79cec7eef16f7ef7b9f92b9061751986efe43bd102c7592051a549377161bf SHA512 727e1319e8bcb9b197636c2bd3145c1805e0772e268187a1c71979966f28c81e92347606be383f71f922f56df62afea8ac672d5d40fd0338b3687e0520fa3786
diff --git a/dev-util/bpftrace/bpftrace-0.19.0.ebuild b/dev-util/bpftrace/bpftrace-0.19.0.ebuild
new file mode 100644
index 000000000000..4fa38e3d617a
--- /dev/null
+++ b/dev-util/bpftrace/bpftrace-0.19.0.ebuild
@@ -0,0 +1,95 @@
+# Copyright 2019-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_MAX_SLOT=16
+
+inherit llvm linux-info cmake
+
+DESCRIPTION="High-level tracing language for eBPF"
+HOMEPAGE="https://github.com/iovisor/bpftrace"
+MY_PV="${PV//_/}"
+SRC_URI="https://github.com/iovisor/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.gh.tar.gz"
+S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+
+# remove keywords until build works:
+# https://github.com/iovisor/bpftrace/issues/2349
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="fuzzing test"
+
+# lots of fixing needed
+RESTRICT="test"
+
+RDEPEND="
+ >=dev-libs/libbpf-1.1:=
+ >=dev-util/bcc-0.25.0:=
+ >=sys-devel/llvm-10[llvm_targets_BPF(+)]
+ >=sys-devel/clang-10
+ <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):=
+ <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):=[llvm_targets_BPF(+)]
+ sys-libs/binutils-libs:=
+ virtual/libelf:=
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ dev-libs/cereal:=
+ test? ( dev-cpp/gtest )
+"
+BDEPEND="
+ app-arch/xz-utils
+ sys-devel/flex
+ sys-devel/bison
+ virtual/pkgconfig
+"
+
+QA_DT_NEEDED="
+ /usr/lib.*/libbpftraceresources.so
+ /usr/lib.*/libcxxdemangler_llvm.so
+"
+
+PATCHES=(
+ "${FILESDIR}/bpftrace-0.19.0-install-libs.patch"
+ "${FILESDIR}/bpftrace-0.15.0-dont-compress-man.patch"
+ "${FILESDIR}/bpftrace-0.11.4-old-kernels.patch"
+)
+
+pkg_pretend() {
+ local CONFIG_CHECK="
+ ~BPF
+ ~BPF_EVENTS
+ ~BPF_JIT
+ ~BPF_SYSCALL
+ ~FTRACE_SYSCALLS
+ ~HAVE_EBPF_JIT
+ "
+
+ check_extra_config
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DSTATIC_LINKING:BOOL=OFF
+ # bug 809362, 754648
+ -DBUILD_TESTING:BOOL=$(usex test)
+ -DBUILD_FUZZ:BOOL=$(usex fuzzing)
+ -DENABLE_MAN:BOOL=OFF
+ -DUSE_SYSTEM_BPF_BCC:BOOL=ON
+ )
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ # bug 809362
+ dostrip -x /usr/bin/bpftrace
+ doman man/man8/*.?
+}
diff --git a/dev-util/bpftrace/files/bpftrace-0.19.0-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.19.0-install-libs.patch
new file mode 100644
index 000000000000..647b0cd4cae5
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.19.0-install-libs.patch
@@ -0,0 +1,338 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a1360a71..24d85abc 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -138,9 +138,10 @@ endif()
+ bison_target(bison_parser src/parser.yy ${CMAKE_BINARY_DIR}/parser.tab.cc COMPILE_FLAGS ${BISON_FLAGS} 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 c12f9567..0bfec98c 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 401ddc0a..05f0f637 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -13,7 +13,7 @@ else()
+ endif ()
+ endif()
+
+-add_library(runtime
++add_library(bpftraceruntime
+ attached_probe.cpp
+ bpffeature.cpp
+ bpftrace.cpp
+@@ -44,7 +44,7 @@ add_library(runtime
+ ${BFD_DISASM_SRC}
+ )
+ # Ensure flex+bison outputs are built first
+-add_dependencies(runtime parser)
++add_dependencies(bpftraceruntime bpftraceparser)
+
+ add_library(libbpftrace
+ build_info.cpp
+@@ -61,6 +61,7 @@ add_executable(${BPFTRACE}
+ )
+
+ install(TARGETS ${BPFTRACE} DESTINATION ${CMAKE_INSTALL_BINDIR})
++install(TARGETS libbpftrace LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ target_link_libraries(${BPFTRACE} libbpftrace)
+
+ if (BUILD_FUZZ)
+@@ -89,7 +90,7 @@ endif()
+ set(KERNEL_HEADERS_DIR "" CACHE PATH "Hard-code kernel headers directory")
+ if (KERNEL_HEADERS_DIR)
+ MESSAGE(STATUS "Using KERNEL_HEADERS_DIR=${KERNEL_HEADERS_DIR}")
+- target_compile_definitions(runtime PUBLIC KERNEL_HEADERS_DIR="${KERNEL_HEADERS_DIR}")
++ target_compile_definitions(bpftraceruntime PUBLIC KERNEL_HEADERS_DIR="${KERNEL_HEADERS_DIR}")
+ endif()
+
+ execute_process(
+@@ -109,10 +110,11 @@ endif()
+
+ add_definitions("-DBPFTRACE_VERSION=\"${BPFTRACE_VERSION}\"")
+
+-target_include_directories(runtime PRIVATE ${CMAKE_BINARY_DIR})
+-target_include_directories(runtime PRIVATE ${CMAKE_SOURCE_DIR}/src)
+-target_include_directories(runtime PRIVATE ${CMAKE_SOURCE_DIR}/src/ast)
+-target_compile_definitions(runtime PRIVATE ${BPFTRACE_FLAGS})
++target_include_directories(bpftraceruntime PRIVATE ${CMAKE_BINARY_DIR})
++target_include_directories(bpftraceruntime PRIVATE ${CMAKE_SOURCE_DIR}/src)
++target_include_directories(bpftraceruntime PRIVATE ${CMAKE_SOURCE_DIR}/src/ast)
++target_compile_definitions(bpftraceruntime PRIVATE ${BPFTRACE_FLAGS})
++install(TARGETS bpftraceruntime LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ target_compile_definitions(libbpftrace PRIVATE ${BPFTRACE_FLAGS})
+
+ # Linking
+@@ -125,8 +127,8 @@ if(STATIC_LINKING)
+ endif(STATIC_LINKING)
+
+
+-target_link_libraries(runtime ${LIBBPF_LIBRARIES} ${ZLIB_LIBRARIES})
+-target_link_libraries(libbpftrace parser resources runtime aot ast arch cxxdemangler_llvm)
++target_link_libraries(bpftraceruntime ${LIBBPF_LIBRARIES} ${ZLIB_LIBRARIES})
++target_link_libraries(libbpftrace bpftraceparser bpftraceresources bpftraceruntime aot bpftraceast bpftracearch cxxdemangler_llvm)
+
+ if(LIBPCAP_FOUND)
+ target_link_libraries(libbpftrace ${LIBPCAP_LIBRARIES})
+@@ -136,49 +138,49 @@ if(HAVE_BFD_DISASM)
+ if(STATIC_LINKING OR LIBBFD_STATIC)
+ add_library(LIBBFD STATIC IMPORTED)
+ set_property(TARGET LIBBFD PROPERTY IMPORTED_LOCATION ${LIBBFD_LIBRARIES})
+- target_link_libraries(runtime LIBBFD)
++ target_link_libraries(bpftraceruntime LIBBFD)
+ add_library(LIBOPCODES STATIC IMPORTED)
+ set_property(TARGET LIBOPCODES PROPERTY IMPORTED_LOCATION ${LIBOPCODES_LIBRARIES})
+- target_link_libraries(runtime LIBOPCODES)
++ target_link_libraries(bpftraceruntime LIBOPCODES)
+ add_library(LIBIBERTY STATIC IMPORTED)
+ set_property(TARGET LIBIBERTY PROPERTY IMPORTED_LOCATION ${LIBIBERTY_LIBRARIES})
+- target_link_libraries(runtime LIBIBERTY)
++ target_link_libraries(bpftraceruntime LIBIBERTY)
+
+ add_library(LIBZSTD STATIC IMPORTED)
+ if (LIBZSTD_FOUND)
+ set_property(TARGET LIBZSTD PROPERTY IMPORTED_LOCATION ${LIBZSTD_LIBRARIES})
+- target_link_libraries(runtime LIBZSTD)
++ target_link_libraries(bpftraceruntime LIBZSTD)
+ endif(LIBZSTD_FOUND)
+
+ add_library(LIBSFRAME STATIC IMPORTED)
+ if (LIBSFRAME_FOUND)
+ set_property(TARGET LIBSFRAME PROPERTY IMPORTED_LOCATION ${LIBSFRAME_LIBRARIES})
+- target_link_libraries(runtime LIBSFRAME)
++ target_link_libraries(bpftraceruntime LIBSFRAME)
+ endif()
+ else()
+- target_link_libraries(runtime ${LIBBFD_LIBRARIES})
+- target_link_libraries(runtime ${LIBOPCODES_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBBFD_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBOPCODES_LIBRARIES})
+ endif(STATIC_LINKING OR LIBBFD_STATIC)
+ endif(HAVE_BFD_DISASM)
+
+ # Link to bcc libraries (without LLVM) if possible
+ if(LIBBCC_BPF_CONTAINS_RUNTIME)
+- target_link_libraries(runtime ${LIBBCC_BPF_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBBCC_BPF_LIBRARIES})
+ else()
+- target_link_libraries(runtime ${LIBBCC_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBBCC_LIBRARIES})
+ endif()
+
+ if(STATIC_BPF_BCC)
+ # These are not part of the static libbcc so have to be added separate
+- target_link_libraries(runtime ${LIBBCC_BPF_LIBRARIES})
+- target_link_libraries(runtime ${LIBBPF_LIBRARIES})
+- target_link_libraries(runtime ${LIBBCC_LOADER_LIBRARY_STATIC})
++ target_link_libraries(bpftraceruntime ${LIBBCC_BPF_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBBPF_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBBCC_LOADER_LIBRARY_STATIC})
+
+ add_library(LIBELF STATIC IMPORTED)
+ set_property(TARGET LIBELF PROPERTY IMPORTED_LOCATION ${LIBELF_LIBRARIES})
+- target_link_libraries(runtime LIBELF)
++ target_link_libraries(bpftraceruntime LIBELF)
+ else()
+- target_link_libraries(runtime ${LIBELF_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBELF_LIBRARIES})
+ endif(STATIC_BPF_BCC)
+
+ if (LIBDW_FOUND)
+@@ -207,16 +209,16 @@ if (LIBDW_FOUND)
+
+ target_link_libraries(LIBDW INTERFACE ${LIBDW_LIBS})
+
+- target_link_libraries(runtime LIBDW)
++ target_link_libraries(bpftraceruntime LIBDW)
+ else()
+- target_link_libraries(runtime ${LIBDW_LIBRARIES})
++ target_link_libraries(bpftraceruntime ${LIBDW_LIBRARIES})
+ endif()
+ endif()
+
+ # Support for std::filesystem
+ # GCC version <9 and Clang (all versions) require -lstdc++fs
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "9")
+- target_link_libraries(runtime "stdc++fs")
++ target_link_libraries(bpftraceruntime "stdc++fs")
+ target_link_libraries(libbpftrace "stdc++fs")
+ endif()
+
+@@ -238,16 +240,16 @@ endif()
+ if (STATIC_LINKING)
+ if(ANDROID)
+ target_link_libraries(libbpftrace "-Wl,-Bdynamic" "-ldl" "-lm" "-lz")
+- target_link_libraries(runtime "-Wl,-Bdynamic" "-ldl" "-lm" "-lz")
++ target_link_libraries(bpftraceruntime "-Wl,-Bdynamic" "-ldl" "-lm" "-lz")
+ else()
+ target_link_libraries(libbpftrace "-Wl,-Bdynamic" "-lrt" "-lpthread" "-ldl" "-lm")
+ target_link_libraries(libbpftrace "-Wl,-Bstatic" "-lz")
+- target_link_libraries(runtime "-Wl,-Bdynamic" "-lrt" "-lpthread" "-ldl" "-lm")
+- target_link_libraries(runtime "-Wl,-Bstatic" "-lz")
++ target_link_libraries(bpftraceruntime "-Wl,-Bdynamic" "-lrt" "-lpthread" "-ldl" "-lm")
++ target_link_libraries(bpftraceruntime "-Wl,-Bstatic" "-lz")
+ endif()
+ elseif(STATIC_BPF_BCC)
+ # partial static build, libbpf needs zlib, bcc needs liblzma
+- target_link_libraries(runtime "-lz" "-llzma")
++ target_link_libraries(bpftraceruntime "-lz" "-llzma")
+ endif()
+
+ unset(MAIN_SRC)
+diff --git a/src/aot/CMakeLists.txt b/src/aot/CMakeLists.txt
+index c776d204..41e84317 100644
+--- a/src/aot/CMakeLists.txt
++++ b/src/aot/CMakeLists.txt
+@@ -1,8 +1,9 @@
+ add_library(aot aot.cpp)
+-add_dependencies(aot parser)
++add_dependencies(aot bpftraceparser)
+ target_include_directories(aot PUBLIC ${CMAKE_SOURCE_DIR}/src)
+ target_include_directories(aot PUBLIC ${CMAKE_BINARY_DIR})
+ target_compile_definitions(aot PRIVATE ${BPFTRACE_FLAGS})
++install(TARGETS aot LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+ # Only build aotrt if supported bcc is used
+ # (https://github.com/iovisor/bcc/commit/719191867a25ce07dc96f7faf9b8ccedadc7ec44)
+@@ -11,7 +12,7 @@ if(NOT LIBBCC_BPF_CONTAINS_RUNTIME)
+ endif()
+
+ add_executable(bpftrace-aotrt aot_main.cpp)
+-target_link_libraries(bpftrace-aotrt aot runtime arch ast_defs cxxdemangler_stdlib)
++target_link_libraries(bpftrace-aotrt aot bpftraceruntime bpftracearch ast_defs cxxdemangler_stdlib)
+ install(TARGETS bpftrace-aotrt DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+ if(LIBPCAP_FOUND)
+diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt
+index e6a1d0a0..c53daa19 100644
+--- a/src/arch/CMakeLists.txt
++++ b/src/arch/CMakeLists.txt
+@@ -1,19 +1,20 @@
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|aarch64)")
+- add_library(arch arm.cpp)
++ add_library(bpftracearch arm.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 "s390" OR
+ CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x")
+- add_library(arch s390.cpp)
++ add_library(bpftracearch s390.cpp)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+- add_library(arch x86_64.cpp)
++ add_library(bpftracearch x86_64.cpp)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "mips64")
+- add_library(arch mips64.cpp)
++ add_library(bpftracearch mips64.cpp)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
+- add_library(arch riscv64.cpp)
++ add_library(bpftracearch riscv64.cpp)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "loongarch64")
+- add_library(arch loongarch64.cpp)
++ add_library(bpftracearch loongarch64.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 c390ea6a..37019bd9 100644
+--- a/src/ast/CMakeLists.txt
++++ b/src/ast/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ add_library(ast_defs ast.cpp)
+
+-add_library(ast
++add_library(bpftraceast
+ async_event_types.cpp
+ attachpoint_parser.cpp
+ elf_parser.cpp
+@@ -21,11 +21,13 @@ add_library(ast
+ target_include_directories(ast_defs PUBLIC ${CMAKE_SOURCE_DIR}/src)
+ target_include_directories(ast_defs PUBLIC ${CMAKE_SOURCE_DIR}/src/ast)
+ target_include_directories(ast_defs PUBLIC ${CMAKE_BINARY_DIR})
+-target_link_libraries(ast ast_defs arch parser)
++target_link_libraries(bpftraceast ast_defs bpftracearch bpftraceparser)
++install(TARGETS ast_defs LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
++install(TARGETS bpftraceast LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+-add_dependencies(ast_defs parser)
++add_dependencies(ast_defs bpftraceparser)
+
+-target_compile_definitions(ast PRIVATE ${BPFTRACE_FLAGS})
++target_compile_definitions(bpftraceast PRIVATE ${BPFTRACE_FLAGS})
+
+ if (STATIC_LINKING)
+ set(clang_libs
+@@ -58,20 +60,20 @@ if (STATIC_LINKING)
+
+
+ if(EMBED_USE_LLVM)
+- target_link_libraries(ast "-Wl,--start-group" ${CLANG_EMBEDDED_CMAKE_TARGETS} ${LLVM_EMBEDDED_CMAKE_TARGETS} "-Wl,--end-group")
++ target_link_libraries(bpftraceast "-Wl,--start-group" ${CLANG_EMBEDDED_CMAKE_TARGETS} ${LLVM_EMBEDDED_CMAKE_TARGETS} "-Wl,--end-group")
+ else()
+ llvm_map_components_to_libnames(llvm_libs ${llvm_lib_names})
+
+ if(TARGET libclang_static)
+- target_link_libraries(ast libclang_static)
++ target_link_libraries(bpftraceast libclang_static)
+ else()
+ # old LLVM versions don't export libclang_static in ClangTargets.cmake; fall back to
+ # libclang.a in that case
+- target_link_libraries(ast libclang.a)
++ target_link_libraries(abpftracest libclang.a)
+ endif()
+
+- target_link_libraries(ast ${clang_libs})
+- target_link_libraries(ast ${llvm_libs})
++ target_link_libraries(abpftracest ${clang_libs})
++ target_link_libraries(abpftracest ${llvm_libs})
+ endif()
+
+ if(STATIC_LIBC)
+@@ -81,11 +83,11 @@ if (STATIC_LINKING)
+ 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/src/cxxdemangler/CMakeLists.txt b/src/cxxdemangler/CMakeLists.txt
+index 04cfcdd9..5677aa4b 100644
+--- a/src/cxxdemangler/CMakeLists.txt
++++ b/src/cxxdemangler/CMakeLists.txt
+@@ -1,2 +1,4 @@
+ add_library(cxxdemangler_stdlib cxxdemangler_stdlib.cpp)
+ add_library(cxxdemangler_llvm cxxdemangler_llvm.cpp)
++install(TARGETS cxxdemangler_stdlib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
++install(TARGETS cxxdemangler_llvm LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
^ permalink raw reply related [flat|nested] 20+ messages in thread
end of thread, other threads:[~2023-09-19 18:32 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-14 21:03 [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/, dev-util/bpftrace/files/ Patrick McLean
-- strict thread matches above, loose matches on Subject: below --
2019-11-21 18:29 Patrick McLean
2020-02-04 21:19 Patrick McLean
2020-05-28 20:26 Patrick McLean
2020-07-15 19:09 Patrick McLean
2020-08-25 0:19 Patrick McLean
2020-11-14 1:30 Patrick McLean
2021-04-20 18:04 Patrick McLean
2021-07-09 17:11 Patrick McLean
2021-07-13 21:07 Patrick McLean
2021-10-26 17:53 Patrick McLean
2021-10-27 16:55 Patrick McLean
2022-05-04 22:25 Patrick McLean
2022-05-04 22:43 Patrick McLean
2022-09-22 19:04 Patrick McLean
2022-09-27 21:41 Sam James
2023-01-30 19:10 Patrick McLean
2023-01-30 19:10 Patrick McLean
2023-09-19 18:32 Patrick McLean
2023-09-19 18:32 Patrick McLean
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox