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

Pepper Gray via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 14 00:20:18 PDT 2026


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

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

>From 16767cd889b24908dd6855ba0cbfc2238fcdf6ec Mon Sep 17 00:00:00 2001
From: Pepper Gray <hello at peppergray.xyz>
Date: Mon, 14 Sep 2026 09:16:16 +0200
Subject: [PATCH] [libcxx][test] preserve QEMU_* vars

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-user`
default set, but need to be enabled through `QEMU_CPU` which is dropped.

Preserve `qemu-user` configuration from the parent process.

Closes: #223314
Signed-off-by: Pepper Gray <hello at peppergray.xyz>
---
 libcxx/utils/run.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libcxx/utils/run.py b/libcxx/utils/run.py
index b97e1edf05a911..42ff6c81986b6b 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)
 



More information about the libcxx-commits mailing list