From 413321c74786bf3a736f72de310536bcdbb33874 Mon Sep 17 00:00:00 2001 From: samarth Date: Wed, 10 Jun 2026 11:15:54 +0530 Subject: [PATCH] check for llvm and rust objcopy binaries --- scripts/qemu_runner.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/qemu_runner.py b/scripts/qemu_runner.py index e519f12..1f79a4a 100755 --- a/scripts/qemu_runner.py +++ b/scripts/qemu_runner.py @@ -1,8 +1,15 @@ #!/usr/bin/env python3 import argparse +import shutil import subprocess +def find_objcopy(): + for candidate in ["aarch64-none-elf-objcopy", "llvm-objcopy", "rust-objcopy"]: + if shutil.which(candidate): + return candidate + raise FileNotFoundError("No objcopy found. Install gcc-aarch64-embedded or llvm.") + parser = argparse.ArgumentParser(description="QEMU runner") parser.add_argument("elf_executable", help="Location of compiled ELF executable to run") @@ -23,7 +30,7 @@ args = parser.parse_args() elf_executable = args.elf_executable bin_executable_location = elf_executable.replace(".elf", "") + ".bin" # Convert the ELF executable to a binary format -subprocess.run(["aarch64-none-elf-objcopy", "-O", "binary", elf_executable, bin_executable_location], check=True) +subprocess.run([find_objcopy(), "-O", "binary", elf_executable, bin_executable_location], check=True) append_args = ""