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

Mészáros Gergely via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 5 00:53:21 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:
----------------
Maetveis wrote:

I have a comment above explaining that, did you miss it, or is it not clear enough and should I rephrase?

> ```python
> # Not using mmap.PAGESIZE everywhere because
> # it is not available in WASI, but sysconf is.
> ```

I can change it to mmap.PAGESIZE everywhere if we don't care about about webassembly. I think there are builds of LLVM for it, don't know if they include compiler-rt and if they run lit tests or not.

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


More information about the llvm-commits mailing list