[libcxx-commits] [libcxx] [libc++] Mark xopen_source test unsupported on OpenBSD (PR #233710)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 19 23:10:54 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Brad Smith (brad0)

<details>
<summary>Changes</summary>

OpenBSD's headers strictly honor _XOPEN_SOURCE. With 500 and 600 the
POSIX.1-2008 locale API (locale_t, uselocale(), LC_*_MASK) is hidden,
and with any value below 800 asprintf() is hidden since it is only
exposed for POSIX.1-2024 or the BSD namespace. libc++'s OpenBSD locale
support relies on these from public headers, so every generated test
fails.

Add an openbsd lit feature and mark the test unsupported, as is
already done for FreeBSD.

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


2 Files Affected:

- (modified) libcxx/test/extensions/posix/xopen_source.gen.py (+6) 
- (modified) libcxx/utils/libcxx/test/features/platform.py (+1) 


``````````diff
diff --git a/libcxx/test/extensions/posix/xopen_source.gen.py b/libcxx/test/extensions/posix/xopen_source.gen.py
index bd14e691de5af..b6318cec324ce 100644
--- a/libcxx/test/extensions/posix/xopen_source.gen.py
+++ b/libcxx/test/extensions/posix/xopen_source.gen.py
@@ -17,6 +17,12 @@
 # additions to provide a conforming library at all.
 # UNSUPPORTED: freebsd
 
+# OpenBSD's <sys/cdefs.h> honors _XOPEN_SOURCE strictly: 500 and 600 hide the POSIX.1-2008
+# locale API (locale_t, uselocale(), LC_*_MASK), and every value below 800 hides asprintf(),
+# which is only exposed for POSIX.1-2024 or __BSD_VISIBLE. libc++'s locale support needs all
+# of these from its public headers (e.g. money_put uses __locale::__asprintf).
+# UNSUPPORTED: openbsd
+
 # RUN: %{python} %s %{libcxx-dir}/utils
 # END.
 
diff --git a/libcxx/utils/libcxx/test/features/platform.py b/libcxx/utils/libcxx/test/features/platform.py
index 5ce4b4a090e49..8af3edf531148 100644
--- a/libcxx/utils/libcxx/test/features/platform.py
+++ b/libcxx/utils/libcxx/test/features/platform.py
@@ -84,6 +84,7 @@ def _getAndroidDeviceApi(cfg):
     ),
     Feature(name="netbsd", when=lambda cfg: "__NetBSD__" in compilerMacros(cfg)),
     Feature(name="freebsd", when=lambda cfg: "__FreeBSD__" in compilerMacros(cfg)),
+    Feature(name="openbsd", when=lambda cfg: "__OpenBSD__" in compilerMacros(cfg)),
     Feature(
         name="LIBCXX-FREEBSD-FIXME",
         when=lambda cfg: "__FreeBSD__" in compilerMacros(cfg),

``````````

</details>


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


More information about the libcxx-commits mailing list