[libcxx-commits] [libcxx] [runtimes] Add a qemu-system executor script (PR #68643)

Alexander Richardson via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 8 09:15:38 PST 2023


================
@@ -0,0 +1,73 @@
+#!/usr/bin/env python3
+# ===----------------------------------------------------------------------===##
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+# ===----------------------------------------------------------------------===##
+
+"""qemu_baremetal.py is a utility for running a program with QEMU's system mode.
+
+It is able to pass command line arguments to the program and forward input and
+output (if the underlying baremetal enviroment supports QEMU semihosting).
+"""
+
+import argparse
+import os
+import platform
+import subprocess
+import sys
+
+
+def main():
+    parser = argparse.ArgumentParser()
+    parser.add_argument("--qemu", type=str, required=True)
+    parser.add_argument("--cpu", type=str, required=False)
+    parser.add_argument("--machine", type=str, default="virt")
+    parser.add_argument(
+        "--qemu-arg", dest="qemu_args", type=str, action="append", default=[]
+    )
+    parser.add_argument(
+        "--semihosting", type=argparse.BooleanOptionalAction, default=True
+    )
----------------
arichardson wrote:

Thanks, I'll update to remove that too keep older python compat.

https://github.com/llvm/llvm-project/pull/68643


More information about the libcxx-commits mailing list