On Tue, 4 Mar 2025 at 11:56, Alex Bennée <alex.ben...@linaro.org> wrote: > > Peter Maydell <peter.mayd...@linaro.org> writes: > > +# 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 > > + > > Sadly this breaks the hexagon compiler: > > error: unknown warning option '-Wno-stringop-overread' > [-Werror,-Wunknown-warning-option] > Traceback (most recent call last): > File "/home/alex/lsrc/qemu.git/tests/docker/docker.py", line 683, in > <module> > sys.exit(main()) > ^^^^^^ > File "/home/alex/lsrc/qemu.git/tests/docker/docker.py", line 679, in main > return args.cmdobj.run(args, argv) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/home/alex/lsrc/qemu.git/tests/docker/docker.py", line 657, in run > return Docker().run(cmd, False, quiet=args.quiet, > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/home/alex/lsrc/qemu.git/tests/docker/docker.py", line 370, in run > ret = self._do_check(["run", "--rm", "--label", > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/home/alex/lsrc/qemu.git/tests/docker/docker.py", line 247, in > _do_check > return subprocess.check_call(self._command + cmd, **kwargs) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/usr/lib/python3.11/subprocess.py", line 413, in check_call > raise CalledProcessError(retcode, cmd) > subprocess.CalledProcessError: Command '['podman', 'run', '--rm', > '--label', 'com.qemu.instance.uuid=5bbb7b6ed2ea4377b9b6d646859ec4ea', > '--userns=keep-id', '-u', '1000', '-w', > '/home/alex/lsrc/qemu.git/builds/all/tests/tcg/hexagon-linux-user', '-v', > '/home/alex/lsrc/qemu.git/builds/all/tests/tcg/hexagon-linux-user:/home/alex/lsrc/qemu.git/builds/all/tests/tcg/hexagon-linux-user:rw', > '-v', '/home/alex/lsrc/qemu.git:/home/alex/lsrc/qemu.git:ro,z', > 'qemu/debian-hexagon-cross', 'hexagon-unknown-linux-musl-clang', > '-Wno-incompatible-pointer-types', '-Wno-undefined-internal', > '-fno-unroll-loops', '-fno-stack-protector', '-Wall', '-Werror', '-O0', '-g', > '-fno-strict-aliasing', '-Wno-stringop-overread', '-mv73', '-O2', '-static', > '/home/alex/lsrc/qemu.git/tests/tcg/multiarch/sha1.c', '-o', 'sha1', > '-static']' returned non-zero exit status 1. > > filter=--filter=label=com.qemu.instance.uuid=5bbb7b6ed2ea4377b9b6d646859ec4ea > make[1]: *** [Makefile:122: sha1] Error 1 > make: *** [/home/alex/lsrc/qemu.git/tests/Makefile.include:52: > build-tcg-tests-hexagon-linux-user] Error 2 > > Is it that new an option?
I think it's new-ish (gcc 11?). On the other hand -Wno-unknown-warning-option is quite old, and would suppress this error. If we do CFLAGS+=-Wno-unknown-warning-option -Wno-stringop-overread does that work? (Meson has cc.get_supported_arguments() that we can use to filter out -Wfoo/-Wno-foo options that the compiler doesn't support, but since this is built via a makefile rather than by meson that's not conveniently accessible.) -- PMM