From: Vaseeharan Vinayagamoorthy <Vaseeharan.Vinayagamoorthy@arm.com>
To: Tom Tromey <tromey@adacore.com>
Cc: Simon Marchi <simon.marchi@polymtl.ca>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
Vaseeharan Vinayagamoorthy <Vaseeharan.Vinayagamoorthy@arm.com>
Subject: Re: [PATCH] Specialize std::hash for ptid_t
Date: Thu, 14 Sep 2023 22:34:18 +0000 [thread overview]
Message-ID: <DB9PR08MB647449C7ACB6D5AF425832F681F7A@DB9PR08MB6474.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <875y4ch7nc.fsf@tromey.com>
[-- Attachment #1: Type: text/plain, Size: 1594 bytes --]
Hello Tom,
It does build ok with GCC 7.5.
Has the minimum required version for building GDB changed?
At least for GCC, the minimum requirement seems to be 4.8: https://gcc.gnu.org/install/prerequisites.html
Kind regards,
Vasee
________________________________
From: Tom Tromey <tromey@adacore.com>
Sent: 14 September 2023 20:33
To: Vaseeharan Vinayagamoorthy <Vaseeharan.Vinayagamoorthy@arm.com>
Cc: Tom Tromey <tromey@adacore.com>; Simon Marchi <simon.marchi@polymtl.ca>; gdb-patches@sourceware.org <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Specialize std::hash for ptid_t
>>>>> Vaseeharan Vinayagamoorthy <Vaseeharan.Vinayagamoorthy@arm.com> writes:
> I think that after this patch is when I am seeing these errors when
> building cross toolchains, for arm-none-eabi and aarch64-none-elf,
> using gcc 4.8.
Can you try a newer gcc?
> /…/src/binutils-gdb--gdb/gdbsupport/ptid.h:161:13: error: specialization of ‘template<class _Tp> struct std::hash’ in different namespace [-fpermissive]
Or, alternatively, try the appended?
Tom
diff --git a/gdbsupport/ptid.h b/gdbsupport/ptid.h
index f8644d47633..96c7d9c8bfd 100644
--- a/gdbsupport/ptid.h
+++ b/gdbsupport/ptid.h
@@ -157,8 +157,10 @@ class ptid_t
tid_type m_tid;
};
+namespace std
+{
template<>
-struct std::hash<ptid_t>
+struct hash<ptid_t>
{
size_t operator() (const ptid_t &ptid) const
{
@@ -169,6 +171,7 @@ struct std::hash<ptid_t>
+ long_hash (ptid.tid ()));
}
};
+}
/* The null or zero ptid, often used to indicate no process. */
next prev parent reply other threads:[~2023-09-14 22:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 14:47 Tom Tromey
2023-09-11 15:25 ` Simon Marchi
2023-09-11 16:35 ` Tom Tromey
2023-09-11 17:14 ` Simon Marchi
2023-09-14 19:14 ` Vaseeharan Vinayagamoorthy
2023-09-14 19:33 ` Tom Tromey
2023-09-14 22:34 ` Vaseeharan Vinayagamoorthy [this message]
2023-09-15 0:59 ` Simon Marchi
2023-09-15 13:15 ` Tom Tromey
2023-09-15 13:56 ` Simon Marchi
2023-09-15 16:22 ` Tom Tromey
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=DB9PR08MB647449C7ACB6D5AF425832F681F7A@DB9PR08MB6474.eurprd08.prod.outlook.com \
--to=vaseeharan.vinayagamoorthy@arm.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
--cc=tromey@adacore.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).