diff options
Diffstat (limited to 'dev-util/bpftrace')
-rw-r--r-- | dev-util/bpftrace/Manifest | 3 | ||||
-rw-r--r-- | dev-util/bpftrace/bpftrace-0.15.0-r1.ebuild | 1 | ||||
-rw-r--r-- | dev-util/bpftrace/files/bpftrace-0.15.0-binutils-2.39.patch | 87 |
3 files changed, 90 insertions, 1 deletions
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest index 6b1054ea1bdb..5e0b45101683 100644 --- a/dev-util/bpftrace/Manifest +++ b/dev-util/bpftrace/Manifest @@ -1,8 +1,9 @@ AUX bpftrace-0.11.4-old-kernels.patch 563 BLAKE2B 3b2afb997119188e7095b24ec459f4b5ae28626f6905c45f6510f84b7c6f28aa3b5174f1f48a30763990b2a3cc50c6336249fe1dc4cf31656871a8adce43c8d7 SHA512 332e6cc4d1c21e917451c9aa6028b082f53dde8221419ba45ad7ae6321e444b3f67ec8366cbd56638d8f8b68a3be06af892eba765c810744951af1de9b994113 AUX bpftrace-0.15.0-bcc-025.patch 3192 BLAKE2B a72790e25963342b2eed5c2b9fd41bd22d88b536a064f6e4039bc83242ea4c5a48b27d2d786008df45656234c700ba9fbb738e09ea8e70e75a3f457163c4da90 SHA512 22ef3d05790416b4286ea9931646c3940877da8cf02b9645edbc753a4adb75e90f233b533d0c2c790eb62592c6af6487c02a502ecca8d547ec3d329a2aa71f64 +AUX bpftrace-0.15.0-binutils-2.39.patch 3051 BLAKE2B 689b22485d3cb994db7253581ae0c87ecfbb50133d4481209a5d9bde349456621901a66d52d3633b8e8e00d1900254b2d8e5e69bbb24dc126855ab43f453a681 SHA512 1436d44d6469d590b4b94577151d2272483dbb0c4c5f70d74f0cffa8b84c7c923f9f4ecfd7c245b440228df681c38f7bcb28c78a9220c8a90af68a71dc0c9506 AUX bpftrace-0.15.0-dont-compress-man.patch 1885 BLAKE2B 89a327cef68fa838d5c04b37e7bf72e6b03b54c244889706ba3c5156e2355d00cf395d14a6e8a7fe622e002acf9bab06dbc1427f6b637f0c59db86af08f05d51 SHA512 b591a73b0bbdd0105e6b87fb264ca4345e200ab58754d09a87dec79e60044eab165f2b34fe5ddc904cd877a460d5f41eef8b4d59eac255ea4f4e0fae37cf3511 AUX bpftrace-0.15.0-install-libs.patch 8206 BLAKE2B 9d8b193f422b0ee64301b7ea12791afdd5111cde487b904ec35750e6189fdd6faca9af36b8956058c820c2398bcabc7dcee6d26b93c55ff1e591b3259a682a27 SHA512 9721d8f3812855d7a9155d8e5ecac305dedb5c8326ccf8ea679048f920ca58a774576840c1b0bc2864a26c66c89bf0c81ed1a1ab30fb571a6cfaebc5b499c2b7 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 -EBUILD bpftrace-0.15.0-r1.ebuild 1920 BLAKE2B 0dbd401e929c3a88106593fd4fe01feb10b7285ecadbec0b1acb2d2ab30a1e60735f45f7ed4b0b07d31e58b0cbe65a8ebe5a1c831f7bc74e9e03ef870fd19027 SHA512 6f6ce6815718a938c4da18c375e1edfbc5cf0d6ae89628cd2b7137015aefab09f34b906e52adadb8f4f4332fac388b5528eb8c7fba42ff02c415c75b2adc1ca6 +EBUILD bpftrace-0.15.0-r1.ebuild 1971 BLAKE2B 1276fff10465ee92d894df3661284cc9c20e3e5d7c5b09a7a7a81629f90b34daf311f16a9d39130c1006254f1b1e8407cf37ea063c2bd2257335ebd4fafabec2 SHA512 39e5b3bd165e95f6e3d1a8cf24203e3b2df28972b33df5ac4f959b9b6728321025a7d5931116f19b14b3362a7759904b1d849e956c30542c08afc7049ab0471d MISC metadata.xml 499 BLAKE2B ce7c46f4c5e49f2f779ff6584053f7fc78dffaeee432ac46a8881b3d49dc569e309af95aaf9d6e77a36ebc87be0cd2f86a5db7b733463e4252d3a242d914f293 SHA512 dfb827afd47feb8204ef40c940ebcc7d1b3217cdf0f24425e4ab32195309d727225e942d777871565e47a2c02244d053f46ed25165e9728c94e0683ff61bf4ce diff --git a/dev-util/bpftrace/bpftrace-0.15.0-r1.ebuild b/dev-util/bpftrace/bpftrace-0.15.0-r1.ebuild index 51346cb3d38d..566a14a29b4a 100644 --- a/dev-util/bpftrace/bpftrace-0.15.0-r1.ebuild +++ b/dev-util/bpftrace/bpftrace-0.15.0-r1.ebuild @@ -53,6 +53,7 @@ PATCHES=( "${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" ) pkg_pretend() { 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 new file mode 100644 index 000000000000..cb4b8a9bb2d2 --- /dev/null +++ b/dev-util/bpftrace/files/bpftrace-0.15.0-binutils-2.39.patch @@ -0,0 +1,87 @@ + +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); |