File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -466,10 +466,12 @@ class BuildQEMU(BuildQEMUBase):
466
466
@classmethod
467
467
def qemu_binary_for_target (cls , xtarget : CrossCompileTarget , config : CheriConfig ):
468
468
# Always use the CHERI qemu even for plain riscv:
469
- if xtarget .is_riscv64 (include_purecap = True ):
470
- binary_name = "qemu-system-riscv64cheri"
471
- elif xtarget .is_riscv32 (include_purecap = True ):
472
- binary_name = "qemu-system-riscv32cheri"
469
+ if xtarget .is_riscv (include_purecap = True ):
470
+ xlen = 32 if xtarget .is_riscv32 (include_purecap = True ) else 64
471
+ binary_name = f"qemu-system-riscv{ xlen } cheri"
472
+ # Prefer the xcheri-suffixed binary (if it exists) to ensure backwards compatibility.
473
+ if (config .qemu_bindir / f"qemu-system-riscv{ xlen } xcheri" ).exists ():
474
+ binary_name = f"qemu-system-riscv{ xlen } xcheri"
473
475
elif xtarget .is_mips (include_purecap = True ):
474
476
binary_name = "qemu-system-mips64cheri128"
475
477
elif xtarget .is_aarch64 (include_purecap = True ):
You can’t perform that action at this time.
0 commit comments