[compiler-rt] [compiler-rt] [test] refine target_page_size() in lit.common.cfg.py (NFC) (PR #170475)

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 5 11:14:59 PST 2025


================
@@ -971,8 +971,19 @@ def target_page_size():
             stdin=subprocess.PIPE,
             stdout=subprocess.PIPE,
         )
+        # Unix has sysconf,
+        # Windows can use mmap.PAGESIZE
+        # Not using mmap.PAGESIZE everywhere because
+        # it is not available in WASI, but sysconf is.
         out, err = proc.communicate(
-            b'import os; print(os.sysconf("SC_PAGESIZE") if hasattr(os, "sysconf") else "")'
+            b"""
+try:
----------------
fmayer wrote:

In which case I would just use `mmap.PAGESIZE` and fall back to sysconf for WASI

I would be kind of surprised if we even ran these in WASI, but I don't know.

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


More information about the llvm-commits mailing list