
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> Message-Id: <20250304222439.2035603-18-alex.bennee@linaro.org>
82 lines
2.0 KiB
Makefile
82 lines
2.0 KiB
Makefile
# -*- Mode: makefile -*-
|
|
#
|
|
# ARM - included from tests/tcg/Makefile
|
|
#
|
|
|
|
ARM_SRC=$(SRC_PATH)/tests/tcg/arm
|
|
|
|
# Set search path for all sources
|
|
VPATH += $(ARM_SRC)
|
|
|
|
config-cc.mak: Makefile
|
|
$(quiet-@)( \
|
|
$(call cc-option,-fno-integrated-as, CROSS_CC_HAS_FNIA)) 3> config-cc.mak
|
|
-include config-cc.mak
|
|
|
|
float_madds: CFLAGS+=-mfpu=neon-vfpv4
|
|
|
|
# Basic Hello World
|
|
ARM_TESTS = hello-arm
|
|
hello-arm: CFLAGS+=-marm -ffreestanding -fno-stack-protector
|
|
hello-arm: LDFLAGS+=-nostdlib
|
|
|
|
# Float-convert Tests
|
|
ARM_TESTS += fcvt
|
|
fcvt: LDFLAGS += -lm
|
|
fcvt: CFLAGS += -march=armv8.2-a+fp16 -mfpu=neon-fp-armv8
|
|
run-fcvt: fcvt
|
|
$(call run-test,fcvt,$(QEMU) $<)
|
|
$(call diff-out,fcvt,$(ARM_SRC)/fcvt.ref)
|
|
|
|
# PC alignment test
|
|
ARM_TESTS += pcalign-a32
|
|
pcalign-a32: CFLAGS+=-marm
|
|
|
|
ifeq ($(CONFIG_ARM_COMPATIBLE_SEMIHOSTING),y)
|
|
|
|
# Semihosting smoke test for linux-user
|
|
semihosting: CFLAGS += -mthumb
|
|
|
|
ARM_TESTS += semihosting-arm
|
|
semihosting-arm: CFLAGS += -marm -I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
|
|
semihosting-arm: semihosting.c
|
|
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
|
|
|
run-semihosting-arm: semihosting-arm
|
|
$(call run-test,$<,$(QEMU) $< 2> $<.err)
|
|
|
|
ARM_TESTS += semiconsole-arm
|
|
|
|
semiconsole: CFLAGS += -mthumb
|
|
|
|
semiconsole-arm: CFLAGS += -marm -I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
|
|
semiconsole-arm: semihosting.c
|
|
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
|
|
|
run-semiconsole-arm: semiconsole-arm
|
|
$(call skip-test, $<, "MANUAL ONLY")
|
|
|
|
endif
|
|
|
|
ARM_TESTS += commpage
|
|
|
|
# Vector SHA1
|
|
# 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
|
|
$(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<)
|
|
$(call diff-out, sha1-vector, sha1.out)
|
|
|
|
ARM_TESTS += sha1-vector
|
|
|
|
# Vector versions of sha512 (-O3 triggers vectorisation)
|
|
sha512-vector: CFLAGS=-O3
|
|
sha512-vector: sha512.c
|
|
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
|
|
|
|
ARM_TESTS += sha512-vector
|
|
|
|
TESTS += $(ARM_TESTS)
|