From 623ee73d661e5ed8475cb264511f683407d87365 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 12 Apr 2020 03:41:30 +0100 Subject: gentoo Easter resync : 12.04.2020 --- dev-util/bpftrace/Manifest | 3 +- dev-util/bpftrace/bpftrace-0.9.4.ebuild | 1 + .../bpftrace/files/bpftrace-0.9.4-llvm-10.patch | 144 +++++++++++++++++++++ 3 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 dev-util/bpftrace/files/bpftrace-0.9.4-llvm-10.patch (limited to 'dev-util/bpftrace') diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest index aee6ce21555a..ded215c8ba13 100644 --- a/dev-util/bpftrace/Manifest +++ b/dev-util/bpftrace/Manifest @@ -1,12 +1,13 @@ AUX bpftrace-0.10_pre20190614-install-libs.patch 4653 BLAKE2B 66229e4b3f7edc345eeac5f833348f7a434ee7f6c830c344b3c357fafec98b8cc8c725cf37ee01802d085cdbf9deb0fa13d9dd72161b230aff589c75b17890a3 SHA512 63f899bd119f86ee6e9bae0c2ef6e657a37a33c700414ea4757353f0637e89ef9ed3dbf1b70414eec1a5c2658451e8be3e7de1941a0796cac621361bcdd14537 AUX bpftrace-0.9.3-install-libs.patch 5117 BLAKE2B 6cad778dd19ab040f3bd88390329cc49261c83dcc0ff97f9e663d5fb0d55da87d0e4c1efaabbd31b11e383ea0f904fdab8bd7f34fbdd0805abe20d623673c1fc SHA512 0842712b8d32ba4f7bc0767e3748ed4e8517187c9c75d426e1946aacce3a46fd5f7100d4cef0bed655a763d102cfeff160d549065f6b9c6000a7b3f496cb8b87 AUX bpftrace-0.9.4-install-libs.patch 5481 BLAKE2B 96df784e95fc42e385dc3330d0ea074863a8ba3c3aeb8d7078b29e03708b2e46fccc30f097dbf2c347f0fb4afadee0d2b7cbb038b05a2d81fbd66e4e008302dc SHA512 e74994b020939035fb9a9b646f5572ae3f241f194e7f119c771d5391a651f27ab0733364a4ddcccd7759f5951141e61c4bf019f98a62a820577687109ca50854 +AUX bpftrace-0.9.4-llvm-10.patch 7123 BLAKE2B 61fe740aae135de1c039e73b3c4e8bd79a8a7412c3d06ad7a8ab3d8d3c0ec825053b4e6b1fcd208a7847cf8f0ff8436ed988aa403485f90755c0e59d5c2a5c8c SHA512 eaba150ea6dafb9e7ab13f1f23246ce064241369882b16bf7eb3a9dc74545064c604e4435c6567c6f0a0df9ac939120c5b3ac5ee95bdc669f9d0e82ededc9c95 AUX bpftrace-mandir.patch 906 BLAKE2B d875e2523b7e719624d92c58a8f058cdd597da07bf6472d2e3dc05eb46be64718ed4056e15a93e4c22264fa35ceb6b79b428febade422ba435a2a2b9e17fb707 SHA512 11544e9e5892ae3657ff903fa2780e71223e380322b4059ddcea4a6edd80c5a7ab8d45188eb577127f64a6705a6ae41d53f3ba7e05bf450853b12a9ba3d84904 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 EBUILD bpftrace-0.9.2.ebuild 1402 BLAKE2B 539e79098fd31d8ade5449f53e9b63d4c8b3ecd3e2716eab76f8a7eab00e11480224502369899f68eb839c9cb48cebc1f5fd6d6c231f93a4a16d58e19e973171 SHA512 9021699f98686a48954e39d653797b10d68cc56b284bdc77a58778dec41c20617031b1ccf8e15283a6b630b366856f6ec0d1013c6150709cc37f25d786f289db EBUILD bpftrace-0.9.3.ebuild 1391 BLAKE2B db3f13374aeac65bc6bbaccc6ae187c6f601c753d7b426562dad7af055c1c4a32965abd1a4d8100eddf96cc6b5cac8c1d839cbc4c9cd2ba4822f83c23bcb6c2c SHA512 1fc37e191621ba5c63d43e55f772b505eddff423f37d3697061a4a03000a5bbc8086cb5e4df87c98d080317213581058128b4a5a40c807e5034e6786ca8d37ee -EBUILD bpftrace-0.9.4.ebuild 1443 BLAKE2B bb82e30e721881ee3b9a73a80fbfada3c408f028a2ecdd44b467ad0bdd20386a36aaa57139b43a3111d8f7075dc5e83bc670c6acb7dbf79ca36e75b724861002 SHA512 6bf0353079eb2451301334942cfccfa89c866677ca7771fa6a2c191e3b758e0688e449cace67487fa8efb784669c65d6fdea7889f0a141b5d414b5d5bb55caeb +EBUILD bpftrace-0.9.4.ebuild 1487 BLAKE2B 1003d7865410fb246ac9aa58adafa018e3979a331543dffd7fdce772517875043f6602d7d2856aecf7eb76094d7bf6531f9cbd5e3f296c98f8e0e55178c069b7 SHA512 e122a7c9ab7db361447eb3a7ce79b416ede14b0eebe5ea0b507344fd4203f9e0cf9c9375f526494c4ec1f5c4bafc3153a97dc6bc8554001aac3e609f0f7b233e EBUILD bpftrace-9999.ebuild 1339 BLAKE2B 89932b8689799d37f5730662705d644059796e27abbb187e57f741450dbf1034d5322f3e94a4a493f0341f939fcc3902e3173d8b2357c70695c3f3dd957d7db5 SHA512 b7df8cb8af0c74599fb87a32ff1efff499e3559682c72fea78ea5d53e9513f0738fff86acbc91c54b21e3b20ba0e0ccea8f559e7d80f359e45e8448a7fa94000 MISC metadata.xml 308 BLAKE2B 5440fafa478bdbdf6906c74d697a9542deb8b13b76527a380df723562759d914d597dff029f93ba4567ce4e0f4723fded5a13ea7d2032752253bad1906e753dc SHA512 c27c2ef4795e9167ea133e0c0e2c6d67425d6db754bd563d9cb7a791b4a155ebe855ad0e67c2b29235a9b9761f29dbb14958b124c95a1aaddb97801c763914ba diff --git a/dev-util/bpftrace/bpftrace-0.9.4.ebuild b/dev-util/bpftrace/bpftrace-0.9.4.ebuild index 0afc8a9890fa..ad25d1221e13 100644 --- a/dev-util/bpftrace/bpftrace-0.9.4.ebuild +++ b/dev-util/bpftrace/bpftrace-0.9.4.ebuild @@ -40,6 +40,7 @@ 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" ) 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 new file mode 100644 index 000000000000..c2131cbbc306 --- /dev/null +++ b/dev-util/bpftrace/files/bpftrace-0.9.4-llvm-10.patch @@ -0,0 +1,144 @@ +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(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(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 { + -- cgit v1.2.3