From d8c55bb85be9923213168c69a054a154c077cfb8 Mon Sep 17 00:00:00 2001 From: Sam James Date: Wed, 3 Dec 2025 14:53:56 +0000 Subject: [PATCH] toolchain.eclass: wire up Valgrind annotations patch In gcc-patches.git: commit 33349526fd69a6c54790b53ca443693c80769242 (HEAD -> master, origin/master, origin/HEAD) Author: Sam James AuthorDate: Wed Dec 3 14:48:04 2025 +0000 Commit: Sam James CommitDate: Wed Dec 3 14:48:04 2025 +0000 16.0.0: add ispras's Valgrind lifetime annotations patch C++ lifetime issues come up every so often (this time w/ openjph2) and they're always really hard to debug. Let's give this a go. From https://inbox.sourceware.org/gcc-patches/20231222141038.6657-1-amonakov@ispras.ru/. Bug: https://gcc.gnu.org/PR66487 [...] Signed-off-by: Sam James --- eclass/toolchain.eclass | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index e50067e40c0f7..2afa6df1295a8 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1797,6 +1797,12 @@ toolchain_src_configure() { if in_iuse valgrind ; then confgcc+=( $(use_enable valgrind valgrind-annotations) ) + + # We patch this in w/ PR66487-object-lifetime-instrumentation-for-Valgrind.patch, + # so it may not always be available. + if grep -q -- '--enable-valgrind-interop' "${S}"/libgcc/configure.ac ; then + confgcc+=( $(use_enable valgrind valgrind-interop) ) + fi fi if in_iuse vtv ; then