[libcxx-commits] [libcxx] [runtimes] Add a qemu-system executor script (PR #68643)
Dominik Wójt via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Nov 8 05:20:57 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
+ )
----------------
domin144 wrote:
`BooleanOptionalAction` is a python 3.9 feature. The system image used to run the picolibc is Ubuntu focal, which has python 3.8.
https://github.com/llvm/llvm-project/pull/68643
More information about the libcxx-commits
mailing list