@samitouri / QOSamiQemu / commits / 034627397e

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>

Brian Cain committed May 20, 2026 at 09:27 UTC 034627397e386da7e0f8116c8c6d784e70202a4a
1 file changed +1
tests/tcg/hexagon/Makefile.target
+1
@@ -112,6 +112,7 @@ unaligned_pc: unaligned_pc.c
112
113 # Compile for v66 so that the ELF selects a v66 CPU; the test then
114 # exercises revision gating by executing a v68 .word instruction.
115 +run-check_rev_gating: QEMU_OPTS += -cpu v66
116 check_rev_gating: check_rev_gating.c
117 $(CC) $(CFLAGS) -mv66 -O2 $< -o $@ $(LDFLAGS)
118