summaryrefslogtreecommitdiff
path: root/dev-debug
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-01-22 16:48:54 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-01-22 16:48:54 +0000
commitce163dcd0944d81d8406c9532b457535efca7a6d (patch)
treef7deea170544ce69e03c037101b7b5c1277966b4 /dev-debug
parent05ee8049e2326946a2cd1720f98384c864f0a804 (diff)
gentoo auto-resync : 22:01:2024 - 16:48:54
Diffstat (limited to 'dev-debug')
-rw-r--r--dev-debug/Manifest.gzbin4016 -> 4010 bytes
-rw-r--r--dev-debug/lldb/Manifest2
-rw-r--r--dev-debug/lldb/lldb-18.0.0_pre20240120.ebuild115
-rw-r--r--dev-debug/valgrind/Manifest8
-rw-r--r--dev-debug/valgrind/files/0001-valgrind-monitor.py-regular-expressions-should-use-r.patch2
-rw-r--r--dev-debug/valgrind/files/0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch2
-rw-r--r--dev-debug/valgrind/files/0003-Add-fchmodat2-syscall-on-linux.patch2
-rw-r--r--dev-debug/valgrind/files/0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch151
-rw-r--r--dev-debug/valgrind/valgrind-3.22.0-r2.ebuild158
9 files changed, 434 insertions, 6 deletions
diff --git a/dev-debug/Manifest.gz b/dev-debug/Manifest.gz
index 17f4a8a5999c..d6fe5aaa63fc 100644
--- a/dev-debug/Manifest.gz
+++ b/dev-debug/Manifest.gz
Binary files differ
diff --git a/dev-debug/lldb/Manifest b/dev-debug/lldb/Manifest
index 15b9abfef3b7..5cacd1e921af 100644
--- a/dev-debug/lldb/Manifest
+++ b/dev-debug/lldb/Manifest
@@ -5,6 +5,7 @@ DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43
DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e0654111941649e15794179641806f18919f1dc68c41ca0cabd5693b5096d05dccc3a391cd20d34af1137bf8af92ed3117a1ce84d1b2 SHA512 6d85bf749e0d77553cc215cbfa61cec4ac4f4f652847f56f946b6a892a99a5ea40b6ab8b39a9708a035001f007986941ccf17e4635260a8b0c1fa59e78d41e30
DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340
DIST llvm-project-8d817f6479a5df874028a8b40fd30aecd3479005.tar.gz 204890108 BLAKE2B 8c57c556371b37d00cda753a40f1162e678d89fa40e8f2b90a38aab7e17f9debfb2ebad53a3a95aa530a9e3e2b4b735828e404e576c8f2738370ec41c28badce SHA512 a38ce082ca1b999888ee0a633b94a02258579591e6ce73ba4722eafb9f0610f9624887eca43e4a6ae567c07ffc014f4ea4137e905899407951265d7c93785f18
+DIST llvm-project-9eb0f86c279f40a792ec27bf0e9b491b8c90a640.tar.gz 205195168 BLAKE2B c3d051270958216196d6051d41e78168a7027714c5658c7edc70d274ed91f9d4ee16e8d1f92672bf252c65005c636c380766210ac3d80b4ac2f9f6305aefa29b SHA512 ee62acdfa756a2ddeb46fcafa364489885b6ecc50c87f365af42f308ebc87b9674c33c2f5a84c5169d9c9cada08e4fffe35d2eff48f05b70e791e27ac2c8b347
DIST llvm-project-a085402ef54379758e6c996dbaedfcb92ad222b5.tar.gz 204569231 BLAKE2B 75403225fbe54f0921b279b237a90f1922b16997d1538fa5f225e04451fa2fc4a28e886efb7460ef0c26a3a964f0c57084e331b0736fa223926259c76d873200 SHA512 b8c6b0c7c0a4c369ecfa7ac71cf96549a19853e14bdf061b6b54429ce7ed998b236bb9ed3adbd6bf1c70c7e975508f751ebd0031ac2ff474d32216048a1c5f2d
EBUILD lldb-15.0.7.ebuild 2694 BLAKE2B 5580b30227d9aae638c3be427a243fd876928c4383b0cc6e19cf53833bf0c9863208f98bf4384486a32eb383e84c94ee376b295f7b37b6e98bf32a18246519a4 SHA512 2dcdd55c4fe52a66472802e1021f539e8fd841f219fa3fcee1fef5576c83b22476a131cf2ae1d83afc69c4fd6a54091d4703cf8f5f32eadcff00ffd77cd9ed96
EBUILD lldb-16.0.6-r1.ebuild 2512 BLAKE2B 44f7f9e02f606ed242e08a222d6b5f8febb2f8595cfa1b4905f4efd5ec99ee50410dbfbed9c48b46355532cf97874891c6002d02f707024bd0688c81dc3108e5 SHA512 ea50ecc91efff01a6ef86a7d195a2edd4ccd8cff7bfe52f6f8625e6a66b1422e7a4993dcfa33e090fed03436d617ba8c392564dd3709e1bb4c5bcd742cef5dc8
@@ -13,4 +14,5 @@ EBUILD lldb-17.0.6.ebuild 2621 BLAKE2B e0623f3effe73330f820e81ea344fee4dfac72fff
EBUILD lldb-18.0.0.9999.ebuild 2449 BLAKE2B 33181192b806d4f86c330ebebb31c5509a0e2a66372dabe5f41bde66da210153c68e50358f46fd3f28ffb5fa734fdb2cf1da2fd3faae4c7d55bb71110362c916 SHA512 6175e13def56fafe7898118a8098d4e603c3a3b15fdc9baa39d8ce483ebd47b2d99350ab6a8b5484f8aee5d7580897a733d6b1927e6702545c2d125dfb22ba73
EBUILD lldb-18.0.0_pre20240106.ebuild 2678 BLAKE2B d0e53ff05e70dbf3c33ab68810f167bde315c306ad5ceeed2a228fc04f94860c0f6af66eb8c5af41c1ba632c67b609aa50055ae24cc1063535936c0e981162d9 SHA512 c74d1a23f4108f106eb8237334374c466f5e14bd67836dc0cd20341726f2d2e6ac873b43dc5245b973e80924fdb3b325d35368818ce8812280c18e6711ad732b
EBUILD lldb-18.0.0_pre20240113.ebuild 2678 BLAKE2B d0e53ff05e70dbf3c33ab68810f167bde315c306ad5ceeed2a228fc04f94860c0f6af66eb8c5af41c1ba632c67b609aa50055ae24cc1063535936c0e981162d9 SHA512 c74d1a23f4108f106eb8237334374c466f5e14bd67836dc0cd20341726f2d2e6ac873b43dc5245b973e80924fdb3b325d35368818ce8812280c18e6711ad732b
+EBUILD lldb-18.0.0_pre20240120.ebuild 2678 BLAKE2B d0e53ff05e70dbf3c33ab68810f167bde315c306ad5ceeed2a228fc04f94860c0f6af66eb8c5af41c1ba632c67b609aa50055ae24cc1063535936c0e981162d9 SHA512 c74d1a23f4108f106eb8237334374c466f5e14bd67836dc0cd20341726f2d2e6ac873b43dc5245b973e80924fdb3b325d35368818ce8812280c18e6711ad732b
MISC metadata.xml 299 BLAKE2B 2feead2cd1b35b3a43335ddd7711f8181b52bc63ee7166608914260c67528add5251349063afbef4f8cf0ec09b2cd4c3ffdd90f2c14ed60bb69ebc03888f6333 SHA512 cd745c54ab18d25bdaff18582105072574103a36cfe7c175ef740f266d00e9fc6f44c332904d23b911c939cf5bdf52973b388923099d8dd5dfef3c283b5cb685
diff --git a/dev-debug/lldb/lldb-18.0.0_pre20240120.ebuild b/dev-debug/lldb/lldb-18.0.0_pre20240120.ebuild
new file mode 100644
index 000000000000..55e6b76df4ae
--- /dev/null
+++ b/dev-debug/lldb/lldb-18.0.0_pre20240120.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake llvm llvm.org python-single-r1
+
+DESCRIPTION="The LLVM debugger"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0/${LLVM_SOABI}"
+IUSE="+debug +libedit lzma ncurses +python test +xml"
+RESTRICT="test"
+REQUIRED_USE=${PYTHON_REQUIRED_USE}
+
+DEPEND="
+ libedit? ( dev-libs/libedit:0= )
+ lzma? ( app-arch/xz-utils:= )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0= )
+ xml? ( dev-libs/libxml2:= )
+ ~sys-devel/clang-${PV}
+ ~sys-devel/llvm-${PV}
+"
+RDEPEND="
+ ${DEPEND}
+ python? (
+ ${PYTHON_DEPS}
+ )
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ python? (
+ >=dev-lang/swig-3.0.11
+ )
+ test? (
+ $(python_gen_cond_dep "
+ ~dev-python/lit-${PV}[\${PYTHON_USEDEP}]
+ dev-python/psutil[\${PYTHON_USEDEP}]
+ ")
+ sys-devel/lld
+ )
+"
+
+LLVM_COMPONENTS=( lldb cmake llvm/utils )
+LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support third-party )
+llvm.org_set_globals
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # broken in standalone build
+ # https://github.com/llvm/llvm-project/pull/70996#issuecomment-1843275813
+ sed -e '/Debuginfod/d' \
+ -i source/Plugins/SymbolLocator/CMakeLists.txt || die
+
+ llvm.org_src_prepare
+}
+
+src_configure() {
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+
+ local mycmakeargs=(
+ -DLLDB_ENABLE_CURSES=$(usex ncurses)
+ -DLLDB_ENABLE_LIBEDIT=$(usex libedit)
+ -DLLDB_ENABLE_PYTHON=$(usex python)
+ -DLLDB_ENABLE_LUA=OFF
+ -DLLDB_ENABLE_LZMA=$(usex lzma)
+ -DLLDB_ENABLE_LIBXML2=$(usex xml)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+
+ -DLLDB_INCLUDE_TESTS=$(usex test)
+
+ -DCLANG_LINK_CLANG_DYLIB=ON
+ # TODO: fix upstream to detect this properly
+ -DHAVE_LIBDL=ON
+ -DHAVE_LIBPTHREAD=ON
+
+ # normally we'd have to set LLVM_ENABLE_TERMINFO, HAVE_TERMINFO
+ # and TERMINFO_LIBS... so just force FindCurses.cmake to use
+ # ncurses with complete library set (including autodetection
+ # of -ltinfo)
+ -DCURSES_NEED_NCURSES=ON
+
+ -DCLANG_RESOURCE_DIR="../../../clang/${LLVM_MAJOR}"
+
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ )
+
+ cmake_src_configure
+}
+
+src_test() {
+ local -x LIT_PRESERVES_TMP=1
+ cmake_build check-lldb-{shell,unit}
+ # failures + hangs
+ #use python && cmake_build check-lldb-api
+}
+
+src_install() {
+ cmake_src_install
+ find "${D}" -name '*.a' -delete || die
+
+ use python && python_optimize
+}
diff --git a/dev-debug/valgrind/Manifest b/dev-debug/valgrind/Manifest
index 942b463461f7..0b21a8a48ea9 100644
--- a/dev-debug/valgrind/Manifest
+++ b/dev-debug/valgrind/Manifest
@@ -1,6 +1,7 @@
-AUX 0001-valgrind-monitor.py-regular-expressions-should-use-r.patch 2242 BLAKE2B ad7b3ff4565764b457b42ab0ce1de891c7edc5d9efaeb5fb2b4fb3d1d0bc60838cfb0eb05514720ed4baf01e317b2a31afd723db5ce87469cb5594e6bef51093 SHA512 d2d562c33c938894dfba22215bef0abb0d9d0a5efeada4dc7e8c7cbb7de91ad7234fb59f804361d63287e20f322b55fc30585426f496dc38b881de4aa1cc4e1c
-AUX 0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch 5649 BLAKE2B 075ebe79637735aff7e55f970c5b6c9fe25504ea381e9f927d35c6f00f099edc5eebc97b1c6a58686ea913dc491128800f1533eadc32f7ff7f43d331950ef67f SHA512 d6cbc7991ff7f6ffd181a2208e3b168957035967931173098dc226909979006f7948fb7dc47b70bf3eba7a0cd2501a0d3ebf8b2e4773f1abd76b5e8803b29538
-AUX 0003-Add-fchmodat2-syscall-on-linux.patch 9010 BLAKE2B ddc222f921cb69c5954f8e39aa7f8a3b0742165bdc22f9cdc68e4951465d75142edac37b44dff92d10b9b93a045cc1a9f3134fd0d712f5cf883c7c44e3f4e068 SHA512 dd9b2516d71eb4c0a34d675ccf0288a6fbec16649af59e702b0f2e1c74bb89d63b1740a97e18da4c7f299098d0f3ef3987af3d30030d28c54dd625ad899cb2bc
+AUX 0001-valgrind-monitor.py-regular-expressions-should-use-r.patch 2242 BLAKE2B 40322cd16e368671d21d70ba942bb4d5d364d695f102b6cf2f27fc5c22c67afaf81f7b3fade88c82b2f0a42f00fa7ba337d20cf3fcc97e0ef66b1d222ce8a080 SHA512 da93eb6ff753fa8b1f8c5071dc278609c504622cb211bf5ba7f7c564eb9516a85d2f92089a65c61842658582128925bbce25335df8866a785589562ff649c68d
+AUX 0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch 5649 BLAKE2B 9ee09b8822700a9a3a7dbb39f5f79e707b5ec1684aefca8076e43df525a89d06e49acf8179dc9ef5950982edf4d20b74421c54e000e5a2af0dc6480b57b39c2c SHA512 7682dfb145773b78a073253776f24475091246d296576a494be66a6f919d64823ef0eb623ebacadd81f3609033169fab39bbaa0e4700ff3a55edcba6483782d3
+AUX 0003-Add-fchmodat2-syscall-on-linux.patch 9010 BLAKE2B dff52585de0928e880e857961d1526f4676279507cf14ab1797581b2957fd2efc67ecfe7fd1c6e000b2440cf409c2e011cab344f03a5866c9737e567280a093c SHA512 a08ea6d6d56110e52ab46ceffb9b911cb33a21a6ccca042e278c0f39a1a008594d45a98b459f16a04e558ae050e8bc7b32509972a3b46d05d7b89552277aea93
+AUX 0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch 5986 BLAKE2B 535c448a745ab801e97af75407df77ff6d88a88053c2f2db57a923b31d82a2ed656465fd0b795b5aa3d2b82032725699159f0182d0ca5b9de34db269cca44aa0 SHA512 cf31450ba85cd1b73d7814ce6ea365b57b9aacfb3f50b6afd60cba291a1a69e9b3fd9cb6e27cdfc3be7276d55b430a6df8c34e04f46d7143f737314743030625
AUX valgrind-3.13.0-malloc.patch 1024 BLAKE2B 3917fe49e5b7f8f678801edd3236b76fbc3eaf790bc19db7a1055cd949df802fc7612b8ec8fb40371814790d24f15fc2cdfd5349297ed5b48e28d3224bb2d170 SHA512 57086a768f3876b26b0e507bc159a73f0955f03d5af8cc30e21103e348ca67f2e58b5555a5a97f299751c6602692ad43d8346bb68a80917d740fb4d65bba9665
AUX valgrind-3.15.0-Build-ldst_multiple-test-with-fno-pie.patch 650 BLAKE2B ffb545d6af214a5bd43ff800d52e0d7cfc03feac8d2466da8d4935db659172cd50cf3e2d63b3aff46d81b21846b304671506cd235b710037218fc16e0ef66438 SHA512 7cb5a46c2d8ed4360053289994014b334e32d48b0608ed58662486bd432c31835ef16e2cdfd734f3e4d720e272d2507ec76f0b77e1364237e9f6dbbd97a8abb6
AUX valgrind-3.20.0-gcc-13.patch 1181 BLAKE2B a7cdca7b99e822444ab3c453efba979a341c31ad0882a8a8232ba96af4ccc94277b142a833435afc911b06b743c5bc6e7bd126b7f65246308147130ab0ee86c4 SHA512 c4d14851f7ea41d8b3f8391f3e2c0fd72afae0944594d126bf2d3dbbf65fd3cd5fdf5303c4b7b3f40c5fe48f0e965dcd6265d268b8e3483c9354ede8e5c53af5
@@ -19,6 +20,7 @@ EBUILD valgrind-3.20.0-r2.ebuild 4290 BLAKE2B a948bd03fabd0b5f7b7aab5e7b38d2e2d1
EBUILD valgrind-3.21.0-r1.ebuild 4075 BLAKE2B 06c7d359248ebcdab7c99c06e1f8ffe978f92e22ef866bcc936ec719b61a79404e6f1831f968624063da083da27911ea804f6223734d2dd16d4883e7d097fa87 SHA512 edcad8bf726f8991a561e51a42e8ee2bb4f52a9641c12bacc86ad578cd38b3f7bcb10eada151c8ed9b739fd08fdb5d595131ed71c40170f3276d7cb04344161e
EBUILD valgrind-3.21.0-r2.ebuild 4445 BLAKE2B 411c77687c2a5c58755213b2f5ae50c3bcd8bd6bdcf17894acc9b4b1a2ca24b684f5ab3642f0bcf213e908c74f159c81ae4ed3fb58f196a04494b4dd8b1f1f44 SHA512 d2db8635cc329ecd1279ff476035cb5facc349bbdea49551f1cc9352ed1c9280a22c18a08fb5db6ee352c8ecbdae3847b20a4a57748b835f36fee925fa43c72b
EBUILD valgrind-3.22.0-r1.ebuild 5057 BLAKE2B 0ad7f4cd500dbb147389f3c110912fd6125ec4417d558f22f01e91242f660b22b88b6edea3af3e7e74e394e4ef78b677a01ff88cfe1aedc8187eb55d67bf39ee SHA512 1e04ebd54d63fa26971ff8706ca4c4ed74d2e459500efb8757a09778e5e394128493ef187ab6afcd6a8440f2b8d3ad426ffe531df6e97e1c80dc68c9226994c2
+EBUILD valgrind-3.22.0-r2.ebuild 5136 BLAKE2B 5f33c119e0816629ca1de0c6f78889741c38ff4c4cbb20d9a953584a108939c02ab8a4d458090f2541bbbfc6dbaa0d0895e80776532c9805aac2363d4c15693a SHA512 5e6fdf459831db0b1b64a2263c542e93bb17f43e2770e5cd3acaace1325424ac440927768c88346941fc3c43b1b9741552aec64c32a5c5fbcdd89d7687ca7cb7
EBUILD valgrind-3.22.0.ebuild 4787 BLAKE2B 5fbb27d3b93352215576a032e048d97618b575c9788fc694c627e5334c6b19b2696caf4e578f4dd3ba0bccc98437765e81caecf83129a84d590a08f0ee082e09 SHA512 33d9d941d9007de7c6b3b9dec776fd38c09589aa390ed891862479b72128491197c40bc9d5802e2d8d2b22a06ea4e6ff5154c590468fb11fc1f5f1aa3e290f63
EBUILD valgrind-9999.ebuild 4842 BLAKE2B eae9f32b2ee888ad390d5a67f04e5e7e97da00d06ea0df5a4da2c914ad091ceff47e2b31083198284e5ff3791ba1d826bb56fd852cdb609dfe4f6f9d55eb600a SHA512 bf97bfae37c916e96509f3c4592e5214406670ca4c4ecd4b2b6e4c4ec75b4f6b65024effbcb90d89ce8ce79d554c4af7fcdf8338f056566107805e965127e4a3
MISC metadata.xml 1123 BLAKE2B 17b5501b05acd9384ab57a15018bc0d1ede50d7b5b9a5c38fcce816f68e8946010bc86233a197df89ad208957f90ab643942b7e1a3ceaa6e8d456320828b84e8 SHA512 a8c32063f3afd28c4a2d5c5c0f437c08772e822aaed4feb71f79e0f5a6cf81530d056bd8ae2ef73ac70792bd78fc095c069ef0d4304ff0a1c365f289d1191fe1
diff --git a/dev-debug/valgrind/files/0001-valgrind-monitor.py-regular-expressions-should-use-r.patch b/dev-debug/valgrind/files/0001-valgrind-monitor.py-regular-expressions-should-use-r.patch
index cc51bc219456..70bd723855ad 100644
--- a/dev-debug/valgrind/files/0001-valgrind-monitor.py-regular-expressions-should-use-r.patch
+++ b/dev-debug/valgrind/files/0001-valgrind-monitor.py-regular-expressions-should-use-r.patch
@@ -1,7 +1,7 @@
From 027b649fdb831868e71be01cafdacc49a5f419ab Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Fri, 17 Nov 2023 14:01:21 +0100
-Subject: [PATCH 1/3] valgrind-monitor.py regular expressions should use raw
+Subject: [PATCH 1/4] valgrind-monitor.py regular expressions should use raw
strings
With python 3.12 gdb will produce the following SyntaxWarning when
diff --git a/dev-debug/valgrind/files/0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch b/dev-debug/valgrind/files/0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch
index 40885a04d850..df6250ea81db 100644
--- a/dev-debug/valgrind/files/0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch
+++ b/dev-debug/valgrind/files/0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch
@@ -1,7 +1,7 @@
From 1d00e5ce0fb069911c4b525ec38289fb5d9021b0 Mon Sep 17 00:00:00 2001
From: Paul Floyd <pjfloyd@wanadoo.fr>
Date: Sat, 18 Nov 2023 08:49:34 +0100
-Subject: [PATCH 2/3] Bug 476548 - valgrind 3.22.0 fails on assertion when
+Subject: [PATCH 2/4] Bug 476548 - valgrind 3.22.0 fails on assertion when
loading debuginfo file produced by mold
(cherry picked from commit 9ea4ae66707a4dcc6f4328e11911652e4418c585)
diff --git a/dev-debug/valgrind/files/0003-Add-fchmodat2-syscall-on-linux.patch b/dev-debug/valgrind/files/0003-Add-fchmodat2-syscall-on-linux.patch
index a65178a585f4..568cc5302b63 100644
--- a/dev-debug/valgrind/files/0003-Add-fchmodat2-syscall-on-linux.patch
+++ b/dev-debug/valgrind/files/0003-Add-fchmodat2-syscall-on-linux.patch
@@ -1,7 +1,7 @@
From a43e62dddcf51ec6578a90c5988a41e856b44b05 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Sat, 18 Nov 2023 21:17:02 +0100
-Subject: [PATCH 3/3] Add fchmodat2 syscall on linux
+Subject: [PATCH 3/4] Add fchmodat2 syscall on linux
fchmodat2 is a new syscall on linux 6.6. It is a variant of fchmodat
that takes an extra flags argument.
diff --git a/dev-debug/valgrind/files/0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch b/dev-debug/valgrind/files/0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch
new file mode 100644
index 000000000000..a1413916ea73
--- /dev/null
+++ b/dev-debug/valgrind/files/0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch
@@ -0,0 +1,151 @@
+From 41ff9aa49f6c54c66d0e6b37f265fd9cb0176057 Mon Sep 17 00:00:00 2001
+From: Paul Floyd <pjfloyd@wanadoo.fr>
+Date: Sun, 17 Dec 2023 14:18:51 +0100
+Subject: [PATCH 4/4] Bug 478624 - Valgrind incompatibility with binutils-2.42
+ on x86 with new nop patterns (unhandled instruction bytes: 0x2E 0x8D 0xB4
+ 0x26)
+
+It was a bit of a struggle to get the testcase to build
+with both clang and gcc (oddly enough gcc was more difficult) so
+I just resorted to using .byte arrays.
+
+(cherry picked from commit d35005cef8ad8207542738812705ceabf137d7e0)
+---
+ NEWS | 2 ++
+ VEX/priv/guest_x86_toIR.c | 22 +++++++++++++-
+ none/tests/x86/Makefile.am | 2 ++
+ none/tests/x86/gnu_binutils_nop.c | 34 ++++++++++++++++++++++
+ none/tests/x86/gnu_binutils_nop.stderr.exp | 0
+ none/tests/x86/gnu_binutils_nop.vgtest | 2 ++
+ 7 files changed, 62 insertions(+), 1 deletion(-)
+ create mode 100644 none/tests/x86/gnu_binutils_nop.c
+ create mode 100644 none/tests/x86/gnu_binutils_nop.stderr.exp
+ create mode 100644 none/tests/x86/gnu_binutils_nop.vgtest
+
+diff --git a/NEWS b/NEWS
+index da0f8c1aa..86b0fe6b5 100644
+--- a/NEWS
++++ b/NEWS
+@@ -9,6 +9,8 @@ The following bugs have been fixed or resolved on this branch.
+ file produced by mold
+ 476708 valgrind-monitor.py regular expressions should use raw strings
+ 477198 Add fchmodat2 syscall on linux
++478624 Valgrind incompatibility with binutils-2.42 on x86 with new nop patterns
++ (unhandled instruction bytes: 0x2E 0x8D 0xB4 0x26)
+
+ To see details of a given bug, visit
+ https://bugs.kde.org/show_bug.cgi?id=XXXXXX
+diff --git a/VEX/priv/guest_x86_toIR.c b/VEX/priv/guest_x86_toIR.c
+index 5d6e6dc64..3b6efb387 100644
+--- a/VEX/priv/guest_x86_toIR.c
++++ b/VEX/priv/guest_x86_toIR.c
+@@ -8198,7 +8198,7 @@ DisResult disInstr_X86_WRK (
+ delta += 5;
+ goto decode_success;
+ }
+- /* Don't barf on recent binutils padding,
++ /* Don't barf on recent (2010) binutils padding,
+ all variants of which are: nopw %cs:0x0(%eax,%eax,1)
+ 66 2e 0f 1f 84 00 00 00 00 00
+ 66 66 2e 0f 1f 84 00 00 00 00 00
+@@ -8223,6 +8223,26 @@ DisResult disInstr_X86_WRK (
+ }
+ }
+
++ /* bug478624 GNU binutils uses a leal of esi into itself with
++ a zero offset and CS prefix as an 8 byte no-op (Dec 2023).
++ Since the CS prefix is hardly ever used we don't do much
++ to decode it, just a few cases for conditional branches.
++ So add handling here with other pseudo-no-ops.
++ */
++ if (code[0] == 0x2E && code[1] == 0x8D) {
++ if (code[2] == 0x74 && code[3] == 0x26 && code[4] == 0x00) {
++ DIP("leal %%cs:0(%%esi,%%eiz,1),%%esi\n");
++ delta += 5;
++ goto decode_success;
++ }
++ if (code[2] == 0xB4 && code[3] == 0x26 && code[4] == 0x00
++ && code[5] == 0x00 && code[6] == 0x00 && code[7] == 0x00) {
++ DIP("leal %%cs:0(%%esi,%%eiz,1),%%esi\n");
++ delta += 8;
++ goto decode_success;
++ }
++ }
++
+ // Intel CET requires the following opcodes to be treated as NOPs
+ // with any prefix and ModRM, SIB and disp combination:
+ // "0F 19", "0F 1C", "0F 1D", "0F 1E", "0F 1F"
+diff --git a/none/tests/x86/Makefile.am b/none/tests/x86/Makefile.am
+index 3ecd1ad3c..dbae86571 100644
+--- a/none/tests/x86/Makefile.am
++++ b/none/tests/x86/Makefile.am
+@@ -52,6 +52,7 @@ EXTRA_DIST = \
+ fxtract.stdout.exp fxtract.stderr.exp fxtract.vgtest \
+ fxtract.stdout.exp-older-glibc \
+ getseg.stdout.exp getseg.stderr.exp getseg.vgtest \
++ gnu_binutils_nop.stderr.exp gnu_binutils_nop.vgtest \
+ incdec_alt.stdout.exp incdec_alt.stderr.exp incdec_alt.vgtest \
+ int.stderr.exp int.stdout.exp int.disabled \
+ $(addsuffix .stderr.exp,$(INSN_TESTS)) \
+@@ -100,6 +101,7 @@ check_PROGRAMS = \
+ fpu_lazy_eflags \
+ fxtract \
+ getseg \
++ gnu_binutils_nop \
+ incdec_alt \
+ $(INSN_TESTS) \
+ int \
+diff --git a/none/tests/x86/gnu_binutils_nop.c b/none/tests/x86/gnu_binutils_nop.c
+new file mode 100644
+index 000000000..412a4c2cb
+--- /dev/null
++++ b/none/tests/x86/gnu_binutils_nop.c
+@@ -0,0 +1,34 @@
++int main(void)
++{
++ // GNU binutils uses various opcodes as alternatives for nop
++ // the idea is that it is faster to execute one large opcode
++ // with no side-effects than multiple repetitions of the
++ // single byte 'nop'. This gives more choice when code
++ // needs to be padded.
++
++ // the following is based on
++ // https://sourceware.org/cgit/binutils-gdb/tree/gas/config/tc-i386.c#n1256
++
++ // one byte
++ __asm__ __volatile__("nop");
++ // two bytes
++ __asm__ __volatile__("xchg %ax,%ax");
++ // three bytes
++ //__asm__ __volatile__("leal 0(%esi),%esi");
++ __asm__ __volatile__(".byte 0x8d,0x76,0x00");
++ // four bytes
++ //__asm__ __volatile__("leal 0(%esi,%eiz),%esi");
++ __asm__ __volatile__(".byte 0x8d,0x74,0x26,0x00");
++ // five bytes
++ //__asm__ __volatile__("leal %cs:0(%esi,%eiz),%esi");
++ __asm__ __volatile__(".byte 0x2e,0x8d,0x74,0x26,0x00");
++ // six bytes
++ //__asm__ __volatile__("leal 0L(%esi),%esi");
++ __asm__ __volatile__(".byte 0x8d,0xb6,0x00,0x00,0x00,0x00");
++ // seven bytes
++ //__asm__ __volatile__("leal 0L(%esi,%eiz),%esi");
++ __asm__ __volatile__(".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00");
++ // eight bytes
++ //__asm__ __volatile__("leal %cs:0L(%esi,%eiz),%esi");
++ __asm__ __volatile__(".byte 0x2e,0x8d,0xb4,0x26,0x00,0x00,0x00,0x00");
++}
+diff --git a/none/tests/x86/gnu_binutils_nop.stderr.exp b/none/tests/x86/gnu_binutils_nop.stderr.exp
+new file mode 100644
+index 000000000..e69de29bb
+diff --git a/none/tests/x86/gnu_binutils_nop.vgtest b/none/tests/x86/gnu_binutils_nop.vgtest
+new file mode 100644
+index 000000000..7f378dd53
+--- /dev/null
++++ b/none/tests/x86/gnu_binutils_nop.vgtest
+@@ -0,0 +1,2 @@
++prog: gnu_binutils_nop
++vgopts: -q
+--
+2.43.0
+
diff --git a/dev-debug/valgrind/valgrind-3.22.0-r2.ebuild b/dev-debug/valgrind/valgrind-3.22.0-r2.ebuild
new file mode 100644
index 000000000000..fd4c4cea5a1d
--- /dev/null
+++ b/dev-debug/valgrind/valgrind-3.22.0-r2.ebuild
@@ -0,0 +1,158 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# The Valgrind upstream maintainer also maintains it in Fedora and will
+# backport fixes there which haven't yet made it into a release. Keep an eye
+# on it for fixes we should cherry-pick too:
+# https://src.fedoraproject.org/rpms/valgrind/tree/rawhide
+#
+# Also check the ${PV}_STABLE branch upstream for backports.
+
+inherit autotools flag-o-matic toolchain-funcs multilib pax-utils
+
+DESCRIPTION="An open-source memory debugger for GNU/Linux"
+HOMEPAGE="https://valgrind.org"
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://sourceware.org/git/${PN}.git"
+ inherit git-r3
+else
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/valgrind.gpg
+ inherit verify-sig
+
+ MY_P="${P/_rc/.RC}"
+ SRC_URI="https://sourceware.org/pub/valgrind/${MY_P}.tar.bz2"
+ SRC_URI+=" verify-sig? ( https://sourceware.org/pub/valgrind/${MY_P}.tar.bz2.asc )"
+ S="${WORKDIR}"/${MY_P}
+
+ if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
+ fi
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="mpi"
+
+DEPEND="mpi? ( virtual/mpi )"
+RDEPEND="${DEPEND}"
+if [[ ${PV} != 9999 ]] ; then
+ BDEPEND="verify-sig? ( sec-keys/openpgp-keys-valgrind )"
+fi
+
+PATCHES=(
+ # Respect CFLAGS, LDFLAGS
+ "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch
+ "${FILESDIR}"/${PN}-3.15.0-Build-ldst_multiple-test-with-fno-pie.patch
+ "${FILESDIR}"/${PN}-3.21.0-glibc-2.34-suppressions.patch
+ # From stable branch
+ "${FILESDIR}"/0001-valgrind-monitor.py-regular-expressions-should-use-r.patch
+ "${FILESDIR}"/0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch
+ "${FILESDIR}"/0003-Add-fchmodat2-syscall-on-linux.patch
+ "${FILESDIR}"/0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch
+)
+
+src_prepare() {
+ # Correct hard coded doc location
+ sed -i -e "s:doc/valgrind:doc/${PF}:" docs/Makefile.am || die
+
+ # Don't force multiarch stuff on OSX, bug #306467
+ sed -i -e 's:-arch \(i386\|x86_64\)::g' Makefile.all.am || die
+
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ # upstream doesn't support this, but we don't build with
+ # Sun/Oracle ld, we have a GNU toolchain, so get some things
+ # working the Linux/GNU way
+ find "${S}" -name "Makefile.am" -o -name "Makefile.tool.am" | xargs \
+ sed -i -e 's:-M,/usr/lib/ld/map.noexstk:-z,noexecstack:' || die
+ cp "${S}"/coregrind/link_tool_exe_{linux,solaris}.in
+ fi
+
+ default
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=(
+ --with-gdbscripts-dir="${EPREFIX}"/usr/share/gdb/auto-load
+ )
+
+ # Respect ar, bug #468114
+ tc-export AR
+
+ # -fomit-frame-pointer "Assembler messages: Error: junk `8' after expression"
+ # while compiling insn_sse.c in none/tests/x86
+ # -fstack-protector more undefined references to __guard and __stack_smash_handler
+ # because valgrind doesn't link to glibc (bug #114347)
+ # -fstack-protector-all Fails same way as -fstack-protector/-fstack-protector-strong.
+ # Note: -fstack-protector-explicit is a no-op for Valgrind, no need to strip it
+ # -fstack-protector-strong See -fstack-protector (bug #620402)
+ # -m64 -mx32 for multilib-portage, bug #398825
+ # -fharden-control-flow-redundancy: breaks runtime ('jump to the invalid address stated on the next line')
+ # -flto* fails to build, bug #858509
+ filter-flags -fomit-frame-pointer
+ filter-flags -fstack-protector
+ filter-flags -fstack-protector-all
+ filter-flags -fstack-protector-strong
+ filter-flags -m64 -mx32
+ filter-flags -fsanitize -fsanitize=*
+ filter-flags -fharden-control-flow-redundancy
+ append-cflags $(test-flags-CC -fno-harden-control-flow-redundancy)
+ filter-lto
+
+ if use amd64 || use ppc64; then
+ ! has_multilib_profile && myconf+=("--enable-only64bit")
+ fi
+
+ # Force bitness on darwin, bug #306467
+ use x64-macos && myconf+=("--enable-only64bit")
+
+ # Don't use mpicc unless the user asked for it (bug #258832)
+ if ! use mpi; then
+ myconf+=("--without-mpicc")
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ # fxsave.o, tronical.o have textrels
+ emake LDFLAGS="${LDFLAGS} -Wl,-z,notext" check
+}
+
+src_install() {
+ default
+
+ if [[ ${PV} == "9999" ]]; then
+ # Otherwise FAQ.txt won't exist:
+ emake -C docs FAQ.txt
+ mv docs/FAQ.txt . || die "Couldn't move FAQ.txt"
+ fi
+
+ dodoc FAQ.txt
+
+ pax-mark m "${ED}"/usr/$(get_libdir)/valgrind/*-*-linux
+
+ # See README_PACKAGERS
+ dostrip -x /usr/libexec/valgrind/vgpreload* /usr/$(get_libdir)/valgrind/*
+
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ # fix install_names on shared libraries, can't turn them into bundles,
+ # as dyld won't load them any more then, bug #306467
+ local l
+ for l in "${ED}"/usr/lib/valgrind/*.so ; do
+ install_name_tool -id "${EPREFIX}"/usr/lib/valgrind/${l##*/} "${l}"
+ done
+ fi
+}
+
+pkg_postinst() {
+ elog "Valgrind will not work if libc (e.g. glibc) does not have debug symbols."
+ elog "To fix this you can add splitdebug to FEATURES in make.conf"
+ elog "and remerge glibc. See:"
+ elog "https://bugs.gentoo.org/214065"
+ elog "https://bugs.gentoo.org/274771"
+ elog "https://bugs.gentoo.org/388703"
+}