public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sergei Trofimovich" <slyfox@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/gcc/, eclass/
Date: Mon,  6 Jul 2020 16:39:19 +0000 (UTC)	[thread overview]
Message-ID: <1594053547.96d5303a2e1daee48a79e8cbb5a24be652535b95.slyfox@gentoo> (raw)

commit:     96d5303a2e1daee48a79e8cbb5a24be652535b95
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Mon Jul  6 16:35:52 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Mon Jul  6 16:39:07 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96d5303a

toolchain.eclass: add USE=valgrind for annotations for valgrind

This adds annotation hints to memory handling code into
gcc to ease debugging it under valgrind.

Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 eclass/toolchain.eclass    | 9 +++++++++
 sys-devel/gcc/metadata.xml | 1 +
 2 files changed, 10 insertions(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 8384e565d86..5bd4e18eb0d 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -200,6 +200,7 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
 	tc_version_is_at_least 9.0 && IUSE+=" d"
 	tc_version_is_at_least 9.1 && IUSE+=" lto"
 	tc_version_is_at_least 10 && IUSE+=" zstd" TC_FEATURES+=(zstd)
+	tc_version_is_at_least 11 && IUSE+=" valgrind" TC_FEATURES+=(valgrind)
 fi
 
 if tc_version_is_at_least 10; then
@@ -272,6 +273,10 @@ if tc_has_feature zstd ; then
 	DEPEND+=" zstd? ( app-arch/zstd )"
 fi
 
+if tc_has_feature valgrind; then
+	BDEPEND+=" valgrind? ( dev-util/valgrind )"
+fi
+
 case ${EAPI:-0} in
 	5*|6) DEPEND+=" ${BDEPEND}" ;;
 esac
@@ -1278,6 +1283,10 @@ toolchain_src_configure() {
 		confgcc+=( $(use_enable systemtap) )
 	fi
 
+	if in_iuse valgrind ; then
+		confgcc+=( $(use_enable valgrind valgrind-annotations) )
+	fi
+
 	if in_iuse vtv ; then
 		confgcc+=(
 			$(use_enable vtv vtable-verify)

diff --git a/sys-devel/gcc/metadata.xml b/sys-devel/gcc/metadata.xml
index a6c76c3bd10..feeacd30317 100644
--- a/sys-devel/gcc/metadata.xml
+++ b/sys-devel/gcc/metadata.xml
@@ -34,6 +34,7 @@
     <flag name="sanitize">Build support for various sanitizer functions (ASAN/TSAN/etc...)</flag>
     <flag name="ssp">Build packages with stack smashing protector on by default</flag>
     <flag name="systemtap">enable systemtap static probe points</flag>
+    <flag name="valgrind">Enable valgrind annotations for gcc internals (useful for gcc debugging).</flag>
     <flag name="vtv">Build support for virtual table verification (a C++ hardening feature)</flag>
   </use>
   <upstream>


             reply	other threads:[~2020-07-06 16:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06 16:39 Sergei Trofimovich [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-11-19  9:23 [gentoo-commits] repo/gentoo:master commit in: sys-devel/gcc/, eclass/ Sam James
2024-03-23 15:42 Sam James
2022-05-22 18:41 Sam James
2022-04-21 12:27 Sam James
2021-11-20 23:15 Andreas K. Hüttel
2018-05-16 22:02 Sergei Trofimovich
2015-12-19 23:29 Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1594053547.96d5303a2e1daee48a79e8cbb5a24be652535b95.slyfox@gentoo \
    --to=slyfox@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox