From 0c58230e0fc74178013f49bf1adc9f856e9ea247 Mon Sep 17 00:00:00 2001 From: Patrick McLean Date: Thu, 28 May 2020 13:26:30 -0700 Subject: [PATCH] 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 --- ....10.0.ebuild => bpftrace-0.10.0-r1.ebuild} | 3 + .../files/bpftrace-0.10.0-llvm-multi.patch | 60 +++++++++++++++++++ 2 files changed, 63 insertions(+) rename dev-util/bpftrace/{bpftrace-0.10.0.ebuild => bpftrace-0.10.0-r1.ebuild} (92%) create mode 100644 dev-util/bpftrace/files/bpftrace-0.10.0-llvm-multi.patch 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 3070afa1505c..196615ab2a94 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(+)] + =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 000000000000..48eeeb8e2001 --- /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() -- 2.26.2