diff options
author | Patrick McLean <chutzpah@gentoo.org> | 2023-01-30 11:08:08 -0800 |
---|---|---|
committer | Patrick McLean <chutzpah@gentoo.org> | 2023-01-30 11:10:09 -0800 |
commit | 90756882da5d06a2e4b4e7d0f718d97dad65f136 (patch) | |
tree | f9ca51fb0f287bea640c29c46cdefde3fc3e2d3b /dev-util/bpftrace | |
parent | dev-python/pip-run: Stabilize 10.0.5 ALLARCHES, #892659 (diff) | |
download | gentoo-90756882da5d06a2e4b4e7d0f718d97dad65f136.tar.gz gentoo-90756882da5d06a2e4b4e7d0f718d97dad65f136.tar.bz2 gentoo-90756882da5d06a2e4b4e7d0f718d97dad65f136.zip |
dev-util/bpftrace: add 0.17.0
Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Diffstat (limited to 'dev-util/bpftrace')
-rw-r--r-- | dev-util/bpftrace/Manifest | 3 | ||||
-rw-r--r-- | dev-util/bpftrace/bpftrace-0.17.0.ebuild | 95 | ||||
-rw-r--r-- | dev-util/bpftrace/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}) |