From 2db43213e5c343995f4b9fb977726fe42ebdac67 Mon Sep 17 00:00:00 2001
From: V3n3RiX <venerix@koprulu.sector>
Date: Fri, 27 Jan 2023 01:57:18 +0000
Subject: gentoo auto-resync : 27:01:2023 - 01:57:17

---
 dev-util/Manifest.gz                               | Bin 68084 -> 68084 bytes
 dev-util/bpftrace/Manifest                         |   2 +
 dev-util/bpftrace/bpftrace-0.16.0-r2.ebuild        |  93 +++++
 .../files/bpftrace-0.16.0-opaquepointer.patch      | 450 +++++++++++++++++++++
 dev-util/lldb/Manifest                             |   2 +-
 dev-util/lldb/lldb-15.0.7.ebuild                   |   2 +-
 dev-util/patdiff/Manifest                          |   2 +-
 dev-util/patdiff/patdiff-0.15.0.ebuild             |   4 +-
 8 files changed, 550 insertions(+), 5 deletions(-)
 create mode 100644 dev-util/bpftrace/bpftrace-0.16.0-r2.ebuild
 create mode 100644 dev-util/bpftrace/files/bpftrace-0.16.0-opaquepointer.patch

(limited to 'dev-util')

diff --git a/dev-util/Manifest.gz b/dev-util/Manifest.gz
index 950143f2fc3d..1cd73539c327 100644
Binary files a/dev-util/Manifest.gz and b/dev-util/Manifest.gz differ
diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest
index 6232a7d6bd27..96f77dc68b17 100644
--- a/dev-util/bpftrace/Manifest
+++ b/dev-util/bpftrace/Manifest
@@ -5,9 +5,11 @@ AUX bpftrace-0.15.0-dont-compress-man.patch 1885 BLAKE2B 89a327cef68fa838d5c04b3
 AUX bpftrace-0.15.0-install-libs.patch 8206 BLAKE2B 9d8b193f422b0ee64301b7ea12791afdd5111cde487b904ec35750e6189fdd6faca9af36b8956058c820c2398bcabc7dcee6d26b93c55ff1e591b3259a682a27 SHA512 9721d8f3812855d7a9155d8e5ecac305dedb5c8326ccf8ea679048f920ca58a774576840c1b0bc2864a26c66c89bf0c81ed1a1ab30fb571a6cfaebc5b499c2b7
 AUX bpftrace-0.15.0-llvm-15-pointers.patch 1023 BLAKE2B fc66196f11e9384878921309d09e3f205674a88041c93b0b353bf38ff345b4192b83cd1c80a15258b97710624b3341c9ed19b60beff38c163f677d644843ff54 SHA512 8282aa82eb867eed3378adc4ff2b73c6427d4f979cfb5268444bf122126c758229d680985e4ede7e8d011a14d4a122d6742650f57ee0e0759e3b1bfb9ba9458f
 AUX bpftrace-0.16.0-install-libs.patch 8507 BLAKE2B 84842c5c400e2921d40f32ccd27ec06174c517e35b3a413907231e128d636e7c4711d131682d3fbc75a861bf3cd0cf83de2ca1c4bfbf2606e69d32f898fbd3a4 SHA512 93341eca7566d1328cbd670685859803cc76869be2eb3d52d38e3956f30d28f63d73ba32ae7f111dfd01ccb95899be6e1834fe7e1f1ee3794a0b796b8f52574e
+AUX bpftrace-0.16.0-opaquepointer.patch 20038 BLAKE2B beeda98ded230a8bb22d2a32dd0e839f138ca9c9fec10402d039f4385016b4330ce94756641e4f24a5a1e294ce08d282cbf4f7e01ef0c817dda21d2324f7cf60 SHA512 4b61fe7d21a42493590e5e6bc7507852d6a1f0d685d78958d6aa2c1602211d99bbccced25a2c118ecdedd802ccfdd009b940ccb81573b28b010a476952bd1da7
 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
 EBUILD bpftrace-0.15.0-r2.ebuild 2008 BLAKE2B c947ed7d7ffe63e6d8f67b8de5a62ff5053aa3ffeffde602c32aac7dace1916d9ec288c3f1a3077cf6833b8ff32459f6c4e2879bf6f8e392535d3527029a4660 SHA512 f1ca5e2650bb0caa191f65af578fe52126777080ce852cefc21af513ae77103c9ef555902eda60675234e7632651621ff4c8f68fcb4b83491c411834014d9875
 EBUILD bpftrace-0.16.0-r1.ebuild 1740 BLAKE2B b798c92e0e80396c069d83b1f9d55d019382a4f3615c4a064d9b0c196c010c4399d488c41ef403702a5e3ccdff14d1cd4466a8b0d6cdb25902b48498197120b7 SHA512 0b252876bcd309520eb3daa4216cf21e1d8b1eb2ea0e33f5abe3b5d48cf32e8c5e5739f46c395f4678c64e39841e87093b829269563eadd51bdb10acf0b51d3c
+EBUILD bpftrace-0.16.0-r2.ebuild 1791 BLAKE2B bd0db18452f6d36ea37658b477219fc10edb329b17aa0fb6f26bce4578c9ddba88915e0a026fd190fcb5eba8bf005d930d6fcda590da623725a8254e8f224f30 SHA512 569974b254bd1ffc50018bc66edac49bb0f2c07a8990caded28fdf24f5728b16df08cc20157f07e248eb960291ecf9c8f5782bc4e1701ce2e8631f0abcbd8164
 MISC metadata.xml 499 BLAKE2B ce7c46f4c5e49f2f779ff6584053f7fc78dffaeee432ac46a8881b3d49dc569e309af95aaf9d6e77a36ebc87be0cd2f86a5db7b733463e4252d3a242d914f293 SHA512 dfb827afd47feb8204ef40c940ebcc7d1b3217cdf0f24425e4ab32195309d727225e942d777871565e47a2c02244d053f46ed25165e9728c94e0683ff61bf4ce
diff --git a/dev-util/bpftrace/bpftrace-0.16.0-r2.ebuild b/dev-util/bpftrace/bpftrace-0.16.0-r2.ebuild
new file mode 100644
index 000000000000..dca9044e1ff0
--- /dev/null
+++ b/dev-util/bpftrace/bpftrace-0.16.0-r2.ebuild
@@ -0,0 +1,93 @@
+# 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/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.16.0-install-libs.patch"
+	"${FILESDIR}/bpftrace-0.15.0-dont-compress-man.patch"
+	"${FILESDIR}/bpftrace-0.11.4-old-kernels.patch"
+	"${FILESDIR}/bpftrace-0.16.0-opaquepointer.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
+	)
+
+	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.16.0-opaquepointer.patch b/dev-util/bpftrace/files/bpftrace-0.16.0-opaquepointer.patch
new file mode 100644
index 000000000000..656bf0f6a639
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.16.0-opaquepointer.patch
@@ -0,0 +1,450 @@
+commit a8665b2ef3199e82fd2ad076c1f07f1af2ec9272
+Author: Viktor Malik <viktor.malik@gmail.com>
+Date:   Mon Oct 10 14:26:38 2022 +0200
+
+    IR builder: get rid of getPointerElementType calls
+    
+    Usage of Value::getPointerElementType is deprecated and will be dropped
+    in LLVM 16 [1].
+    
+    There are several places where we use this method:
+    - function (value) calls - the called function type is usually
+      available, so just pass it to createCall, the only exception is
+      CreateProbeReadStr which must have been refactored
+    - getting the type of alloca instruction - there is a dedicated
+      AllocaInst::getAllocatedType method that can be used instead
+    - strncmp - pass sizes of the strings to CreateStrncmp to be able to get
+      the correct string type (which is array of uint8)
+    
+    [1] https://llvm.org/docs/OpaquePointers.html
+
+diff --git a/src/ast/irbuilderbpf.cpp b/src/ast/irbuilderbpf.cpp
+index 09ae1c5e..da120ba1 100644
+--- a/src/ast/irbuilderbpf.cpp
++++ b/src/ast/irbuilderbpf.cpp
+@@ -291,17 +291,16 @@ CallInst *IRBuilderBPF::CreateHelperCall(libbpf::bpf_func_id func_id,
+   Constant *helper_func = ConstantExpr::getCast(Instruction::IntToPtr,
+                                                 getInt64(func_id),
+                                                 helper_ptr_type);
+-  return createCall(helper_func, args, Name);
++  return createCall(helper_type, helper_func, args, Name);
+ }
+ 
+-CallInst *IRBuilderBPF::createCall(Value *callee,
++CallInst *IRBuilderBPF::createCall(FunctionType *callee_type,
++                                   Value *callee,
+                                    ArrayRef<Value *> args,
+                                    const Twine &Name)
+ {
+ #if LLVM_VERSION_MAJOR >= 11
+-  auto *calleePtrType = cast<PointerType>(callee->getType());
+-  auto *calleeType = cast<FunctionType>(calleePtrType->getPointerElementType());
+-  return CreateCall(calleeType, callee, args, Name);
++  return CreateCall(callee_type, callee, args, Name);
+ #else
+   return CreateCall(callee, args, Name);
+ #endif
+@@ -310,7 +309,7 @@ CallInst *IRBuilderBPF::createCall(Value *callee,
+ CallInst *IRBuilderBPF::CreateBpfPseudoCallId(int mapid)
+ {
+   Function *pseudo_func = module_.getFunction("llvm.bpf.pseudo");
+-  return createCall(pseudo_func,
++  return CreateCall(pseudo_func,
+                     { getInt64(BPF_PSEUDO_MAP_FD), getInt64(mapid) },
+                     "pseudo");
+ }
+@@ -349,7 +348,8 @@ CallInst *IRBuilderBPF::createMapLookup(int mapid, Value *key)
+       Instruction::IntToPtr,
+       getInt64(libbpf::BPF_FUNC_map_lookup_elem),
+       lookup_func_ptr_type);
+-  return createCall(lookup_func, { map_ptr, key }, "lookup_elem");
++  return createCall(
++      lookup_func_type, lookup_func, { map_ptr, key }, "lookup_elem");
+ }
+ 
+ CallInst *IRBuilderBPF::CreateGetJoinMap(Value *ctx, const location &loc)
+@@ -400,8 +400,7 @@ Value *IRBuilderBPF::CreateMapLookupElem(Value *ctx,
+     CREATE_MEMCPY(value, call, type.GetSize(), 1);
+   else
+   {
+-    assert(value->getType()->isPointerTy() &&
+-           (value->getType()->getPointerElementType() == getInt64Ty()));
++    assert(value->getAllocatedType() == getInt64Ty());
+     // createMapLookup  returns an u8*
+     auto *cast = CreatePointerCast(call, value->getType(), "cast");
+     CreateStore(CreateLoad(getInt64Ty(), cast), value);
+@@ -451,7 +450,8 @@ void IRBuilderBPF::CreateMapUpdateElem(Value *ctx,
+       Instruction::IntToPtr,
+       getInt64(libbpf::BPF_FUNC_map_update_elem),
+       update_func_ptr_type);
+-  CallInst *call = createCall(update_func,
++  CallInst *call = createCall(update_func_type,
++                              update_func,
+                               { map_ptr, key, val, flags },
+                               "update_elem");
+   CreateHelperErrorCond(ctx, call, libbpf::BPF_FUNC_map_update_elem, loc);
+@@ -475,7 +475,8 @@ void IRBuilderBPF::CreateMapDeleteElem(Value *ctx,
+       Instruction::IntToPtr,
+       getInt64(libbpf::BPF_FUNC_map_delete_elem),
+       delete_func_ptr_type);
+-  CallInst *call = createCall(delete_func, { map_ptr, key }, "delete_elem");
++  CallInst *call = createCall(
++      delete_func_type, delete_func, { map_ptr, key }, "delete_elem");
+   CreateHelperErrorCond(ctx, call, libbpf::BPF_FUNC_map_delete_elem, loc);
+ }
+ 
+@@ -501,72 +502,53 @@ void IRBuilderBPF::CreateProbeRead(Value *ctx,
+   Constant *proberead_func = ConstantExpr::getCast(Instruction::IntToPtr,
+                                                    getInt64(read_fn),
+                                                    proberead_func_ptr_type);
+-  CallInst *call = createCall(proberead_func,
++  CallInst *call = createCall(proberead_func_type,
++                              proberead_func,
+                               { dst, size, src },
+                               probeReadHelperName(read_fn));
+   CreateHelperErrorCond(ctx, call, read_fn, loc);
+ }
+ 
+-Constant *IRBuilderBPF::createProbeReadStrFn(llvm::Type *dst,
+-                                             llvm::Type *src,
+-                                             AddrSpace as)
+-{
+-  assert(src && (src->isIntegerTy() || src->isPointerTy()));
+-  // int bpf_probe_read_str(void *dst, int size, const void *unsafe_ptr)
+-  FunctionType *probereadstr_func_type = FunctionType::get(
+-      getInt64Ty(), { dst, getInt32Ty(), src }, false);
+-  PointerType *probereadstr_func_ptr_type = PointerType::get(
+-      probereadstr_func_type, 0);
+-  return ConstantExpr::getCast(Instruction::IntToPtr,
+-                               getInt64(selectProbeReadHelper(as, true)),
+-                               probereadstr_func_ptr_type);
+-}
+-
+ CallInst *IRBuilderBPF::CreateProbeReadStr(Value *ctx,
+-                                           AllocaInst *dst,
++                                           Value *dst,
+                                            size_t size,
+                                            Value *src,
+                                            AddrSpace as,
+                                            const location &loc)
+ {
+-  assert(ctx && ctx->getType() == getInt8PtrTy());
+   return CreateProbeReadStr(ctx, dst, getInt32(size), src, as, loc);
+ }
+ 
+ CallInst *IRBuilderBPF::CreateProbeReadStr(Value *ctx,
+                                            Value *dst,
+-                                           size_t size,
+-                                           Value *src,
+-                                           AddrSpace as,
+-                                           const location &loc)
+-{
+-  assert(ctx && ctx->getType() == getInt8PtrTy());
+-  Constant *fn = createProbeReadStrFn(dst->getType(), src->getType(), as);
+-  auto read_fn = selectProbeReadHelper(as, true);
+-  CallInst *call = createCall(fn,
+-                              { dst, getInt32(size), src },
+-                              probeReadHelperName(read_fn));
+-  CreateHelperErrorCond(ctx, call, read_fn, loc);
+-  return call;
+-}
+-
+-CallInst *IRBuilderBPF::CreateProbeReadStr(Value *ctx,
+-                                           AllocaInst *dst,
+                                            llvm::Value *size,
+                                            Value *src,
+                                            AddrSpace as,
+                                            const location &loc)
+ {
+   assert(ctx && ctx->getType() == getInt8PtrTy());
+-  assert(dst && dst->getAllocatedType()->isArrayTy() &&
+-         dst->getAllocatedType()->getArrayElementType() == getInt8Ty());
+   assert(size && size->getType()->isIntegerTy());
++  if (auto *dst_alloca = dyn_cast<AllocaInst>(dst))
++  {
++    assert(dst_alloca->getAllocatedType()->isArrayTy() &&
++           dst_alloca->getAllocatedType()->getArrayElementType() ==
++               getInt8Ty());
++  }
+ 
+-  auto *size_i32 = CreateIntCast(size, getInt32Ty(), false);
++  auto *size_i32 = size;
++  if (size_i32->getType()->getScalarSizeInBits() != 32)
++    size_i32 = CreateIntCast(size_i32, getInt32Ty(), false);
+ 
+-  Constant *fn = createProbeReadStrFn(dst->getType(), src->getType(), as);
+   auto read_fn = selectProbeReadHelper(as, true);
+-  CallInst *call = createCall(fn,
++  // int bpf_probe_read_str(void *dst, int size, const void *unsafe_ptr)
++  FunctionType *probereadstr_func_type = FunctionType::get(
++      getInt64Ty(), { dst->getType(), getInt32Ty(), src->getType() }, false);
++  PointerType *probereadstr_func_ptr_type = PointerType::get(
++      probereadstr_func_type, 0);
++  Constant *probereadstr_callee = ConstantExpr::getCast(
++      Instruction::IntToPtr, getInt64(read_fn), probereadstr_func_ptr_type);
++  CallInst *call = createCall(probereadstr_func_type,
++                              probereadstr_callee,
+                               { dst, size_i32, src },
+                               probeReadHelperName(read_fn));
+   CreateHelperErrorCond(ctx, call, read_fn, loc);
+@@ -725,8 +707,10 @@ Value *IRBuilderBPF::CreateUSDTReadArgument(Value *ctx,
+   return result;
+ }
+ 
+-Value *IRBuilderBPF::CreateStrncmp(Value *val1,
+-                                   Value *val2,
++Value *IRBuilderBPF::CreateStrncmp(Value *str1,
++                                   uint64_t str1_size,
++                                   Value *str2,
++                                   uint64_t str2_size,
+                                    uint64_t n,
+                                    bool inverse)
+ {
+@@ -755,40 +739,21 @@ Value *IRBuilderBPF::CreateStrncmp(Value *val1,
+   // Check if the compared strings are literals.
+   // If so, we can avoid storing the literal in memory.
+   std::optional<std::string> literal1;
+-  if (auto constString1 = dyn_cast<ConstantDataArray>(val1))
++  if (auto constString1 = dyn_cast<ConstantDataArray>(str1))
+     literal1 = constString1->getAsString();
+-  else if (isa<ConstantAggregateZero>(val1))
++  else if (isa<ConstantAggregateZero>(str1))
+     literal1 = "";
+   else
+     literal1 = std::nullopt;
+ 
+   std::optional<std::string> literal2;
+-  if (auto constString2 = dyn_cast<ConstantDataArray>(val2))
++  if (auto constString2 = dyn_cast<ConstantDataArray>(str2))
+     literal2 = constString2->getAsString();
+-  else if (isa<ConstantAggregateZero>(val2))
++  else if (isa<ConstantAggregateZero>(str2))
+     literal2 = "";
+   else
+     literal2 = std::nullopt;
+ 
+-  auto *val1p = dyn_cast<PointerType>(val1->getType());
+-  auto *val2p = dyn_cast<PointerType>(val2->getType());
+-#ifndef NDEBUG
+-  if (!literal1)
+-  {
+-    assert(val1p);
+-    assert(val1p->getPointerElementType()->isArrayTy() &&
+-           val1p->getPointerElementType()->getArrayElementType() ==
+-               getInt8Ty());
+-  }
+-  if (!literal2)
+-  {
+-    assert(val2p);
+-    assert(val2p->getPointerElementType()->isArrayTy() &&
+-           val2p->getPointerElementType()->getArrayElementType() ==
+-               getInt8Ty());
+-  }
+-#endif
+-
+   Function *parent = GetInsertBlock()->getParent();
+   AllocaInst *store = CreateAllocaBPF(getInt1Ty(), "strcmp.result");
+   BasicBlock *str_ne = BasicBlock::Create(module_.getContext(),
+@@ -815,8 +780,8 @@ Value *IRBuilderBPF::CreateStrncmp(Value *val1,
+       l = getInt8(literal1->c_str()[i]);
+     else
+     {
+-      auto *ptr_l = CreateGEP(val1p->getPointerElementType(),
+-                              val1,
++      auto *ptr_l = CreateGEP(ArrayType::get(getInt8Ty(), str1_size),
++                              str1,
+                               { getInt32(0), getInt32(i) });
+       l = CreateLoad(getInt8Ty(), ptr_l);
+     }
+@@ -826,8 +791,8 @@ Value *IRBuilderBPF::CreateStrncmp(Value *val1,
+       r = getInt8(literal2->c_str()[i]);
+     else
+     {
+-      auto *ptr_r = CreateGEP(val2p->getPointerElementType(),
+-                              val2,
++      auto *ptr_r = CreateGEP(ArrayType::get(getInt8Ty(), str2_size),
++                              str2,
+                               { getInt32(0), getInt32(i) });
+       r = CreateLoad(getInt8Ty(), ptr_r);
+     }
+@@ -987,11 +952,9 @@ void IRBuilderBPF::CreateGetCurrentComm(Value *ctx,
+                                         size_t size,
+                                         const location &loc)
+ {
+-  assert(buf->getType()->getPointerElementType()->isArrayTy() &&
+-         buf->getType()->getPointerElementType()->getArrayNumElements() >=
+-             size &&
+-         buf->getType()->getPointerElementType()->getArrayElementType() ==
+-             getInt8Ty());
++  assert(buf->getAllocatedType()->isArrayTy() &&
++         buf->getAllocatedType()->getArrayNumElements() >= size &&
++         buf->getAllocatedType()->getArrayElementType() == getInt8Ty());
+ 
+   // long bpf_get_current_comm(char *buf, int size_of_buf)
+   // Return: 0 on success or negative error
+@@ -1070,7 +1033,7 @@ void IRBuilderBPF::CreateSignal(Value *ctx, Value *sig, const location &loc)
+       Instruction::IntToPtr,
+       getInt64(libbpf::BPF_FUNC_send_signal),
+       signal_func_ptr_type);
+-  CallInst *call = createCall(signal_func, { sig }, "signal");
++  CallInst *call = createCall(signal_func_type, signal_func, { sig }, "signal");
+   CreateHelperErrorCond(ctx, call, libbpf::BPF_FUNC_send_signal, loc);
+ }
+ 
+@@ -1084,7 +1047,7 @@ void IRBuilderBPF::CreateOverrideReturn(Value *ctx, Value *rc)
+   Constant *override_func = ConstantExpr::getCast(Instruction::IntToPtr,
+       getInt64(libbpf::BPF_FUNC_override_return),
+       override_func_ptr_type);
+-  createCall(override_func, { ctx, rc }, "override");
++  createCall(override_func_type, override_func, { ctx, rc }, "override");
+ }
+ 
+ CallInst *IRBuilderBPF::CreateSkbOutput(Value *skb,
+@@ -1119,7 +1082,8 @@ CallInst *IRBuilderBPF::CreateSkbOutput(Value *skb,
+       Instruction::IntToPtr,
+       getInt64(libbpf::BPF_FUNC_skb_output),
+       skb_output_func_ptr_type);
+-  CallInst *call = createCall(skb_output_func,
++  CallInst *call = createCall(skb_output_func_type,
++                              skb_output_func,
+                               { skb, map_ptr, flags, data, size_val },
+                               "skb_output");
+   return call;
+@@ -1328,7 +1292,8 @@ void IRBuilderBPF::CreateSeqPrintf(Value *ctx,
+                           CreateGEP(getInt64Ty(), meta, getInt64(0)),
+                           "seq");
+ 
+-  CallInst *call = createCall(seq_printf_func,
++  CallInst *call = createCall(seq_printf_func_type,
++                              seq_printf_func,
+                               { seq, fmt, fmt_size, data, data_len },
+                               "seq_printf");
+   CreateHelperErrorCond(ctx, call, libbpf::BPF_FUNC_seq_printf, loc);
+diff --git a/src/ast/irbuilderbpf.h b/src/ast/irbuilderbpf.h
+index b6a06778..19b28180 100644
+--- a/src/ast/irbuilderbpf.h
++++ b/src/ast/irbuilderbpf.h
+@@ -106,17 +106,11 @@ public:
+       bool isVolatile = false,
+       std::optional<AddrSpace> addrSpace = std::nullopt);
+   CallInst *CreateProbeReadStr(Value *ctx,
+-                               AllocaInst *dst,
++                               Value *dst,
+                                llvm::Value *size,
+                                Value *src,
+                                AddrSpace as,
+                                const location &loc);
+-  CallInst *CreateProbeReadStr(Value *ctx,
+-                               AllocaInst *dst,
+-                               size_t size,
+-                               Value *src,
+-                               AddrSpace as,
+-                               const location &loc);
+   CallInst *CreateProbeReadStr(Value *ctx,
+                                Value *dst,
+                                size_t size,
+@@ -131,7 +125,12 @@ public:
+                                 pid_t pid,
+                                 AddrSpace as,
+                                 const location &loc);
+-  Value *CreateStrncmp(Value *val1, Value *val2, uint64_t n, bool inverse);
++  Value *CreateStrncmp(Value *str1,
++                       uint64_t str1_size,
++                       Value *str2,
++                       uint64_t str2_size,
++                       uint64_t n,
++                       bool inverse);
+   CallInst *CreateGetNs(bool boot_time, const location &loc);
+   CallInst *CreateGetPidTgid(const location &loc);
+   CallInst *CreateGetCurrentCgroupId(const location &loc);
+@@ -147,7 +146,10 @@ public:
+                              ArrayRef<Value *> args,
+                              const Twine &Name,
+                              const location *loc = nullptr);
+-  CallInst   *createCall(Value *callee, ArrayRef<Value *> args, const Twine &Name);
++  CallInst *createCall(FunctionType *callee_type,
++                       Value *callee,
++                       ArrayRef<Value *> args,
++                       const Twine &Name);
+   void        CreateGetCurrentComm(Value *ctx, AllocaInst *buf, size_t size, const location& loc);
+   void CreatePerfEventOutput(Value *ctx,
+                              Value *data,
+@@ -205,9 +207,6 @@ private:
+                                 AddrSpace as,
+                                 const location &loc);
+   CallInst *createMapLookup(int mapid, Value *key);
+-  Constant *createProbeReadStrFn(llvm::Type *dst,
+-                                 llvm::Type *src,
+-                                 AddrSpace as);
+   libbpf::bpf_func_id selectProbeReadHelper(AddrSpace as, bool str);
+ 
+   llvm::Type *getKernelPointerStorageTy();
+diff --git a/src/ast/passes/codegen_llvm.cpp b/src/ast/passes/codegen_llvm.cpp
+index d4a5e1c7..0703d196 100644
+--- a/src/ast/passes/codegen_llvm.cpp
++++ b/src/ast/passes/codegen_llvm.cpp
+@@ -1152,8 +1152,12 @@ void CodegenLLVM::visit(Call &call)
+     auto left_string = getString(left_arg);
+     auto right_string = getString(right_arg);
+ 
+-    expr_ = b_.CreateStrncmp(
+-        left_string.first, right_string.first, size, false);
++    expr_ = b_.CreateStrncmp(left_string.first,
++                             left_string.second,
++                             right_string.first,
++                             right_string.second,
++                             size,
++                             false);
+   }
+   else if (call.func == "override")
+   {
+@@ -1284,8 +1288,7 @@ void CodegenLLVM::visit(Variable &var)
+   else
+   {
+     auto *var_alloca = variables_[var.ident];
+-    expr_ = b_.CreateLoad(var_alloca->getType()->getPointerElementType(),
+-                          var_alloca);
++    expr_ = b_.CreateLoad(var_alloca->getAllocatedType(), var_alloca);
+   }
+ }
+ 
+@@ -1325,7 +1328,12 @@ void CodegenLLVM::binop_string(Binop &binop)
+   auto right_string = getString(binop.right);
+ 
+   size_t len = std::min(left_string.second, right_string.second);
+-  expr_ = b_.CreateStrncmp(left_string.first, right_string.first, len, inverse);
++  expr_ = b_.CreateStrncmp(left_string.first,
++                           left_string.second,
++                           right_string.first,
++                           right_string.second,
++                           len,
++                           inverse);
+ }
+ 
+ void CodegenLLVM::binop_buf(Binop &binop)
+@@ -1349,7 +1357,12 @@ void CodegenLLVM::binop_buf(Binop &binop)
+ 
+   size_t len = std::min(binop.left->type.GetSize(),
+                         binop.right->type.GetSize());
+-  expr_ = b_.CreateStrncmp(left_string, right_string, len, inverse);
++  expr_ = b_.CreateStrncmp(left_string,
++                           binop.left->type.GetSize(),
++                           right_string,
++                           binop.right->type.GetSize(),
++                           len,
++                           inverse);
+ }
+ 
+ void CodegenLLVM::binop_int(Binop &binop)
+@@ -3498,9 +3511,8 @@ void CodegenLLVM::createIncDec(Unop &unop)
+   else if (unop.expr->is_variable)
+   {
+     Variable &var = static_cast<Variable &>(*unop.expr);
+-    Value *oldval = b_.CreateLoad(
+-        variables_[var.ident]->getType()->getPointerElementType(),
+-        variables_[var.ident]);
++    Value *oldval = b_.CreateLoad(variables_[var.ident]->getAllocatedType(),
++                                  variables_[var.ident]);
+     Value *newval;
+     if (is_increment)
+       newval = b_.CreateAdd(oldval, b_.GetIntSameSize(step, oldval));
diff --git a/dev-util/lldb/Manifest b/dev-util/lldb/Manifest
index 0064d0cfa4b9..0b66a3ad3b64 100644
--- a/dev-util/lldb/Manifest
+++ b/dev-util/lldb/Manifest
@@ -9,7 +9,7 @@ DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69b
 EBUILD lldb-13.0.1.ebuild 2587 BLAKE2B e71ae0f087f5490352932e4ed8daed99377a7579f93fb325c01b39faebd3000ebe8c73e9875dc609dda168649d5ca6e092fa9cdad8e847cbf01b1ddf95d1be2e SHA512 9ed40d4927f116f6c18a8c2d38287fb386c280d0f8ec40514c886b1298b5f19fae5f4102f715284e00503401df96e0ecb6cc23378c23e91d2baa383a76488ee3
 EBUILD lldb-14.0.6.ebuild 2661 BLAKE2B 57d0c4810421eff9d3fab976f16d8ad92e67764aaa9c72154a793c7783d98e835789df2cdd2c64f44c035f85e29652e5e50b72ceb161d4dc0dc803983234c08f SHA512 54120a86d7655cc53bb0ee858561959e112f415e9f23e4d56cd0d7716147b2563bdcb3800005eebd8311c237659319f735176072547a7f2162fc9b4f641dfdf0
 EBUILD lldb-15.0.6.ebuild 2716 BLAKE2B 88e5c97e848e7e83261c6c18c6f4857f173515b346d734641c2add5ac31d840cbe1795a3ee46e619aff337192e6d618f43dac21eeba5a3e3f541b715768f9f17 SHA512 d4f9993fc13dd50504d05fc23b000796c6e747d65f816d23856d0eade3aa419fc8d68d77bab3e17f09013606b6f02ce7389e08877ee7d8a75fbe9f99a99e9e0e
-EBUILD lldb-15.0.7.ebuild 2718 BLAKE2B 650531d52ae06d2cc3bef2341494fecdd07144a56fecba957ff62451919159054a7cd2ff003383a796fdd7ef046c3f784831217dda736e80225de327414edf4f SHA512 299c40195ffa4f87c543112c6407a0f0b404aa344fd4f4235eb79ff06f3d66449b0e36c3294125385f50c4850fb77e83ece1d98c3d34f4ac129650d2b0774a03
+EBUILD lldb-15.0.7.ebuild 2716 BLAKE2B 88e5c97e848e7e83261c6c18c6f4857f173515b346d734641c2add5ac31d840cbe1795a3ee46e619aff337192e6d618f43dac21eeba5a3e3f541b715768f9f17 SHA512 d4f9993fc13dd50504d05fc23b000796c6e747d65f816d23856d0eade3aa419fc8d68d77bab3e17f09013606b6f02ce7389e08877ee7d8a75fbe9f99a99e9e0e
 EBUILD lldb-16.0.0.9999.ebuild 2664 BLAKE2B 791938f67edd484c779b8663b1658a6c6db81d0283a2bc62b36c5499e27c61424055356511f5d4e306987fcbc4a490277d986d60ae77342021975ae89119fe14 SHA512 619c4fc08e3f0e175e97d3eeb8c37321ef5423e2d179d423c0daa586862e7ed21ceab83d36c6a6dd7cec82cc91f9f9ba34d17296bbad2b97cb4b14663796c2bb
 EBUILD lldb-16.0.0_pre20230107.ebuild 2664 BLAKE2B 791938f67edd484c779b8663b1658a6c6db81d0283a2bc62b36c5499e27c61424055356511f5d4e306987fcbc4a490277d986d60ae77342021975ae89119fe14 SHA512 619c4fc08e3f0e175e97d3eeb8c37321ef5423e2d179d423c0daa586862e7ed21ceab83d36c6a6dd7cec82cc91f9f9ba34d17296bbad2b97cb4b14663796c2bb
 EBUILD lldb-17.0.0.9999.ebuild 2664 BLAKE2B 791938f67edd484c779b8663b1658a6c6db81d0283a2bc62b36c5499e27c61424055356511f5d4e306987fcbc4a490277d986d60ae77342021975ae89119fe14 SHA512 619c4fc08e3f0e175e97d3eeb8c37321ef5423e2d179d423c0daa586862e7ed21ceab83d36c6a6dd7cec82cc91f9f9ba34d17296bbad2b97cb4b14663796c2bb
diff --git a/dev-util/lldb/lldb-15.0.7.ebuild b/dev-util/lldb/lldb-15.0.7.ebuild
index bdd2015ac3b2..37c23ed60fb5 100644
--- a/dev-util/lldb/lldb-15.0.7.ebuild
+++ b/dev-util/lldb/lldb-15.0.7.ebuild
@@ -11,7 +11,7 @@ HOMEPAGE="https://llvm.org/"
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0/${LLVM_SOABI}"
-KEYWORDS="amd64 ~arm arm64 ~x86"
+KEYWORDS="amd64 arm arm64 x86"
 IUSE="debug +libedit lzma ncurses +python test +xml"
 RESTRICT="test"
 REQUIRED_USE=${PYTHON_REQUIRED_USE}
diff --git a/dev-util/patdiff/Manifest b/dev-util/patdiff/Manifest
index da2adf538746..09fae2c6f891 100644
--- a/dev-util/patdiff/Manifest
+++ b/dev-util/patdiff/Manifest
@@ -1,5 +1,5 @@
 DIST patdiff-0.14.0.tar.gz 220013 BLAKE2B 274d3590fc2ce8b72eb80d5c2dd07578729e9d1bcbdf7d4f94f35248f854a6a242cd0298dce4574ed53e4cdf279e3586fb8a1b543e84c2c6b682f604dc3cb468 SHA512 2f326cbd4c2d153b3e64dd1bc4b514a9ca00292bf80835290fbe7d74e211261c043c002ff929971d65cf24825a42e0c1662fe5c5a1c8acbb8babad796f339601
 DIST patdiff-0.15.0.tar.gz 223538 BLAKE2B 1b73275f5c2f27441e62a03f1b3215f991302a20a4d4385a0795fb657e77d97bfeee0ed8bba54fac0b1136e02d29b4f3c689b2a03b0f80292deb787c33f235bc SHA512 f301e0133447f8284b565fd821db79239fff0401511ecfcef303fc79a3073b2cec527c7a357617541d5f149096c3f8977b717620893e53e2a407db1c3ea68924
 EBUILD patdiff-0.14.0-r1.ebuild 595 BLAKE2B c4078f5af191ff5239983bf424a091cc7b2017de995af43d9c9657d03e6e2ba358612c11295be781726f79553199ff3939cd63b48f3003289a08d3d73b522f29 SHA512 ece157234b02d170c9e640639cfb1e181f0beb053d039c962fe558153f999ad16a5a3c74b6140dc4f104fea653990f23de55aede37eeca58e20faabcaadcdcdd
-EBUILD patdiff-0.15.0.ebuild 523 BLAKE2B 624d5d3b8b1db25dd3043b255a89d061e21ddaabcde4453a2fd02fe3aab5a2c0dcf01ac564a78018587d8c13674207f381e3b7fd8678df7d78301c701738fcff SHA512 d465ca06248f1870cddeefd9fe17bab09e98356bdeb2b1ae4b2339b7805777a335c3f3d80803a62796085b9ab08759fa449a3efbbb8a598e421cd4dbe857e905
+EBUILD patdiff-0.15.0.ebuild 516 BLAKE2B 5a8a8228bd18b55fe2e440f5ac97380e79b50437f471c9b2113b016f353190e2eacbe36619a6505e2d35628e2e63a28350568e078e8a0e5aa7b60f588489ffe6 SHA512 b19ebf96695db55a237da79c50dcbf8bcdf625cc152a929f6eeec6b8fcade296fb3e422e0762898e98a71428cd208da1817ee8e9a71d1f494c4fb92aacd295f4
 MISC metadata.xml 316 BLAKE2B bc8a138519832163ad938dccce7225738b19ac893e077c245ee0f921f6f476ca153a1eb3026d5f69b5960fd4e746b1150ca514728625ef4eac151bcd4ed5798b SHA512 554123d49add147becf9ac14260c0400fd368a4cf7800a2e9732a71fe0f6b309acbf3d3256e2598d289f2616de294cbe159a8818ae59b24acebb7299feee0914
diff --git a/dev-util/patdiff/patdiff-0.15.0.ebuild b/dev-util/patdiff/patdiff-0.15.0.ebuild
index 8a8584db976a..f10b7a3ff52a 100644
--- a/dev-util/patdiff/patdiff-0.15.0.ebuild
+++ b/dev-util/patdiff/patdiff-0.15.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -11,7 +11,7 @@ SRC_URI="https://github.com/janestreet/patdiff/archive/v${PV}.tar.gz -> ${P}.tar
 
 LICENSE="Apache-2.0"
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~amd64 ~riscv"
+KEYWORDS="~amd64"
 IUSE="+ocamlopt"
 
 RDEPEND="
-- 
cgit v1.2.3