[libcxx-commits] [libcxx] [libcxx][test] preserve QEMU_* vars (PR #223317)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 14 00:21:17 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Pepper Gray (peppergrayxyz)

<details>
<summary>Changes</summary>

compiling in an emulated env fails with error:
```
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
```
when instructions are used that are not supported, by the `qemu-static` default set, but need to be enabled through `QEMU_CPU` which is dropped.

Preserve qemu-user configuration from the parent process.

Closes: #<!-- -->223314

---
Full diff: https://github.com/llvm/llvm-project/pull/223317.diff


1 Files Affected:

- (modified) libcxx/utils/run.py (+3) 


``````````diff
diff --git a/libcxx/utils/run.py b/libcxx/utils/run.py
index b97e1edf05a91..42ff6c81986b6 100755
--- a/libcxx/utils/run.py
+++ b/libcxx/utils/run.py
@@ -64,6 +64,9 @@ def main():
         if "TEMP" in os.environ:
             env["TEMP"] = os.environ.get("TEMP")
 
+    # Preserve qemu-user configuration from the parent process.
+    env.update({k: v for k, v in os.environ.items() if k.startswith("QEMU_")})
+
     # Run the command line with the given environment in the execution directory.
     return subprocess.call(commandLine, cwd=args.execdir, env=env, shell=False)
 

``````````

</details>


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


More information about the libcxx-commits mailing list