From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Li-Wen Hsu" <lwhsu@freebsd.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Laurent Vivier" <laurent@vivier.eu>,
qemu-arm@nongnu.org, "Alexandre Iooss" <erdnaxe@crans.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Riku Voipio" <riku.voipio@iki.fi>,
"Warner Losh" <imp@bsdimp.com>,
"Brian Cain" <brian.cain@oss.qualcomm.com>,
"Mahmoud Mandour" <ma.mandourr@gmail.com>,
"Kyle Evans" <kevans@freebsd.org>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Ed Maste" <emaste@freebsd.org>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Thomas Huth" <thuth@redhat.com>
Subject: [PATCH v2 17/32] tests/tcg: Suppress compiler false-positive warning on sha1.c
Date: Tue, 4 Mar 2025 22:24:24 +0000 [thread overview]
Message-ID: <20250304222439.2035603-18-alex.bennee@linaro.org> (raw)
In-Reply-To: <20250304222439.2035603-1-alex.bennee@linaro.org>
From: Peter Maydell <peter.maydell@linaro.org>
GCC versions at least 12 through 15 incorrectly report a warning
about code in sha1.c:
tests/tcg/multiarch/sha1.c:161:13: warning: ‘SHA1Transform’ reading 64 bytes from a region of size 0 [-Wstringop-overread]
161 | SHA1Transform(context->state, &data[i]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is a piece of stock library code for doing SHA1 which we've
simply copied, rather than writing ourselves. The bug has been
reported to upstream GCC (about a different library's use of this
code):
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106709
For our test case, since this isn't our original code and there isn't
actually a bug in it, suppress the incorrect warning rather than
trying to modify the code to work around the compiler issue.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2328
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250227141343.1675415-1-peter.maydell@linaro.org>
[AJB: -Wno-unknown-warning-option for clang's sake]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tests/tcg/aarch64/Makefile.target | 3 ++-
tests/tcg/arm/Makefile.target | 3 ++-
tests/tcg/hexagon/Makefile.target | 2 +-
tests/tcg/multiarch/Makefile.target | 8 ++++++++
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target
index 9efe2f81ad..16ddcf4f88 100644
--- a/tests/tcg/aarch64/Makefile.target
+++ b/tests/tcg/aarch64/Makefile.target
@@ -83,7 +83,8 @@ test-aes: CFLAGS += -O -march=armv8-a+aes
test-aes: test-aes-main.c.inc
# Vector SHA1
-sha1-vector: CFLAGS=-O3
+# Work around compiler false-positive warning, as we do for the 'sha1' test
+sha1-vector: CFLAGS=-O3 -Wno-stringop-overread
sha1-vector: sha1.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
run-sha1-vector: sha1-vector run-sha1
diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target
index 99a953b667..6189d7a0e2 100644
--- a/tests/tcg/arm/Makefile.target
+++ b/tests/tcg/arm/Makefile.target
@@ -61,7 +61,8 @@ endif
ARM_TESTS += commpage
# Vector SHA1
-sha1-vector: CFLAGS=-O3
+# Work around compiler false-positive warning, as we do for the 'sha1' test
+sha1-vector: CFLAGS=-O3 -Wno-stringop-overread
sha1-vector: sha1.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
run-sha1-vector: sha1-vector run-sha1
diff --git a/tests/tcg/hexagon/Makefile.target b/tests/tcg/hexagon/Makefile.target
index e5182c01d8..4dfc39bc98 100644
--- a/tests/tcg/hexagon/Makefile.target
+++ b/tests/tcg/hexagon/Makefile.target
@@ -18,7 +18,7 @@
# Hexagon doesn't support gdb, so skip the EXTRA_RUNS
EXTRA_RUNS =
-CFLAGS += -Wno-incompatible-pointer-types -Wno-undefined-internal
+CFLAGS += -Wno-incompatible-pointer-types -Wno-undefined-internal -Wno-unknown-warning-option
CFLAGS += -fno-unroll-loops -fno-stack-protector
HEX_SRC=$(SRC_PATH)/tests/tcg/hexagon
diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target
index 688a6be203..c769a7d69d 100644
--- a/tests/tcg/multiarch/Makefile.target
+++ b/tests/tcg/multiarch/Makefile.target
@@ -45,6 +45,14 @@ vma-pthread: LDFLAGS+=-pthread
sigreturn-sigmask: CFLAGS+=-pthread
sigreturn-sigmask: LDFLAGS+=-pthread
+# GCC versions 12/13/14/15 at least incorrectly complain about
+# "'SHA1Transform' reading 64 bytes from a region of size 0"; see the gcc bug
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106709
+# Since this is just a standard piece of library code we've borrowed for a
+# TCG test case, suppress the warning rather than trying to modify the
+# code to work around the compiler.
+sha1: CFLAGS+=-Wno-stringop-overread
+
# The vma-pthread seems very sensitive on gitlab and we currently
# don't know if its exposing a real bug or the test is flaky.
ifneq ($(GITLAB_CI),)
--
2.39.5
next prev parent reply other threads:[~2025-03-04 22:29 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 22:24 [PATCH v2 00/32] maintainer updates for 10.0 softfreeze (gpu/tcg tests, plugins, MAINTAINERS) pre-PR Alex Bennée
2025-03-04 22:24 ` [PATCH v2 01/32] tests/functional: move aarch64 GPU test into own file Alex Bennée
2025-03-05 8:17 ` Thomas Huth
2025-03-04 22:24 ` [PATCH v2 02/32] tests/functional: factor out common code in gpu test Alex Bennée
2025-03-05 8:29 ` Thomas Huth
2025-03-04 22:24 ` [PATCH v2 03/32] tests/functional: ensure we have a GPU device for tests Alex Bennée
2025-03-04 22:24 ` [PATCH v2 04/32] tests/functional: bail early if vkmark hangs Alex Bennée
2025-03-05 8:30 ` Thomas Huth
2025-03-04 22:24 ` [PATCH v2 05/32] tests/functional: skip vulkan tests with nVidia Alex Bennée
2025-03-04 22:24 ` [PATCH v2 06/32] tests/functional: expand tests to cover virgl Alex Bennée
2025-03-04 22:24 ` [PATCH v2 07/32] tests/functional: update the aarch64_virg_gpu images Alex Bennée
2025-03-05 8:35 ` Thomas Huth
2025-03-05 16:58 ` Alex Bennée
2025-03-04 22:24 ` [PATCH v2 08/32] plugins: add explicit dependency in functional tests Alex Bennée
2025-03-04 22:24 ` [PATCH v2 09/32] tests/functional: Introduce the dso_suffix() helper Alex Bennée
2025-03-04 22:24 ` [PATCH v2 10/32] tests/functional: Allow running TCG plugins tests on non-Linux/BSD hosts Alex Bennée
2025-03-04 22:24 ` [PATCH v2 11/32] libvirt-ci: bump to latest for vulkan-tools Alex Bennée
2025-03-04 22:24 ` [PATCH v2 12/32] tests/vm: bump timeout for shutdown Alex Bennée
2025-03-04 22:24 ` [PATCH v2 13/32] tests/tcg: mark test-vma as a linux-only test Alex Bennée
2025-03-04 22:49 ` Richard Henderson
2025-03-04 22:24 ` [PATCH v2 14/32] tests/tcg: add message to _Static_assert in test-avx Alex Bennée
2025-03-04 22:48 ` Richard Henderson
2025-03-04 22:24 ` [PATCH v2 15/32] tests/tcg: fix constraints in test-i386-adcox Alex Bennée
2025-03-04 22:45 ` Richard Henderson
2025-03-04 22:24 ` [PATCH v2 16/32] tests/tcg: enable -fwrapv for test-i386-bmi Alex Bennée
2025-03-04 22:24 ` Alex Bennée [this message]
2025-03-04 22:24 ` [PATCH v2 18/32] gitlab: add a new build_unit job to track build size Alex Bennée
2025-03-04 22:24 ` [PATCH v2 19/32] tests/functional: add boot error detection for RME tests Alex Bennée
2025-03-04 22:24 ` [PATCH v2 20/32] plugins/api: use qemu_target_page_mask() to get value Alex Bennée
2025-03-04 22:24 ` [PATCH v2 21/32] plugins/loader: populate target_name with target_name() Alex Bennée
2025-03-05 0:01 ` Philippe Mathieu-Daudé
2025-03-05 6:57 ` Alex Bennée
2025-03-04 22:24 ` [PATCH v2 22/32] include/qemu: plugin-memory.h doesn't need cpu-defs.h Alex Bennée
2025-03-04 22:24 ` [PATCH v2 23/32] plugins/api: clean-up the includes Alex Bennée
2025-03-04 22:24 ` [PATCH v2 24/32] plugins/plugin.h: include queue.h Alex Bennée
2025-03-04 22:24 ` [PATCH v2 25/32] plugins/loader: compile loader only once Alex Bennée
2025-03-04 22:24 ` [PATCH v2 26/32] plugins/api: split out binary path/start/end/entry code Alex Bennée
2025-03-04 22:24 ` [PATCH v2 27/32] plugins/api: split out the vaddr/hwaddr helpers Alex Bennée
2025-03-04 22:24 ` [PATCH v2 28/32] plugins/api: split out time control helpers Alex Bennée
2025-03-04 22:24 ` [PATCH v2 29/32] plugins/api: build only once Alex Bennée
2025-03-04 22:24 ` [PATCH v2 30/32] plugins/core: make a single build unit Alex Bennée
2025-03-04 22:54 ` Richard Henderson
2025-03-04 22:24 ` [PATCH v2 31/32] MAINTAINERS: remove widely sanctioned entities Alex Bennée
2025-03-04 22:24 ` [PATCH v2 32/32] meson.build: default to -gsplit-dwarf for debug info Alex Bennée
2025-03-04 23:05 ` Richard Henderson
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=20250304222439.2035603-18-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=brian.cain@oss.qualcomm.com \
--cc=eduardo@habkost.net \
--cc=emaste@freebsd.org \
--cc=erdnaxe@crans.org \
--cc=imp@bsdimp.com \
--cc=kevans@freebsd.org \
--cc=laurent@vivier.eu \
--cc=lwhsu@freebsd.org \
--cc=ma.mandourr@gmail.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=riku.voipio@iki.fi \
--cc=thuth@redhat.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 NNTP newsgroup(s).