Skip to content

Commit 16e8dbd

Browse files
committed
muvm-guest: only auto-initialize emulation on aarch64
Running x86_64 emulators on x86_64 is not typically desired, so only try initializing them without flags on aarch64.
1 parent 5597753 commit 16e8dbd

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

crates/muvm/src/guest/bin/muvm-guest.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,16 @@ fn main() -> Result<()> {
8686
Emulator::Box => setup_box()?,
8787
Emulator::Fex => setup_fex()?,
8888
};
89-
} else if let Err(err) = setup_fex() {
90-
eprintln!("Error setting up FEX in binfmt_misc: {err}");
91-
eprintln!("Failed to find or configure FEX, falling back to Box");
92-
93-
if let Err(err) = setup_box() {
94-
eprintln!("Error setting up Box in binfmt_misc: {err}");
95-
eprintln!("No emulators were configured, x86 emulation may not work");
89+
} else {
90+
#[cfg(target_arch = "aarch64")]
91+
if let Err(err) = setup_fex() {
92+
eprintln!("Error setting up FEX in binfmt_misc: {err}");
93+
eprintln!("Failed to find or configure FEX, falling back to Box");
94+
95+
if let Err(err) = setup_box() {
96+
eprintln!("Error setting up Box in binfmt_misc: {err}");
97+
eprintln!("No emulators were configured, x86 emulation may not work");
98+
}
9699
}
97100
}
98101

0 commit comments

Comments
 (0)