diff options
author | Adam Jensen <acjensen@gmail.com> | 2019-12-31 20:43:19 -0500 |
---|---|---|
committer | Rasmus Thomsen <oss@cogitri.dev> | 2020-02-02 19:57:07 +0100 |
commit | f2bb0c980e30deb09ed7999ab981ee455e691cdc (patch) | |
tree | 3798c73cfa3634e4f80d0ea77d76490117fda787 /community/bcc | |
parent | 2e6d6d513d755a8fe649360be8c6001f3170c09a (diff) | |
download | aports-f2bb0c980e30deb09ed7999ab981ee455e691cdc.tar.bz2 aports-f2bb0c980e30deb09ed7999ab981ee455e691cdc.tar.xz |
community/bcc: add static subpackage
Diffstat (limited to 'community/bcc')
-rw-r--r-- | community/bcc/10-use-system-libbpf.patch | 46 | ||||
-rw-r--r-- | community/bcc/20-install-static.patch | 18 | ||||
-rw-r--r-- | community/bcc/APKBUILD | 14 |
3 files changed, 48 insertions, 30 deletions
diff --git a/community/bcc/10-use-system-libbpf.patch b/community/bcc/10-use-system-libbpf.patch index c77e15cf57..794f454d04 100644 --- a/community/bcc/10-use-system-libbpf.patch +++ b/community/bcc/10-use-system-libbpf.patch @@ -1,23 +1,22 @@ diff --git a/introspection/CMakeLists.txt b/introspection/CMakeLists.txt -index 88df6e84..4ee79d46 100644 +index 91eac43c..f52cf654 100644 --- a/introspection/CMakeLists.txt +++ b/introspection/CMakeLists.txt -@@ -3,11 +3,11 @@ - +@@ -4,10 +4,11 @@ include_directories(${CMAKE_SOURCE_DIR}/src/cc) include_directories(${CMAKE_SOURCE_DIR}/src/cc/api) --include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi) + include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi) +include_directories(/usr/include/uapi) option(INSTALL_INTROSPECTION "Install BPF introspection tools" ON) add_executable(bps bps.c) --target_link_libraries(bps bpf-static) -+target_link_libraries(bps bccbpf-static) +-target_link_libraries(bps bpf-static elf) ++target_link_libraries(bps bccbpf-static elf) install (TARGETS bps DESTINATION share/bcc/introspection) diff --git a/introspection/bps.c b/introspection/bps.c -index 5e510aa4..eb7bb0e3 100644 +index 59160938..e3fc22c7 100644 --- a/introspection/bps.c +++ b/introspection/bps.c @@ -8,6 +8,7 @@ @@ -29,7 +28,7 @@ index 5e510aa4..eb7bb0e3 100644 #include "libbpf.h" diff --git a/src/cc/CMakeLists.txt b/src/cc/CMakeLists.txt -index 571a4637..07aa3d42 100644 +index c53c542f..c4675dee 100644 --- a/src/cc/CMakeLists.txt +++ b/src/cc/CMakeLists.txt @@ -10,8 +10,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frontends/clang) @@ -43,11 +42,10 @@ index 571a4637..07aa3d42 100644 add_definitions(${LLVM_DEFINITIONS}) configure_file(libbcc.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libbcc.pc @ONLY) -@@ -28,12 +28,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLLVM_MAJOR_VERSION=${CMAKE_MATCH_1}") +@@ -44,11 +44,13 @@ endif() - include(static_libstdc++) + set(libbpf_uapi libbpf/include/uapi/linux}) --file(GLOB libbpf_sources "libbpf/src/*.c") -add_library(bpf-static STATIC libbpf.c perf_reader.c ${libbpf_sources}) -set_target_properties(bpf-static PROPERTIES OUTPUT_NAME bcc_bpf) -add_library(bpf-shared SHARED libbpf.c perf_reader.c ${libbpf_sources}) @@ -63,28 +61,28 @@ index 571a4637..07aa3d42 100644 set(bcc_common_sources bcc_common.cc bpf_module.cc bcc_btf.cc exported_files.cc) if (${LLVM_PACKAGE_VERSION} VERSION_EQUAL 6 OR ${LLVM_PACKAGE_VERSION} VERSION_GREATER 6) -@@ -79,11 +80,11 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${llvm_lib_exclude_f - - # bcc_common_libs_for_a for archive libraries - # bcc_common_libs_for_s for shared libraries --set(bcc_common_libs_for_a b_frontend clang_frontend bpf-static -+set(bcc_common_libs_for_a b_frontend clang_frontend bccbpf-static bpf +@@ -107,10 +109,10 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${llvm_lib_exclude_f + set(bcc_common_libs b_frontend clang_frontend -Wl,--whole-archive ${clang_libs} ${llvm_libs} -Wl,--no-whole-archive ${LIBELF_LIBRARIES}) - set(bcc_common_libs_for_s ${bcc_common_libs_for_a}) +-set(bcc_common_libs_for_a ${bcc_common_libs} bpf-static) +-set(bcc_common_libs_for_s ${bcc_common_libs} bpf-static) ++set(bcc_common_libs_for_a ${bcc_common_libs} bccbpf-static bpf) ++set(bcc_common_libs_for_s ${bcc_common_libs} bccbpf-static bpf) + set(bcc_common_libs_for_n ${bcc_common_libs}) -set(bcc_common_libs_for_lua b_frontend clang_frontend bpf-static +set(bcc_common_libs_for_lua b_frontend clang_frontend bccbpf-static bpf ${clang_libs} ${llvm_libs} ${LIBELF_LIBRARIES}) if(ENABLE_CPP_API) -@@ -115,4 +116,4 @@ install(DIRECTORY libbpf/include/uapi/linux/ DESTINATION include/bcc/compat/linu +@@ -149,4 +151,4 @@ install(DIRECTORY ${libbpf_uapi} DESTINATION include/bcc/compat/linux FILES_MATC install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libbcc.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif(ENABLE_CLANG_JIT) install(FILES ${bcc_common_headers} DESTINATION include/bcc) -install(TARGETS bpf-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS bccbpf-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/cc/bcc_btf.cc b/src/cc/bcc_btf.cc -index 12816757..bd26f69f 100644 +index f7773fd4..d6e5f02a 100644 --- a/src/cc/bcc_btf.cc +++ b/src/cc/bcc_btf.cc @@ -17,10 +17,12 @@ @@ -103,10 +101,10 @@ index 12816757..bd26f69f 100644 #define BCC_MAX_ERRNO 4095 diff --git a/src/cc/bpf_module.cc b/src/cc/bpf_module.cc -index c27ce9c8..5f61a71c 100644 +index 3df7ef18..7f7a26f3 100644 --- a/src/cc/bpf_module.cc +++ b/src/cc/bpf_module.cc -@@ -44,7 +44,7 @@ +@@ -45,7 +45,7 @@ #include "exported_files.h" #include "libbpf.h" #include "bcc_btf.h" @@ -116,7 +114,7 @@ index c27ce9c8..5f61a71c 100644 namespace ebpf { diff --git a/src/cc/frontends/clang/b_frontend_action.cc b/src/cc/frontends/clang/b_frontend_action.cc -index cb1f5b1c..6a13f5d6 100644 +index 5697f2f9..4708e9b0 100644 --- a/src/cc/frontends/clang/b_frontend_action.cc +++ b/src/cc/frontends/clang/b_frontend_action.cc @@ -34,7 +34,7 @@ @@ -129,7 +127,7 @@ index cb1f5b1c..6a13f5d6 100644 #include "libbpf.h" diff --git a/src/cc/libbpf.c b/src/cc/libbpf.c -index 8459ecf0..4e1d2b45 100644 +index 111f0195..cf154345 100644 --- a/src/cc/libbpf.c +++ b/src/cc/libbpf.c @@ -52,8 +52,8 @@ diff --git a/community/bcc/20-install-static.patch b/community/bcc/20-install-static.patch new file mode 100644 index 0000000000..3e56c66098 --- /dev/null +++ b/community/bcc/20-install-static.patch @@ -0,0 +1,18 @@ +diff --git a/src/cc/CMakeLists.txt b/src/cc/CMakeLists.txt +index c4675dee..2bb97395 100644 +--- a/src/cc/CMakeLists.txt ++++ b/src/cc/CMakeLists.txt +@@ -145,6 +145,7 @@ if(LIBBPF_FOUND) + endif() + + install(TARGETS bcc-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(TARGETS bcc-static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES ${bcc_table_headers} DESTINATION include/bcc) + install(FILES ${bcc_api_headers} DESTINATION include/bcc) + install(DIRECTORY ${libbpf_uapi} DESTINATION include/bcc/compat/linux FILES_MATCHING PATTERN "*.h") +@@ -152,3 +153,5 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libbcc.pc DESTINATION ${CMAKE_INSTALL_ + endif(ENABLE_CLANG_JIT) + install(FILES ${bcc_common_headers} DESTINATION include/bcc) + install(TARGETS bccbpf-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(TARGETS bccbpf-static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(TARGETS bcc-loader-static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/community/bcc/APKBUILD b/community/bcc/APKBUILD index b96c3cb5c3..7f9863eab8 100644 --- a/community/bcc/APKBUILD +++ b/community/bcc/APKBUILD @@ -1,20 +1,21 @@ # Maintainer: Adam Jensen <acjensen@gmail.com> pkgname=bcc -pkgver=0.11.0 -pkgrel=1 +pkgver=0.12.0 +pkgrel=0 pkgdesc="A toolkit for creating efficient kernel tracing and manipulation programs" url="https://github.com/iovisor/bcc/" arch="aarch64 x86 x86_64" license="Apache-2.0" # bcc's test suite requires privileged access to run BPF programs options="!check" -subpackages="$pkgname-dev $pkgname-doc:_doc $pkgname-tools:_tools $pkgname-lua:_lua py3-$pkgname:_py" +subpackages="$pkgname-static $pkgname-dev $pkgname-doc:_doc $pkgname-tools:_tools $pkgname-lua:_lua py3-$pkgname:_py:noarch" _llvmver=9 makedepends="tar git llvm$_llvmver-dev llvm$_llvmver-static clang-dev clang-static cmake python3 flex-dev bison luajit-dev build-base iperf linux-headers elfutils-dev zlib-dev libbpf-dev" source="$pkgname-$pkgver.tar.gz::https://github.com/iovisor/bcc/archive/v$pkgver.tar.gz - 10-use-system-libbpf.patch" + 10-use-system-libbpf.patch + 20-install-static.patch" prepare() { rm -rf tests/* && touch tests/CMakeLists.txt @@ -72,5 +73,6 @@ _lua() { mv "$pkgdir"/usr/bin/bcc-lua "$subpkgdir"/usr/bin } -sha512sums="4854a5a15a89a8bd3a10daa6f0e831428316751280902cbdc74f3c6f78263ee1c58521ae9125804e72fec6482702818a5fec781436400640627e4b7c2fc189fb bcc-0.11.0.tar.gz -f2aa0e3184f11a80d98f5a68d7f46799d471818dafb03d9683c09f33ed2400a3c570807ef6773d4011f0851217089f976ffeff9f5d3279a81e5f551dadc506b5 10-use-system-libbpf.patch" +sha512sums="db3ea929b1296f4d9d82d2a11e89e11a1c31512d3f7f935475a7613e0128a5cf9441f3138969535ef41de0c0f677c7446f62f1c64575d41a9896e5339f3f112b bcc-0.12.0.tar.gz +caffeea956f6d4b83f63a321eee17c2a12987c99b3c65444fdfeb15e0f6c8927e865358ed2db6bd6736757df007c4c11bd06a5c174884d1542b7ee38b0496b49 10-use-system-libbpf.patch +c84d08f31fceb9af9c4bfeb0056b2f20c385b8eb44aafa1ab40049586e3b71d38882ca236e9f3fff5a9eebae9c570f56c73cc87966659e71743a5a38a30de388 20-install-static.patch" |