From: Mark Wielaard <mark@klomp.org>
To: Simon Marchi <simark@simark.ca>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: gdb builder status (Was: Adding binutils to the GNU Toolchain buildbot on sourceware)
Date: Wed, 4 May 2022 01:36:55 +0200 [thread overview]
Message-ID: <YnG8lzwMZwRn+wAo@wildebeest.org> (raw)
In-Reply-To: <f12d07da-8692-5321-95e1-8b2fb5a84cf1@simark.ca>
[-- Attachment #1: Type: text/plain, Size: 516 bytes --]
Hi Simon,
Moved to gdb-patches, now that we have an approach and concrete patch.
On Tue, May 03, 2022 at 11:41:33AM -0400, Simon Marchi wrote:
> If it's really just the diagnostic that is bogus, my preference would be
> to try to silence the diagnostic and not modify the code.
>
> It would require adding a DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD to
> include/diagnostics.h.
>
> I would also limit the disabling to just that arch
OK, how about the attached? Build on fedora/s390x and debian/aarch64.
Thanks,
Mark
[-- Attachment #2: 0001-gdb-Workaround-stringop-overread-warning-in-debuginf.patch --]
[-- Type: text/x-diff, Size: 2485 bytes --]
From 7ee5428d3bb06e5b4b8379a2a84092102a09a4ef Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Tue, 3 May 2022 23:17:31 +0000
Subject: [PATCH] gdb: Workaround stringop-overread warning in
debuginfod-support.c on s390x
For some reason g++ 11.2.1 on s390x produces a spurious warning for
stringop-overread in debuginfod_is_enabled for url_view. Add a new
DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD macro to suppress this warning.
include/ChangeLog:
* diagnostics.h (DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD): New
macro.
gdb/ChangeLog:
* debuginfod-support.c (debuginfod_is_enabled): Use
DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD on s390x.
---
gdb/debuginfod-support.c | 11 +++++++++++
include/diagnostics.h | 7 +++++++
2 files changed, 18 insertions(+)
diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c
index 4ce2e786..67e625db 100644
--- a/gdb/debuginfod-support.c
+++ b/gdb/debuginfod-support.c
@@ -17,6 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "diagnostics.h"
#include <errno.h>
#include "gdbsupport/scoped_fd.h"
#include "debuginfod-support.h"
@@ -191,7 +192,17 @@ debuginfod_is_enabled ()
if (off == gdb::string_view::npos)
break;
url_view = url_view.substr (off);
+#if defined (__s390x__)
+ /* g++ 11.2.1 on s390x seems convinced url_view might be of
+ SIZE_MAX length. And so complains because the length of
+ an array can only be PTRDIFF_MAX. */
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD
+#endif
off = url_view.find_first_of (' ');
+#if defined (__s390x__)
+ DIAGNOSTIC_POP
+#endif
gdb_printf
(_(" <%ps>\n"),
styled_string (file_name_style.style (),
diff --git a/include/diagnostics.h b/include/diagnostics.h
index f10d0661..8bf5a3c3 100644
--- a/include/diagnostics.h
+++ b/include/diagnostics.h
@@ -76,6 +76,9 @@
# define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION \
DIAGNOSTIC_IGNORE ("-Wstringop-truncation")
+# define DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD \
+ DIAGNOSTIC_IGNORE ("-Wstringop-overread")
+
# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \
DIAGNOSTIC_IGNORE ("-Wformat-nonliteral")
@@ -108,6 +111,10 @@
# define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION
#endif
+#ifndef DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD
+# define DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD
+#endif
+
#ifndef DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
#endif
--
2.34.1
next parent reply other threads:[~2022-05-03 23:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <YmbmguMq2Aq+BzAX@wildebeest.org>
[not found] ` <524b04b7-a78c-7aae-4605-b40f61e6830c@arm.com>
[not found] ` <YmhzY4c3pOPLRgSw@wildebeest.org>
[not found] ` <16fe426d-c436-f030-dc43-0e81e7f0e853@arm.com>
[not found] ` <20220428141957.GB23335@gnu.wildebeest.org>
[not found] ` <m3zgk5clif.fsf@fitzsim.org>
[not found] ` <20220428162803.GD23335@gnu.wildebeest.org>
[not found] ` <20220429200422.GB7305@gnu.wildebeest.org>
[not found] ` <20220501194445.GB30898@gnu.wildebeest.org>
[not found] ` <f12d07da-8692-5321-95e1-8b2fb5a84cf1@simark.ca>
2022-05-03 23:36 ` Mark Wielaard [this message]
2022-05-04 0:51 ` Simon Marchi
2022-06-15 7:33 ` Tom de Vries
2022-06-15 11:09 ` Mark Wielaard
2022-06-15 14:38 ` Mark Wielaard
2022-06-15 19:18 ` Martin Liška
2022-06-15 19:48 ` Mark Wielaard
2022-06-16 4:09 ` Martin Liška
2022-06-16 21:19 ` Mark Wielaard
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=YnG8lzwMZwRn+wAo@wildebeest.org \
--to=mark@klomp.org \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/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).