dynarmic-sys-mythrax 0.2.4

Rust wrapper for the Dynarmic ARM dynamic recompiler — Mythrax fork of dynarmic-sys with Windows MSVC build fixes (mman shim + MSVC link directives) and TPIDRRO_EL0 / emu_start overflow corrections.
Documentation

dynarmic-sys-mythrax

Rust bindings for the Dynarmic ARM dynamic recompiler — Mythrax fork, with Windows MSVC support.

What this fork adds over upstream dynarmic-sys 0.1.2:

  1. Builds on Windows MSVC. The vendored mman.h / mman.c shim is extended with MAP_NORESERVE, MADV_WILLNEED, and a madvise() no-op stub so the wrapper code compiles cleanly under cl.exe.
  2. Correct MSVC link line. build.rs now emits cargo:rustc-link-lib=static={fmt,mcl,Zydis,Zycore} on MSVC (upstream only emitted them on GNU/Apple), fixing LNK2001/LNK2019 unresolved-external errors against the bundled fmt::v10 / Zydis symbols.

Both fixes are minimal and intended to be upstreamed; this crate exists so projects depending on dynarmic-sys can build today on Windows without waiting for the merge.

Credits

Features

  • High-level safe(r) wrapper for ARM32 and ARM64 emulation.
  • Integrated C++ source (vendored) for easier building.
  • Support for custom memory mapping and protection.
  • Support for SVC and Unmapped memory callbacks.
  • Builds out-of-the-box on Linux, macOS, and Windows MSVC.

Usage

Add to your Cargo.toml:

[dependencies]

dynarmic-sys-mythrax = "0.2"

If you want to drop-in replace upstream dynarmic-sys without code changes, alias it:

[dependencies]

dynarmic-sys = { package = "dynarmic-sys-mythrax", version = "0.2" }

Build requirements

  • A C++17 compiler (cl.exe on MSVC; clang/gcc on Linux/macOS).
  • CMake ≥ 3.12 and Ninja on PATH.
  • Boost headers ≥ 1.57 discoverable via find_package(Boost) (e.g. BOOST_ROOT=C:\local\boost_1_83_0 on Windows).

On Windows MSVC, if your environment includes devkitPro's MSYS2 cmake, force the real one + bundled Ninja:

$env:CMAKE = "C:\Program Files\CMake\bin\cmake.exe"
$env:PATH = "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;" + $env:PATH
$env:BOOST_ROOT = "C:\local\boost_1_83_0"
cargo build

Example

use dynarmic_sys_mythrax::Dynarmic;

fn main() -> anyhow::Result<()> {
    let emu: Dynarmic<()> = Dynarmic::new();
    // see examples/basic_a64.rs for a full demo
    Ok(())
}

Configuration

  • DYNARMIC_JIT_SIZE — JIT cache size in MB (default: 64).

License

0BSD, matching upstream Dynarmic.