Commit 034627397e for qemu.org

commit 034627397e386da7e0f8116c8c6d784e70202a4a
Author: Brian Cain <brian.cain@oss.qualcomm.com>
Date:   Wed May 20 09:27:23 2026 -0700

    tests/tcg/hexagon: fix check_rev_gating with newer toolchain

    The check_rev_gating test is compiled with -mv66, but the final linkage
    step does not specify the CPU version. The v22.1.0 toolchain contains a
    crt1.o compiled for v68, so the linker resolves the v66 + v68 linkage by
    selecting the highest version. The resulting binary then executes v68
    instructions without gating, leading to a segfault.

    Fix this by passing -cpu v66 to QEMU when running the test, so that the
    emulated CPU matches the intended v66 target and the revision gating
    mechanism works as expected.

    Suggested-by: Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>
    Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
    Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>

diff --git a/tests/tcg/hexagon/Makefile.target b/tests/tcg/hexagon/Makefile.target
index 09f0502abc..70a8ec2e7f 100644
--- a/tests/tcg/hexagon/Makefile.target
+++ b/tests/tcg/hexagon/Makefile.target
@@ -112,6 +112,7 @@ unaligned_pc: unaligned_pc.c

 # Compile for v66 so that the ELF selects a v66 CPU; the test then
 # exercises revision gating by executing a v68 .word instruction.
+run-check_rev_gating: QEMU_OPTS += -cpu v66
 check_rev_gating: check_rev_gating.c
 	$(CC) $(CFLAGS) -mv66 -O2 $< -o $@ $(LDFLAGS)